Django

Code

Ticket #1732 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

MR branch #2799, user stupidity in models.py leads to mysteriously missing tables list in admin view

Reported by: ross.lazarus@gmail.com Assigned to: adrian
Component: Admin interface Version: magic-removal
Keywords: Cc:
Triage Stage: Unreviewed Has patch: 0
Needs documentation: 0 Needs tests: 0
Patch needs improvement: 0

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.

Attachments

Change History

05/26/06 14:23:06 changed by adrian

This is happening because django.db.models.loading.get_apps silently passes on ImportError, so that people can have apps without models in them. But the CharacterField is causing an ImportError, which is getting silently eaten by get_apps(). Hmmmm...

05/26/06 14:28:56 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

(In [2995]) Fixed #1732 -- AttributeErrors? in models are no longer ignored by the model validator.


Add/Change #1732 (MR branch #2799, user stupidity in models.py leads to mysteriously missing tables list in admin view)




Change Properties
Action