Pergunta

I'm trying to create a form with only some fields to modify from the django user model, but when i try this code:

class UserEditForm(forms.ModelForm):
class meta:
    model = User
    fields = ['first_name', 'last_name',]

and i do:

user_db = User.objects.get(pk=u_id)
user_form = UserEditForm(instance=user_db)

i get an empty form. Any ideas?

Thank you!

Foi útil?

Solução

thanks

The error is:

class Meta: 

with capital letter.

Thank you!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top