Opened 12 months ago

Closed 12 months ago

Last modified 12 months ago

#22365 closed Uncategorized (invalid)

TypeError at / register()

Reported by: radsepvj@… Owned by: nobody
Component: Uncategorized Version: 1.6
Severity: Normal Keywords: django, admin.py, models.py
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hi there,

I have added two classes (Building and Room) to models.py. But they are not appearing on the app I have deployed. How do I go ahead with this?

I am not sure if this the right way. If I do include Building and Room in admin.py an error occurs. I am not sure of the right way of doing this. Can you please suggest me on this please. Thank you.

admin.py
from django.contrib import admin
from booknowapp.models import Customer, Building, Room

# Register your models here.
admin.site.register(Customer, Building, Room)

I get this error
TypeError at /
register() takes at most 3 arguments (4 given)

Change History (3)

comment:1 Changed 12 months ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 12 months ago by aaugustin

  • Resolution set to invalid
  • Status changed from new to closed

comment:3 Changed 12 months ago by anonymous

Do so:

admin.py
from django.contrib import admin
from booknowapp.models import Customer, Building, Room

# Register your models here.
admin.site.register(Customer)
admin.site.register(Building)
admin.site.register(Room)

Note: See TracTickets for help on using tickets.
Back to Top