Md. Ohiduzzaman,

Looks good so far.  What happens when you try it?

--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.

On 8/16/16 1:34 PM, Md. Ohiduzzaman wrote:
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 Date
2016-09-01       Sept. 15, 2016
2016-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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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.



--
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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
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/c32af6d2-4ab6-73c5-8934-e08b4a3ff0a9%40bristle.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to