A calendar app for Django (inprogress refactor of https://github.com/thauber/django-schedule)
guys please help
i have to compare between 2 data models
STATUS_CHOICES = (
('P', 'Paid'),
('U', 'UNPAID'),
)
class Location(models.Model):
place = models.CharField(max_length=120 , null=True)
def str(self):
return self.place
class Users(models.Model):
# this function has to compare the date in updated and the date after 30 day
# if date in expery is greater than the date in updated >=30 days
# status have to change to unpaid
# the codes below are not correct of course
#def now_plus_30():
# return datetime.now() + timedelta(days = 30)
location = models.ForeignKey(Location , null=True)
name = models.CharField(max_length=60)
phone_number = models.IntegerField(default=0)
price = models.PositiveIntegerField(blank=True)
status = models.CharField(max_length=1, choices=STATUS_CHOICES , default="U")
descrition = models.TextField(help_text="just to try it with the get_description def")
timestamp = models.DateTimeField(auto_now_add=True)
updated = models.DateTimeField(default=now)
expiry = models.DateTimeField(default=now_plus_30())