These are chat archives for django/django
hi everyone, quick question.. kind of a newbie in django
I'm creating a pretty basic admin dashboard for my family business and I need to reflect the "enterprise" account balance. I wanted to create a model (possible unmanaged or abstract) for this cause I don't want to create a database table for it, since its something that is put together on the moment and it doesnt make sense to save it
no such tablewhen I try to enter the
listview of said model
Oh, ok well another option you might try @Dragonwarrior47 is a derived property
class XyzModel(models.Model): name = models.CharField(max_length=NAME_LENGTH) license = models.CharField(max_length=NAME_LENGTH) type = models.CharField(max_length=NAME_LENGTH) violation_time = models.DateTimeField() @property def violation_time_filter(self): return (datetime(year=1980, month=1, day=1, hour=1, minute=1) - self.volcation_time).to_seconds() XyzModel.objects.filter(violation_time_filter > 90000)
hackedish.. i hope that might help?