Abstract model or ContentTypes?

2009-05-27 Thread Michael Keselman
Hello, I have somewhat of a strange situation: Each user has his own calendar and own set of events, and I want the event categories to be models like Assignment, FieldTrip, Test/Quiz, etc. I want it like this so that I can make the event on the rendered calendar a link to the assignment

A strange query

2008-11-29 Thread Michael Keselman
Hey, I wrote some middleware to track users, showing the time they were last seen (see: http://dpaste.com/94701/ ). However, I noticed that django produces a strange query of 'SELECT (1) AS "a" FROM "users_userprofile" WHERE "users_userprofile"."id" = 1' whenever it updates the

Re: Parsing a complex query with many parentheses, ORs, ANDs, and (hopefully) NOTs

2008-11-21 Thread Michael Keselman
On Nov 21, 2008, at 11:46 PM, Malcolm Tredinnick wrote: > > > On Fri, 2008-11-21 at 22:37 -0500, Michael Keselman wrote: >> Hello, >> >> http://pastie.org/private/xvqf5tgjnimiolakhawgg (relevant code) >> >> Django's QuerySets all

Parsing a complex query with many parentheses, ORs, ANDs, and (hopefully) NOTs

2008-11-21 Thread Michael Keselman
Hello, http://pastie.org/private/xvqf5tgjnimiolakhawgg (relevant code) Django's QuerySets allow you to do ORs (unions) pretty nicely with Model.manager.filter(Q(...) | Q(...)). However, ANDs don't work quite as nicely in my situation because I want AND to do what