Django 1.8.x Documentation
obj2, **hints): """ Relations between objects are allowed if both objects are in the primary/replica pool. """ db_list = ('primary', 'replica1', 'replica2') if obj1._state.db in db_list and obj2._state.db allow_migrate(self, db, app_label, model_name=None, **hints): """ All non-auth models end up in this pool. """ return True Finally, in the settings file, we add the following (substituting path.to. with 0.0.1 port=3033 Running a preforked server on a Unix domain socket: ./manage.py runfcgi method=prefork socket=/home/user/mysite.sock pidfile=django.pid Socket security Django’s default umask requires0 码力 | 1685 页 | 6.01 MB | 1 年前3Django 1.8.x Documentation
Relations between objects are allowed if both objects are in the primary/replica pool. """ db_list = ('primary', 'replica1', 'replica2') if obj1._state.db in db_list db, app_label, model_name=None, **hints): """ All non-auth models end up in this pool. """ return True Finally, in the settings file, we add the following (substituting 0.0.1 port=3033 Running a preforked server on a Unix domain socket: ./manage.py runfcgi method=prefork socket=/home/user/mysite.sock pidfile=django.pid Socket security Django’s default umask requires0 码力 | 2454 页 | 2.85 MB | 1 年前3django cms 3.4.x Documentation
CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import ugettext as _ @plugin_pool.register_plugin # register classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable convention for plugin naming is: PollPluginModel: the model class PollPluginPublisher: application: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ @apphook_pool.register # register the application class PollsApphook(CMSApp):0 码力 | 395 页 | 1.64 MB | 1 年前3django cms 3.5.x Documentation
CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import ugettext as _ @plugin_pool.register_plugin # register classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable convention for plugin naming is: PollPluginModel: the model class PollPluginPublisher: application: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ @apphook_pool.register # register the application class PollsApphook(CMSApp):0 码力 | 403 页 | 1.69 MB | 1 年前3django cms 3.3.x Documentation
write the following plugin class: from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import plugin_pool.register_plugin(PollPluginPublisher) # register the plugin Note All plugin classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable apphook for a django CMS application: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class PollsApphook(CMSApp):0 码力 | 386 页 | 1.56 MB | 1 年前3Django CMS 3.11.10 Documentation
classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable convention for plugin naming is: PollPluginModel: the model class PollPluginPublisher: CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import gettext as _ @plugin_pool.register_plugin # register patterns directly, for instance: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool @apphook_pool.register # register the application class PollsApphook(CMSApp): app_name =0 码力 | 493 页 | 1.44 MB | 6 月前0.03django cms 3.10.x Documentation
CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import gettext as _ @plugin_pool.register_plugin # register the classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable convention for plugin naming is: • PollPluginModel: the model class • PollPluginPublisher: for a django CMS application: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool @apphook_pool.register # register the application class PollsApphook(CMSApp): app_name = "polls"0 码力 | 296 页 | 1.79 MB | 1 年前3django cms 3.7.x Documentation
CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import ugettext as _ @plugin_pool.register_plugin # register classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable convention for plugin naming is: PollPluginModel: the model class PollPluginPublisher: for a django CMS application: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool @apphook_pool.register # register the application class PollsApphook(CMSApp): app_name = "polls"0 码力 | 409 页 | 1.67 MB | 1 年前3Django CMS 3.9.x Documentation
CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import gettext as _ @plugin_pool.register_plugin # register classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable convention for plugin naming is: PollPluginModel: the model class PollPluginPublisher: for a django CMS application: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool @apphook_pool.register # register the application class PollsApphook(CMSApp): app_name =0 码力 | 417 页 | 1.68 MB | 6 月前3Django CMS 4.0.x Documentation
CMSPluginBase from cms.plugin_pool import plugin_pool from polls_cms_integration.models import PollPluginModel from django.utils.translation import gettext as _ @plugin_pool.register_plugin # register the classes must inherit from cms.plugin_base.CMSPluginBase and must register themselves with the plugin_pool. A reasonable convention for plugin naming is: • PollPluginModel: the model class • PollPluginPublisher: apphook for a django CMS application: from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool @apphook_pool.register # register the application class PollsApphook(CMSApp): app_name = "polls"0 码力 | 296 页 | 1.79 MB | 6 月前3
共 91 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10