Rockin! That did the trick. I'm not super keen about developing off trunk but i'll live.
Thanks. nibudh. On Feb 5, 1:19 am, Ales Zoulek <ales.zou...@gmail.com> wrote: > Are you using SVN django version, on 1.0? > > If you're on svn, recently "F" object was finished, that should (to my > knowledge) solve just this type of situations... > > Read more on: > > http://groups.google.com/group/django-developers/browse_thread/thread... > > I'm not sure that patch is stable and applied, but that's the way you > need to do your research. > > A. > > > > On Wed, Feb 4, 2009 at 10:51 AM, nibudh <nib...@gmail.com> wrote: > > > Hi, > > > A newbie question here. I'm trying to retrieve all users from the > > system who are basically fully active. ie. not held or paused, and > > lastly only select people who have a duration that is greater than the > > number of 'days' that their contract has been running. > > > The problem seems to be that i'm storing the duration and days in the > > same table. The contracts are not fixed length, they can be extended > > so i decided to store them in the UserContract model. > > > This works except it misses users who have reached the end of their > > contract. > > > User.objects.filter > > (usercontract__held=False,usercontract__pausedate__lte=datetime.now()) > > > here is my UserContract model: > > > class UserContract(models.Model): > > user = models.ForeignKey(User) > > pausedate = models.DateField(null=True,blank=True) > > held = models.BooleanField(default=False) > > days = models.IntegerField(default=0) > > duration = models.IntegerField() > > contract = models.ForeignKey(Contract) > > > How can i do this comparison? > > > p.s.I'm running django 1.0.2 > > > Thanks, > > > nibudh. > > -- > ------------------------------------------------------ > Ales Zoulek > +420 604 332 515 > Jabber: a...@jabber.cz > ICQ: 82647256 > ------------------------------------------------------ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---