google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Using PAGE_CONNECTED_MODELS screw up all the models #150

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. make two models (eg. M1 and M2)
2. connect M1 with pages using PAGE_CONNECTED_MODELS
3. register M2 to the admin site
4. try to add a new M2 object

What is the expected output? What do you see instead?

I should view the M2 "add new item" page, instead an exception is raised 

The exception is the same as the reported in the "fixed" issue 135.

The problem arises in PageAdmin.__init__ that alters a mutable object
(self.inlines) common to *all* the django models.

I attach a small patch that fixes the issue and remove the __init__ method
moving the filling code of the inlines list after the class declaration.

Original issue reported on code.google.com by cinghial...@gmail.com on 19 Aug 2009 at 3:02

Attachments:

GoogleCodeExporter commented 9 years ago
Can you try the last revision? Your patch doesn't apply on the current trunk 
because
there was some modifications.

For example the inline attribute is already present.

Thanks

Original comment by batiste....@gmail.com on 20 Aug 2009 at 7:03

GoogleCodeExporter commented 9 years ago
I applied your changes in the last revisions. Can you have a look?

Original comment by batiste....@gmail.com on 20 Aug 2009 at 4:27

GoogleCodeExporter commented 9 years ago
It works! :) (revision 651)

thank you

Original comment by cinghial...@gmail.com on 21 Aug 2009 at 2:41

GoogleCodeExporter commented 9 years ago

Original comment by batiste....@gmail.com on 25 Aug 2009 at 6:04