Re: Adding a new collapsed form in Flatpages
Thank you sooo much :) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Adding a new collapsed form in Flatpages
Hello TheRedRabbit, On Jan 22, 12:02 pm, TheRedRabbit wrote: > Instead of one form it displayed 3, is there a way to default it to > display only one > form? Perhaps this will do the trick < http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin.extra >. Lots of useful information in the docs. Toodle-l. creecode -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Adding a new collapsed form in Flatpages
Hi Daniel Thanks for the response. I actually tried that and the only issue I had with stacked inline was it made the admin page look real ugly. Instead of one form it displayed 3, is there a way to default it to display only one form? Thanks again. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Adding a new collapsed form in Flatpages
On Saturday, January 22, 2011 6:57:46 PM UTC, TheRedRabbit wrote: > > Im getting this error when I run syncdb: > > Error: One or more models did not validate: > flatpages.flatpage: Accessor for m2m field 'sites' clashes with > related m2m field 'Site.flatpage_set'. Add a related_name argument to > the definition for 'sites'. > my_flatpages.flatpage: Accessor for m2m field 'my_sites' clashes with > related m2m field 'Site.flatpage_set'. Add a related_name argument to > the definition for 'my_sites'. > > > Im not sure whats wrong here. I copied the flatpages app to my python > path so I can modify it > and now this is where Im at??? ;/ You haven't uninstalled the old flatpages model, so there are now two foreign keys pointing from a flatpages model to Site. As the error message clearly states, you need to add a related_name argument to the foreign key definition. However, IMO you're going about this completely the wrong way. There's no need to copy and hack the flatpages model. If you just want to add a related model that you can edit in the admin, then do that: create a new model with a ForeignKey pointing to the original Flatpage, and register a new admin class for Flatpages which includes an inline for your new model (you'll need to call `admin.site.unregister(Flatpage)` first to get rid of the original admin.) -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Adding a new collapsed form in Flatpages
Im getting this error when I run syncdb: Error: One or more models did not validate: flatpages.flatpage: Accessor for m2m field 'sites' clashes with related m2m field 'Site.flatpage_set'. Add a related_name argument to the definition for 'sites'. my_flatpages.flatpage: Accessor for m2m field 'my_sites' clashes with related m2m field 'Site.flatpage_set'. Add a related_name argument to the definition for 'my_sites'. Im not sure whats wrong here. I copied the flatpages app to my python path so I can modify it and now this is where Im at??? ;/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: Adding a new collapsed form in Flatpages
I found this http://groups.google.com/group/django-users/browse_thread/thread/865e1d3b52f18bb6 It explains that you would have to copy the flatpages module and modify it, instead of modifying the actual flatpage in the django installation. The link does not work so Il post my solution once I get it working. In the meantime any help or pointers would be appreciated -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.