Quite simply this is my question:
class A(models.Model):
x = DateTimeField(...)
class B(models.Model):
x = DateField(...)
Given an instance of A and B, how do I simply set b.x to a.x? Simply setting b.x to a.x results in b.x being None.
Thanks in advance.
Use
datetime.datetime.date()to get thedatecomponent like so:See http://docs.python.org/library/datetime.html#datetime-objects for more details.