Pregunta

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!

¿Fue útil?

Solución

thanks

The error is:

class Meta: 

with capital letter.

Thank you!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top