Saturday, November 26, 2016

ORM PostgreSQL stuff


Hello

Is it possible to do in ORM or in PostgreSQL

Assume we have a table with date and price

# class Item(models.Model):
#    price = models.DecimalField()
#    date = models.DateField()

We need for every item in table find division of two prices by two dates and then order_by that result of division


P.S. i can accomplish this via signals but... i don't want to create no more denormalized tables

Tnx in advance :)

--
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+unsubscribe@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/b1b53243-1ba6-4ff9-8493-35519620b3f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment