#1370 closed defect (duplicate)
Admin problems with many to many relationship.
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | magic-removal |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm trying to add a new "post" and i'm getting this error, here is the model design and error:
from django.db import models
class Tag(models.Model):
slug = models.SlugField('Slug', prepopulate_from=("name",), unique=True)
name = models.CharField('Name', maxlength=50)
description = models.CharField('Description', maxlength=500)
class Admin:
list_display = ('name',)
def repr(self):
return self.name
from django.db import models
from django.contrib.auth.models import User
from milkbox.tag.models import Tag
class Post(models.Model):
subject = models.CharField('Subject', maxlength=100)
body = models.TextField('Body')
created = models.DateTimeField('Created Date', auto_now_add=True)
modified = models.DateTimeField('Modified Date', auto_now=True)
user = models.ForeignKey(User, verbose_name='Author')
tags = models.ManyToManyField(Tag, verbose_name='Tags')
class Admin:
list_display = ('id', 'subject', 'created')
ordering = -created
def repr(self):
return self.subject
Traceback (most recent call last):
File "/usr/local/dcurtis/development/magic-removal/django/core/servers/basehttp.py", line 272, in run
self.result = application(self.environ, self.start_response)
File "/usr/local/dcurtis/development/magic-removal/django/core/servers/basehttp.py", line 615, in call
return self.application(environ, start_response)
File "/usr/local/dcurtis/development/magic-removal/django/core/handlers/wsgi.py", line 162, in call
response = self.get_response(request.path, request)
File "/usr/local/dcurtis/development/magic-removal/django/core/handlers/base.py", line 110, in get_response
return self.get_friendly_error_response(request, resolver)
File "/usr/local/dcurtis/development/magic-removal/django/core/handlers/base.py", line 119, in get_friendly_error_response
return callback(request, param_dict)
File "/usr/local/dcurtis/development/magic-removal/django/views/defaults.py", line 69, in server_error
t = loader.get_template(template_name)
File "/usr/local/dcurtis/development/magic-removal/django/template/loader.py", line 80, in get_template
return get_template_from_string(*find_template_source(template_name))
File "/usr/local/dcurtis/development/magic-removal/django/template/loader.py", line 73, in find_template_source
raise TemplateDoesNotExist, name
TemplateDoesNotExist: 500
Change History (2)
comment:1 by , 19 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
If you're looking for the solution to this ticket, see the patches in #1372.