I have a Django Model as follows:
class myModel(models.Model):a = models.IntegerField()b = models.IntegerField()
I want to add a models.BooleanField() named c to the myModel class. However the value of c is simply derived from a and b so I don't want it to be stored in the Database.
I want to c to be True if a > b, otherwise False. I want c to reflect the correct/current value even when a and b get modifed. And I want to be able to access c using myModel.c just like I can access a and b.
Is there any way to do this?
-- You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/d3_X6ZCWMGAJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment