Monday, September 28, 2015

Admin: Unknown fields


I am new to Python and Django so please bear with me.

I have  created a model(below) and would now like to access 
from the admin interface. As per instructions  I found on the 
django site (Part 2 tutorial version 1.8.4) 


class Genus(models.Model):
genus_id = models.AutoField(primary_key=True),
scientific_genus = models.CharField(max_length=32),
common_name = models.CharField(max_length=32),
common_examples = models.TextField(),
genus_choices = (
('Member Banana...','Musa'),
('Avocado...','Persea Americana'),
('Soursop, Custard, Sugar Apple...','Annona Reticulata'),
('Ginger, Tumeric ...','Zingiber Officinale Roscoe'),
('Breadfruit...','Artocarpus Altilis'),
('Cherry ...','Prunus'),
('Grapes ...','Vitis'), 
('Tomato ...','Lycopersicon'), 
('EggPlant ...','????????'), 
('Onion, Garlic ...','Allium'),
('Cashew ...','Anacardium'),
('Rice ...','Oryza'),
('Pepper ...','Capsicum'),
('Orange,Lemon, Lime ....','Citrus')
image_url = models.CharField(max_length=128),
genus = models.CharField(max_length=32,choices=genus_choices),
description = models.TextField()

I edit  ""  so that it now looks like

from django.contrib import admin
from cfxBase.models import Genus
# Register your models here.

class GenusAdmin(admin.ModelAdmin):
    fields = [
    ], GenusAdmin)


Now when I attempt the admin page add entry  for Genus I am getting this 

FieldError at /admin/cfxBase/genus/add/

Unknown field(s) (scientific_genus, genus, common_name, common_examples, 
                  description, image_url) specified for Genus. 

Check fields/fieldsets/exclude attributes of class GenusAdmi

Your help will be  greatly appreciated

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

No comments:

Post a Comment