Saner defaults for plugins #1474

Merged
merged 2 commits into from Oct 11, 2012

Projects

None yet

4 participants

@ojii
Collaborator
ojii commented Oct 11, 2012
  • Fixes #1373.
  • The default name for plugins is now nicer.
  • The render method of plugins now by default adds.
    the instance and placeholder to the context and
    returns it, eliminating the need to overwrite this
    method in simple plugins.
  • By default, admin_preview is now False, as it's often useless.
ojii added some commits Oct 11, 2012
@ojii ojii Saner defaults for plugins
* Fixes #1373.
* The default name for plugins is now nicer.
* The render method of plugins now by default adds.
  the instance and placeholder to the context and
  returns it, eliminating the need to overwrite this
  method in simple plugins.
3ebfde4
@ojii ojii Documented the switch from admin_preview to False 3001362
@digi604
Member
digi604 commented Oct 11, 2012

lgtm

@piquadrat piquadrat commented on the diff Oct 11, 2012
cms/plugin_base.py
@@ -83,7 +83,7 @@ class CMSPluginBase(admin.ModelAdmin):
form = None
change_form_template = "admin/cms/page/plugin_change_form.html"
# Should the plugin be rendered in the admin?
- admin_preview = True
+ admin_preview = False
@piquadrat
piquadrat Oct 11, 2012 Contributor

awesome!

@ojii
ojii Oct 11, 2012 Collaborator

haha I thought this might be mildly controversial, but that reaction is even better :D

@piquadrat
piquadrat Oct 11, 2012 Contributor

most plugins end up as unstyled garbage in the admin preview anyway, especially the more involved ones.

@evildmp
Contributor
evildmp commented Oct 11, 2012

Very nice. And sane.

@piquadrat piquadrat merged commit f2f44b0 into divio:develop Oct 11, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment