I have designed a linked model named Shiftdate as:
class Shiftdate(models.Model):
shift_date = models.DateField(blank=False,unique=True)
sit_date = models.ForeignKey(Sitting,
on_delete=models.CASCADE)
Using this model I changed sit_date to shift_date which is like:
Sitting Date Shifting Date2016-09-01 Sept. 15, 20162016-09-08
Sept. 19, 2016
Now I need to save this shifting date to the Sitting date as sit_date in
Sitting model. My Sitting model is:
class Sitting(models.Model):
sit_date = models.DateField(blank=False,unique=True)
cut_off_date = models.DateField(null=True, blank=True)
ballot_date = models.DateField(null=True, blank=True)
sess_no = models.ForeignKey(Session,
on_delete=models.CASCADE)
genre = TreeForeignKey('Genre', null=True, blank=True, db_index=True)
I use
def get_shift_date(self):
return self.sit_date=self.shift_date
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/8894d393-5d97-4c97-ba56-1a319d93acec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.