71👍
It should be model
instead of Model
:
class PickForm(ModelForm):
class Meta:
model = Car
- [Django]-Get name of primary field of Django model
- [Django]-Allowing only super user login
- [Django]-Nginx and supervisor setup in Ubuntu
9👍
Just do this method your page will run:
class PickForm(ModelForm):
class Meta:
model = Car
fields = "__all__"
- [Django]-Python regex for integer?
- [Django]-Heroku, postgreSQL, django, comments, tastypie: No operator matches the given name and argument type(s). You might need to add explicit type casts
- [Django]-.filter() vs .get() for single object? (Django)
5👍
In my case, the error occurs because I wrote
class META
instead, it should be
class Meta
- [Django]-Django-rest-framework: api versioning
- [Django]-Django: how do I query based on GenericForeignKey's fields?
- [Django]-ForeignKey to abstract class (generic relations)
3👍
In my case the error was due to me wirting :
models = User
instead of :
model = User
- [Django]-What are the best practices to use AngularJS with Django
- [Django]-Django rest framework: query parameters in detail_route
- [Django]-Where to put Django startup code?
1👍
class PickForm(ModelForm):
class Meta:
Model = Car`
Here the Model is case sensitive, so use model instead of Model.
so the code becomes
class PickForm(ModelForm):
class Meta:
model = Car
- [Django]-Django, template context processors
- [Django]-Django: how to do calculation inside the template html page?
- [Django]-Django gunicorn sock file not created by wsgi
0👍
If this is a copy and past, you have a typo. I would highly recommend you use an IDE or something with error checking. Eclipse is what I use. It will save you a ton of time from little annoyances like this.
class PickForm(ModelForm):
class Meta:
Model = Car`
Your typo is right on the end of Car. The little apostrophe thing.
- [Django]-How to subquery in queryset in django?
- [Django]-How do I get odd and even values in a Django for loop template?
- [Django]-How to access the user profile in a Django template?
0👍
see your code in your defined form code area.there may be error either with =,: and meta,Meta .so please look carefully if case sensitive error or any signs over there
- [Django]-How to add custom search box in Django-admin?
- [Django]-Use get_queryset() method or set queryset variable?
- [Django]-What's the best solution for OpenID with Django?
0👍
I got this error just by writing model: Comment
instead of model = Comment
🤦♂️
- [Django]-How do I set up a Django website on Amazon EC2 hosting?
- [Django]-Django Rest Framework Conditional Field on Serializer
- [Django]-Trying to migrate in Django 1.9 — strange SQL error "django.db.utils.OperationalError: near ")": syntax error"
-1👍
You missed the basic step of registering your model to the admin. Please do that and that should work for you.
In the admin.py
file of your app add these lines:
from yourapp.models import yourmodel
admin.site.register(yourmodel)
Here yourapp
and yourmodel
needs to be replaced with the correct names for your app and model.
- [Django]-Visual Studio Code: Intellisense not working
- [Django]-Running a specific test case in Django when your app has a tests directory
- [Django]-Django Rest Framework Token Authentication