Skip to content
Advertisement

Tag: django-queryset

django: group by extracting month and year from a date

im trying to get a list of invoicepositions where there hasn’t been payed an payout to a person. Looking in the internet i came to this “Solution” but the query, that comes out is: so he added “created_at” and the id from the invoiceposition model although i don’t want that! for example i have the following 4 lines in the

Django many-to-many: Best way to get elements in one related query set but exclude elements in other related query sets?

Consider these related models: In a view, I need to query to get all Bs related to a given A while excluding all Bs related with a set of other As. I need the grey area: My current, grossly inefficient approach is as follows: In my application, previous_As could have nearly 1,000 elements, which makes this approach extremely expensive. Is

Advertisement