just wanted to confirm that this is a bug before posting it on
tracker. Any comments are welcome it will be my first bug report on
django :)
Problem
========
If you have a model with a primary key field that has the value
'add' you won't be able to edit it in the admin screens. the admin
will take you to the add page instead of the change page for that
record. this is a problem with the design of the urls in the admin
module.
admin.py
=========
from polls.models import poll
from django.contrib import admin
admin.site.register(poll)
model.py
=========
from django.db import models
class poll(models.Model):
id = models.CharField(max_length=200, primary_key=True)
question = models.CharField(max_length=200)
Reproducing
============
1. Create project and app, enable admin, add the above files and syncdb.
2. Go to the admin interface and select Add poll
3. specify 'add' as the id and 'test' as question
4. Save
5. Go back to the list
6. Open the same object
7. you will be taken to the add poll screen instead of the change
poll screen for the selected object
cheers,
Marwan
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment