Opened 19 years ago
Closed 19 years ago
#1732 closed enhancement (fixed)
MR branch #2799, user stupidity in models.py leads to mysteriously missing tables list in admin view
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | contrib.admin | Version: | magic-removal |
Severity: | minor | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | UI/UX: |
Description
This is definitely a user error, but the failure is silent which was confusing for a few minutes...
While developing a complex model.py, I introduced a bogus
casePCPid = models.CharacterField('PCP',maxlength=20,blank=True)
instead of
casePCPid = models.CharField('PCP',maxlength=20,blank=True)
Stupidity - all my own fault.
Unfortunately, 0 errors are reported when manage.py runserver checks the models, but none of the application tables showed up in the admin list. Took a while to track down and might be a trap for young players (like me)... I'll take a poke at it but this is probably a fix someone familiar with the model checking code will need to make. This is with the latest MR branch svn - I was using an older one but updated - same problem - models validate ok but the admin is missing ALL the tables.
Change History (2)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
This is happening because
django.db.models.loading.get_apps
silently passes onImportError
, so that people can have apps without models in them. But theCharacterField
is causing anImportError
, which is getting silently eaten byget_apps()
. Hmmmm...