Skip to content
Advertisement

Tag: django

django manytomany field inseting empty data

model view serializers error: It means dependents is not inserting Here I am trying to send nested data for my dependents(ManyToManyField) But, Getting above error while inserting data. Is there any way we can achive this ? Above is the data i am sending using post method. please have a look Answer

AttributeError: ‘NoneType’ object has no attribute ‘lower’. for django-comments-dab app

I want to use django-comments-dab but I meet this Error, AttributeError: ‘NoneType’ object has no attribute ‘lower’. Request Method: GET Request URL: http://127.0.0.1:8000/2020/9/6/test4 Django Version: 3.1.1 Exception Type: AttributeError Exception Value: ‘NoneType’ object has no attribute ‘lower’ Exception Location: D:amirblogvenvlibsite-packagescommentutils.py, line 26, in get_model_obj Python Executable: D:amirblogvenvScriptspython.exe utils.py Answer model_name is None and not a string. Only strings have the

Django ModelForm has no model class specified, Although model in Meta class is set to a model

Error is “ModelForm has no model class specified.” forms.py code models.py code views.py code The error is occurs when I’m trying to create a new user form (user_form = UserForm()). Although in my meta class I set models to the User model imported from django.contrib.auth.models. Error Info Picture Answer I think your spellings in your forms are wrong could you

Django: def save() in models.py

I’m trying to add the save-function inside my models.py, but it seems I’m doing something wrong. The user has to type the first- and last-name. Without him or her entering any more data, another field inside my models.py should be filled with a combination from these fields. models.py: Is this even possible? Thanks for all your help. Have a nice

Passing an html element from anchor tag to django view

I would like to know how i can pass the html link element as a string into a django view and have the information rendered on that specific view. to be clear: I have this In html A django view rendered the items from a list and each item would ideally be clickable and the specific item would be passed

Advertisement