Code


Version 3 (modified by oubiwann, 9 years ago) (diff)

--

Common Pitfalls - Data Models

Foreign Keys

the 'edit_inline' option

Warning

As mentioned elsewhere in the documentation, if you are using edit_inline in data model's foreign key, be sure the rest of your fields use the option core=True. Failure to do so will lead to obscure errors or no errors.

Symptoms

The following error: AttributeError: 'User' object has no attribute 'get_message_list'

Image/File Fields

providing an image field in without media configured

Warning

If you are going to have an image field in your data model, you have to have a directory configured where the images will be saved. The entry in the database for the image field is a string of the filesystem path where the image is/will be saved.

Symptoms

Data not being posted to the database with a refresh of the "add" screen.