
self. (this is my first question on stackoverflow. django django models django south postgresql python. (i know my eng is’t good, but I hope, people will understand what I’m trying to say) Return render(request, 'users/profile_create.html', īut i get the same error every time “‘ProfileForm’ object has no attribute ‘cleaned_data'” If user_form.is_valid() and profile_form.is_valid(): On both, User and Profile I created a ModelForm: class UserForm(forms.ModelForm):įields = ('username', 'email', 'first_name', 'last_name')įields = ('third_name', 'sex', 'grade', 'age', 'school', 'interest')Īnd wrote a view for registration: def create_profile(request): Interest = models.ManyToManyField(OlympiadSubject,

School = models.ForeignKey(School, on_delete=models.PROTECT, Grade = models.CharField(max_length=2, choices=GRADE_CHOICES, default="1",Īge = models.PositiveSmallIntegerField(default=7, verbose_name="Возраст",

When I simply try print(vyroci.vyrocimesicV()) in the. Third_name = models.CharField(max_length=30, verbose_name="Отчество") I have following problem: I would like to call a function vyrocimesicV from a module vyroci in my view.py. Sex = models.CharField(max_length=1, choices=SEX_CHOICES, default="М", User = models.OneToOneField(User, on_delete=models.CASCADE) If you only want a subset of fields to be serialized, you can specify a fields argument to the serializer: from re import serializers data rialize('xml', (), fields ('name','size')) In this example, only the name and size attributes of each model will be serialized. Standart model User is not enought for me, so I created another model named Profile: class Profile(models.Model):
#Django Serialize Dict Object Has No Attribute Meta registration#
I’m trying to make a registration page for my project. Django Serialize Dict Object Has No Attribute Meta In English Recommendpython - Django REST framework: AttributeError: Serializer object has no attribute 'Meta' python - coding: utf-8 -from django.db import modelsclass StationReport(models.Model): waterlevel models.IntegerField(maxlength5, blankFalse) username models.
