@@ -629,15 +629,15 @@ achieve this functionality:
629
629
</div>
630
630
631
631
632
- ***************************************
633
- Plugin Attributes and Methods Reference
634
- ***************************************
632
+ **********************************************
633
+ CMSPluginBase Attributes and Methods Reference
634
+ **********************************************
635
635
636
- Plugin Attribute Reference
637
- ==========================
638
-
639
- A list of all attributes a plugin has and that can (or should) be overwritten:
636
+ These are a list of attrbibutes and methods that can (or should) be overridden
637
+ on your Plugin definition.
640
638
639
+ Attributes
640
+ ==========
641
641
642
642
admin_preview
643
643
-------------
@@ -647,7 +647,6 @@ Default: ``False``
647
647
Should the plugin be previewed in admin when you click on the plugin or save it?
648
648
649
649
650
-
651
650
allow_children
652
651
--------------
653
652
@@ -739,6 +738,8 @@ Default: ``CMSPlugin``
739
738
If the plugin requires per-instance settings, then this setting must be set to
740
739
a model that inherits from :class: `CMSPlugin `.
741
740
741
+ See also: `Storing Configuration `_
742
+
742
743
743
744
page_only
744
745
---------
@@ -768,7 +769,7 @@ render_plugin
768
769
Default: ``True ``
769
770
770
771
Should the plugin be rendered at all, or doesn't it have any output? If
771
- `render_plugin ` is ``True ``, then you must also define `render_template `
772
+ `render_plugin ` is ``True ``, then you must also define :meth: `render_template `
772
773
773
774
See also: `render_template `_
774
775
@@ -806,43 +807,8 @@ Can the plugin be inserted inside the text plugin? If this is ``True`` then
806
807
See also: `icon_src `_, `icon_alt `_
807
808
808
809
809
- translatable_content_excluded_fields
810
- ------------------------------------
811
-
812
- Default: ``[] ``
813
-
814
- A list of plugin fields which will not be exported while using
815
- :meth: `get_translatable_content `.
816
-
817
- See also: `get_translatable_content `_, `set_translatable_content `_
818
-
819
-
820
- Plugin Method Reference
821
- =======================
822
-
823
- A list of all methods a plugin has and that can (or should) be overwritten:
824
-
825
-
826
- get_translatable_content
827
- ------------------------
828
-
829
- Get a dictionary of all content fields (field name / field value pairs) from
830
- the plugin.
831
-
832
- .. note :: This method not be used on the plugin but rather on the plugin's
833
- instance.
834
-
835
- Example::
836
-
837
- from djangocms_text_ckeditor.models import Text
838
-
839
- plugin = Text.objects.get(pk=1).get_plugin_instance()[0]
840
- plugin.get_translatable_content()
841
- # returns {'body': u'<p>I am text!</p>\n'}
842
-
843
-
844
- See also: `translatable_content_excluded_fields `_, `set_translatable_content `_
845
-
810
+ Methods
811
+ =======
846
812
847
813
icon_src
848
814
--------
@@ -895,19 +861,91 @@ The default implementation is as follows::
895
861
See also: `text_enabled `_, `icon_src `_
896
862
897
863
864
+ ******************************************
865
+ CMSPlugin Attributes and Methods Reference
866
+ ******************************************
867
+
868
+ These are a list of attrbibutes and methods that can (or should) be overridden
869
+ on your plugin's `model ` definition.
870
+
871
+ See also: `Storing Configuration `_
872
+
873
+
874
+ Attributes
875
+ ==========
876
+
877
+
878
+ translatable_content_excluded_fields
879
+ ------------------------------------
880
+
881
+ Default: ``[] ``
882
+
883
+ A list of plugin fields which will not be exported while using
884
+ :meth: `get_translatable_content `.
885
+
886
+ See also: `get_translatable_content `_, `set_translatable_content `_
887
+
888
+
889
+ Methods
890
+ =======
891
+
892
+
893
+ copy_relations
894
+ --------------
895
+
896
+ Handle copying of any relations attached to this plugin. Custom plugins have
897
+ to do this themselves.
898
+
899
+ ``copy_relations `` takes 1 argument:
900
+
901
+ * ``old_instance ``: The source plugin instance
902
+
903
+ See also: `Handling Relations `_, `post_copy `_
904
+
905
+
906
+ get_translatable_content
907
+ ------------------------
908
+
909
+ Get a dictionary of all content fields (field name / field value pairs) from
910
+ the plugin.
911
+
912
+ Example::
913
+
914
+ from djangocms_text_ckeditor.models import Text
915
+
916
+ plugin = Text.objects.get(pk=1).get_plugin_instance()[0]
917
+ plugin.get_translatable_content()
918
+ # returns {'body': u'<p>I am text!</p>\n'}
919
+
920
+
921
+ See also: `translatable_content_excluded_fields `_, `set_translatable_content `_
922
+
923
+
924
+ post_copy
925
+ ---------
926
+
927
+ Can be overriden to handle more advanced cases (eg Text Plugins) after the
928
+ original has been copied.
929
+
930
+ ``post_copy `` takes 2 arguments:
931
+
932
+ * ``old_instance ``: The old plugin instance instance
933
+ * ``new_old_ziplist ``: [unclear at time of this edit]
934
+
935
+ See also: `Handling Relations `_, `copy_relations `_
936
+
937
+
898
938
set_translatable_content
899
939
------------------------
900
940
901
941
Takes a dictionary of plugin fields (field name / field value pairs) and
902
942
overwrites the plugin's fields. Returns ``True `` if all fields have been
903
943
written successfully, and ``False `` otherwise.
904
944
905
- .. note :: This method not be used on the plugin but rather on the plugin's
906
- instance.
907
-
908
945
set_translatable_content takes 1 argument:
909
946
910
- * ``fields ``: A dictionary containing the field names and translated content for each.
947
+ * ``fields ``: A dictionary containing the field names and translated content
948
+ for each.
911
949
912
950
Example::
913
951
0 commit comments