Hi.

I have a situation very similar to the following;

[code]

class chars(models.Model):
         name=moels.CharField('Name',max_length=32)
 
associated_id=models.IntegerField('Associated',blank=False,null=False)
         associated_id.default=0

class ctor(models.Model):
          A=models.ForeignKey(chars,blank=False,null=False)
          B=models.CharField('Text',max_length=512)

[/code]

I would like to generate a form using ModelForm. I started with

[code]

class ctorForm(ModelForm):
    class Meta:
        model=ctor

[/code]

This generates a form, but when rendered the A field of ctor becomes a
selectable list of all entries in chars.

I would like the A field of the ctorForm to be a selectable list of
only the entries in chars whose associated_id matches the ID of the
currently logged in user. (login sessions are handled by django auth,
or django authopenid)

I'd like to stick to creating the form using ModelForm if it's
possible.

cheers,

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to