So  here are my models:

*     class Mess(models.Model):*
    muser = models.OneToOneField(User)
    MESS_NAME = (('GH','girls hostel top mess'),
                    ('IH','girls hostel down mess'),
                    ('MM','Mega mess'),
                    ('FB','First Block mess'),
                    ('SB','Second Block mess'),
                    ('TB','Third Block mess'),
                    )
    mess_name = models.CharField(max_length=25, choices = 
MESS_NAME,primary_key=True)
    per_day_cost = models.IntegerField()
    def __str__(self):
        return self.mess_name

*class MessMenu(models.Model):*
    mess_name = models.ForeignKey(Mess)
    day = models.DateField()
    morning = models.TextField()
    afternoon = models.TextField()
    snacks = models.TextField()
    dinner = models.TextField()
    def __str__(self):
        return self.mess_name

Once i create an object in MessMenu I want django to delete that object 
after 7 days. Please let me know how to delete a certain object after a 
given period of time.

-- 
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/6dcf1a57-7a89-40e1-b6e7-fbd28e78c27d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to