Newbie help with limit_choices_to on ManyToMany

2008-10-06 Thread Lars Stavholm
Hi All, I'm rather new to django (and python) so I tend to get lost sometimes: I'm looking to limit the choices in a ManyToMany relationship: class Computer(models.Model): host = models.CharField(max_length = 20, unique = True) def __unicode__(self): return self.host class Conf

help with limit_choices_to

2008-05-08 Thread Matias Surdi
Hi. I've the following model: class ExamAttributeCalification(models.Model): exam_result = models.ForeignKey(ExamResult, edit_inline=models.TABULAR, num_in_admin=1) exam_attribute = models.ForeignKey(ExamAttribute,limit_choices_to={"exam__id":1}) calification = models.IntegerField

Re: Help with limit_choices_to

2007-05-15 Thread xgdlm
> At the moment, the easiest way I see to to that is to include a JS > file that will catch the current member_id, then call an external page > that will return a JSON string of > "Folder.objects.filter(member=member) " query_set and then build the > wished multiselected box .. I'll try that way

Re: Help with limit_choices_to

2007-05-14 Thread xgdlm
Hello Thank you Malcolm for your fast answer (as usual) > However, you > cannot pass parameters to that function: it's mostly for use with things > like datetime.datetime.now -- where the result of the function does not > depend on "self" in any fashion. Hum, that what I understood, but now I

Re: Help with limit_choices_to

2007-05-14 Thread Malcolm Tredinnick
On Mon, 2007-05-14 at 08:45 +, xgdlm wrote: > Hello all ! > > I have trouble using limit_choices_to on the following modele. I > searched the group and googled but I couldn't find the solution. > > Here is my modeles : > - > cla

Help with limit_choices_to

2007-05-14 Thread xgdlm
Hello all ! I have trouble using limit_choices_to on the following modele. I searched the group and googled but I couldn't find the solution. Here is my modeles : - class Member(models.Model): login = models.CharField(maxlen