Re: custom validator or other way to avoid double bed bookings (almost solved)

2007-02-12 Thread Nebojša Đorđević
* Benedict Verheyen wrote, On 12.02.2007 12:03: > Benedict Verheyen schreef: > > > I almost succeeded in getting there. > I can get the rooms i want via this command: > > r = models.ForeignKey(Room, blank=True, null=True, limit_choices_to = > Room.objects.exclude(id__in=[patient.room.id for pat

Re: custom validator or other way to avoid double bed bookings (almost solved)

2007-02-12 Thread Benedict Verheyen
Benedict Verheyen schreef: I almost succeeded in getting there. I can get the rooms i want via this command: r = models.ForeignKey(Room, blank=True, null=True, limit_choices_to = Room.objects.exclude(id__in=[patient.room.id for patient in Patient.objects.filter(room__isnull=False)]) ) However,

Re: custom validator or other way to avoid double bed bookings

2007-02-12 Thread Benedict Verheyen
Nebojša Đorđević schreef: > On Feb 9, 2007, at 09:32 , Benedict Verheyen wrote: > > > Have you tried `limit_choices_to` (http://www.djangoproject.com/ > documentation/model_api/#many-to-one-relationships) to filter out all > of the used beds from the select list. > > Do you use Django admin

Re: custom validator or other way to avoid double bed bookings

2007-02-12 Thread Benedict Verheyen
Nebojša Đorđević schreef: > > Have you tried `limit_choices_to` (http://www.djangoproject.com/ > documentation/model_api/#many-to-one-relationships) to filter out all > of the used beds from the select list. > > Do you use Django admin interface or the custom form? Hi, no i haven't tried l

Re: custom validator or other way to avoid double bed bookings

2007-02-10 Thread Nebojša Đorđević
On Feb 9, 2007, at 09:32 , Benedict Verheyen wrote: > my app is used to manage patients of a ward in a hospital. > This ward has a number of beds available. > A patient has a room id referring to the room/bed where he's laying. > > Now i would want to avoid being able to select a bed that is >