0

I have a models.py which looks like this :

from django.db import models
from django.contrib.auth.models import User

class Change(models.Model):
RFC = models.CharField(max_length=10)
Ticket_Number = models.CharField(max_length=10)
Plan_Owner = models.ForeignKey(User, related_name='plan_owner', unique=True)
Change_Owner = models.ForeignKey(User, related_name='change_owner', unique=True)

My admin.py is as follows :

from django.contrib import admin

class ChangeAdmin(admin.ModelAdmin):
search_fields = ('RFC', 'Ticket_Number','Plan_Owner')
list_display = ('RFC', 'Ticket_Number','Plan_Owner')

fieldsets = [
    ('Ticket Details', {
        'fields': ['RFC', 'Ticket_Number']}),
    ('Implementation details', {
        'fields': ['Plan_Owner', 'Change_Owner']})
            ]

admin.site.register(Change, ChangeAdmin)

This gives me an error saying

Exception Value: 'tuple' object is not callable

Full traceback here : http://pastebin.com/35nsKzQH

Amistad
  • 7,100
  • 13
  • 48
  • 75
  • What does your title have to do with the question? There doesn't seem to be any indication that importing User is a problem. – Daniel Roseman Dec 22 '13 at 11:24
  • Please post the full traceback – sk1p Dec 22 '13 at 11:28
  • Sk1p..i have made edits to the models and the admin..also see link for the tracebck – Amistad Dec 22 '13 at 11:52
  • Are you sure you pasted the code from `admin.py` like it is in your file? The error looks like you are/were missing a comma – sk1p Dec 22 '13 at 11:58
  • Yes..i have pasted exactly the same..and it is quite strange..because when i remove Change_Owner from the fieldset ..it works perfectly fine..It is only when I use 2 foreign keys in the same fieldset that i get the error.. – Amistad Dec 22 '13 at 12:17

0 Answers0