KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Here is the error TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases The class in question within my models.py class Business(models.Model, forms.Form): name = models.CharField(max_length=128) tel_no = models.CharField(max_length=11) address_ln1 = models.CharField(max_length=128) address_ln2 = models.CharField(max_length=128) city = models.CharField(max_length=64) county = GBCountySelect() postcode = GBPostcodeField() website = models.URLField(max_length=128) # Logging Info slug = models.SlugField() date_added = models.DateField(auto_now_add=True) time_added = models.TimeField() added_by_user = models.CharField(max_length=64) last_edit_time = models.TimeField(auto_now=True) last_edit_date = models.DateField(auto_now=True) The line I am getting the error on: name = models.CharField(max_length=128) But I (think) it means this one: class Business(models.Model, forms.Form): I'm not sure what it means exactly, how can I inherit my models from models.Model and forms.Form within the same class? Can I not pass two values when creating my class? If so how? ANOTHER EDIT All my imports from django.db import models from django import forms from django.contrib.localflavor import generic from django.contrib.localflavor.gb.forms import GBPostcodeField, GBCountySelect Full traceback: Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/home/jws1000/.virtualenvs/glutenfree/lib/python2.7/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line utility.execute() File "/home/jws1000/.virt
Tags (comma-separated)
Save Edits
Cancel