Skip to content
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

More flexibility in custom Page types and managers #105

Closed
wants to merge 10 commits into from
Closed

More flexibility in custom Page types and managers #105

wants to merge 10 commits into from

Conversation

douwevandermeij
Copy link
Contributor

Changes:

  • reformatted some code in pep8 format (120 characters)
  • ability to override the PageManager from your own project
  • ability to override the ContentItemManager from your own project
  • ability to create subclasses of Page
  • added content_type to Page model to be able to instantiate the subclass when opening a Page
  • ability to change the content_type in admin to change the type of the Page
  • added Page.is_public field in South migration
  • added Page.content_type field in South migration
  • made some performance optimization when looking for the right Page object by a singleton
  • added a load_class function to be able to import classes by fully qualified classname strings

Douwe van der Meij added 8 commits July 3, 2012 14:50
…er and a ContentItemManager in the app_settings so they can be overridden by other applications, changed models.py to use the PageManager and ContentItemManager from the app_settings (using the class loader)
…only Page objects, added content_type to Page model so we have information about subtypes in a Page object + a South migration script, store the subtype when saving objects in Page, instantiate objects of the subclass using the content_type when having a Page object, added a handle function to Page so we can add external logic when handling the request, added a hook in the page request handler to execute external logic
…erPageMixim.get_fiber_page function (stores the same page as the PageSingleton), removed handle function from Page model, removed call to handle function of model (extra handlers should be implemented as context processors now with a check if the page is an instance of the right subclass; a context processor per subclass of Page)
…name and required, in admin the content_type has a filtered queryset of the classes that derive from Page and Page itself, when changing the type of a Page to a subclass the corresponding entry in the database (automatic one-to-one relationship) will be created using the ORM, when changing the type back to Page the relationship will be removed via a fake unmanaged model class so the Page will be still there but the one-to-one relationship is removed (and thus the entry in the database)
mvdwaeter pushed a commit to mvdwaeter/django-fiber that referenced this pull request Aug 14, 2012
…er and a ContentItemManager in the app_settings so they can be overridden by other applications

- changed models.py to use the PageManager and ContentItemManager from the app_settings (using the class loader)
- added credits to douwevandermeij
- Issue django-fiber#105
@dbunskoek
Copy link
Contributor

Hi Douwe,

A lot has happened in the mean time. Do you still use Fiber? And do you still want (more) stuff that's in this pull request to be merged? If so, please contact me (you have my e-mail, right?) so we can discuss the right approach for this. I'm closing this issue / pull request for now...

@dbunskoek dbunskoek closed this Jan 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants