#16795: ORM masks exception in Python shells
------------------------+----------------------------------------------
Reporter: frankwiles | Owner: nobody
Type: Bug | Status: new
Milestone: | Component: Database layer (models, ORM)
Version: 1.3 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------+----------------------------------------------
If you have a simple model and add a field to it, creating a South
migration, but neglect to run the migration querying the model returns an
empty list rather than raising an exception. Properly raises
DatabaseError in a template however.
Steps to reproduce:
1. Create a simple model named say TestModel with a field.
2. Populate it with some data.
3. Create initial migration.
4. fake your initial
5. Add a new field
6. Create migration or not, but in either case do not run it to alter the
table
7. run TestModel.objects.all() in Python shell (also happens in IPython)
and it returns []
When visiting a view that uses that same QuerySet it properly raises a
DatabaseError (from a psycopg2 ProgrammingError), but not in the shell. I
couldn't find any place in the backend where it's being caught and
silently ignored. Attached template debug page.
--
Ticket URL: <https://code.djangoproject.com/ticket/16795>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.