icn
icn

Reputation: 17886

django model fields comparison

is there a way l can compare two columns | fields in django like

Invoice.objects.filter(amountdue_lt=invoiceamount)

where amountdue and invoiceamount are two columns of Invoice object

Thanks

Upvotes: 1

Views: 834

Answers (1)

synic
synic

Reputation: 26678

You can, in Django 1.1 using the F() object

Upvotes: 4

Related Questions