python - Wrong Link Text in Django App -


i'm messing around django first time here , i've got preliminary stuff set up. on admin page, have custom app database functionality working correctly. however, link text incorrect (highlighted in red here). should "recipes" without second "s." can't figure out why happened or how fix it. here's code key files i've checked.

settings.py

installed_apps = (     'django.contrib.auth',     'django.contrib.contenttypes',     'django.contrib.sessions',     'django.contrib.sites',     'django.contrib.messages',     'django.contrib.staticfiles',     'recipes',     # uncomment next line enable admin:     'django.contrib.admin',     # uncomment next line enable admin documentation:     # 'django.contrib.admindocs', ) 

models.py

from django.db import models  class recipes(models.model):     name = models.charfield(max_length=100)     ingredients = models.charfield(max_length=1000)      def __unicode__(self):         return self.name + " / " + self.ingredients 

admin.py

from recipes.models import recipes   django.contrib import admin  admin.site.register(recipes) 

for record, folder app named "recipes".

how can fix link?

you missing meta information. verbose_name, default have model name, , verbose_name_plural, default have s appended verbose_name. need override that.

class recipes(models.model):     name = models.charfield(max_length=100)     ingredients = models.charfield(max_length=1000)      def __unicode__(self):         return self.name + " / " + self.ingredients      class meta:         verbose_name = "recipe"         verbose_name_plural = "recipies" 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -