Hello,

I have a UserProfile model:

class UserProfile(FacebookProfileModel):
    user = models.ForeignKey(User, unique=True)                                 
                                                                                
                                                 
    lastfm_user = models.CharField(max_length=20, blank=True)

This should be turned into a real HTML form , I which to use the ModelForm 
class for this.

class UserProfileForm(ModelForm):
    class Meta:
                model = UserProfile
                # I can select lastfm_user or any other properties I have 
defined in the UserProfile model 
                # But what if I wanted to only show the user__username field in 
the form ?
                
                # This doesn't work
                fields = ('user__username',)

I've searched the docs , read the page about creating froms from models but 
didn't found any clues. 
Is this even possible at all ?

Now I'm implementing the form by hand , which is a lot of work , being able to 
use the ModelForm would speed up this process.

Regards,


Jonas Geiregat
jo...@geiregat.org





-- 
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.

Reply via email to