-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flexible Base model class #8
Comments
I'm not sure about this idea. To understand it better, I'd rather love to see the use case laid out in front of me. Another reason to avoid this, is because it breaks the south migrations. If it's really needed, it will be added quickly, but I'd rather experiment with the possibilities first before adding such irreversible design decision to the app yet. In this case, it can be worked around with, and if this proves to be needed often a clean solution can be extracted from that experience. There is something similar I did consider, and that's adding a custom "json" field that is displayed as a nice fieldset with form fields. This would be useful if you have some custom meta properties (e.g. a background image) you'd like to define for all pages. That may also address some of the reasons (but not all) of the use cases here. |
Well, consider the above example (using your own created pagetypes, and one or more of the default available pagetypes). Your website is up and running well, but after a few months, the client wants to be able to upload a unique background image for every page. In the way it works at the moment, this is just not possible to achieve without modifying the core. Ideally, you would add a |
agreed.. also discussed on IRC that another use case is extending 3rd party apps, which wouldn't be possible otherwise. While I'd prefer something that doesn't involve manual south-coding, I can see value in this idea. |
There is a use case where you might want to use the already available page types (for example the fluentpage app) and a bunch of self created page types. At the moment it's not possible to create one base class for this. This would be necessary if you want to create a few default fields for all of your pages (like
keywords
&description
fromHtmlPage
).I'm not sure what would be the best way to achieve something like this, but I'm thinking about adding an extra base model class to settings.py, and letting
UrlNode
orPage
extend this. This way you can easily create your own Base model (with your own required fields), without modifying anything of the core.Again, what do you think?
The text was updated successfully, but these errors were encountered: