Ejemplo n.º 1
0
try:
    import json
except:
    import simplejson as json

from django_wizard.wizard import config_index as configs
from django_wizard.wizard import fixtures_index as fixtures
from django_wizard.models import ConfigOption, ConfigFixture

_CURRENT_APP = "django_userhistory"

UserActionFixture = ConfigFixture(
    help_text="Configure the user actions that will be tracked.", app_label=_CURRENT_APP, module_name="useraction"
)

UserTrackedContentFixture = ConfigFixture(
    help_text="""Configure content that when saved will be attributed to an user's history of actions.""",
    app_label=_CURRENT_APP,
    module_name="usertrackedcontent",
)

fixtures.register(UserActionFixture)
fixtures.register(UserTrackedContentFixture)
Ejemplo n.º 2
0
                                   )

REPUTATION_REQUIRED_TEMPLATE = ConfigOption(app = _CURRENT_APP,
                                            name = 'REPUTATION_REQUIRED_TEMPLATE',
                                            help_text = """Template to render when user fails a reputation check.""",
                                            default = json.dumps("django_reputation/reputation_required.html"),
                                            available_options = json.dumps(''),
                                            required = True,
                                            )

configs.register(REPUTATION_ENABLED)
configs.register(MAX_REPUTATION_GAIN_PER_DAY)
configs.register(MAX_REPUTATION_LOSS_PER_DAY)
configs.register(BASE_REPUTATION)
configs.register(REPUTATION_REQUIRED_TEMPLATE)

ReputationContentFixture = ConfigFixture(help_text = 'Configure models that when modified can change a users reputation.  Example: Vote.',
                                         app_label = _CURRENT_APP,
                                         module_name = 'reputationcontent')

ReputationActionFixture = ConfigFixture(help_text = 'Configure user actions that can effect another users reputation such as voting or flagging content.',
                                         app_label = _CURRENT_APP,
                                         module_name = 'reputationaction')

PermissionFixture = ConfigFixture(help_text = 'Configure the levels of permission which grant access to the site.',
                                             app_label = _CURRENT_APP,
                                             module_name = 'permission')

fixtures.register(ReputationContentFixture)
fixtures.register(ReputationActionFixture)
fixtures.register(PermissionFixture)
Ejemplo n.º 3
0
                              name = 'UPDATE_MODES',
                              help_text = """Modes of operation for django_relatedcontent.  Determines how content gets associated.  In form/js mode, when an object is associated, it will be
rendered inside the related target dom element and data will be added to the relatedcontent data dom element.  This mode is useful for creating new objects when the primary id of the primary object
has not been determined.  Modes ajax/refresh and ajax/update can be used when an add action or remove action needs to immediately update the database.  These modes are useful when dealing
with objects that have already been created.""",
                              default = json.dumps(['action_checkbox']),
                              available_options = json.dumps(''),
                              required = True,
                            )

configs.register(RELATEDCONTENT_PREFIX)
configs.register(RELATEDCONTENT_TARGET_PREFIX)
configs.register(RELATEDCONTENT_DATA_PREFIX)
configs.register(RELATEDCONTENT_INIT_PREFIX)
configs.register(RELATEDCONTENT_FIELD_CLASS)

configs.register(DEFAULT_CHANGE_LIST_TEMPLATE)
configs.register(VOID_ADMIN_FIELD_NAMES)
configs.register(UPDATE_MODES)

ContentUsageFixture = ConfigFixture(help_text = 'Configure the modes of content usage that determine the type of associations between related objects.',
                                    app_label = _CURRENT_APP,
                                    module_name = 'contentusage')

AvailableContentUsageFixture = ConfigFixture(help_text = 'Configure the possible relationships available between content',
                                             app_label = _CURRENT_APP,
                                             module_name = 'availablecontentusage')


fixtures.register(ContentUsageFixture)
fixtures.register(AvailableContentUsageFixture)
Ejemplo n.º 4
0
                                   required = True,
                                   )

MODERATE_FLAG = ConfigOption(app = _CURRENT_APP,
                             name = 'MODERATE_FLAG',
                             help_text = """Predefined ContentFlag which flags an object for moderation""",
                             default = json.dumps('IN_MODERATION'),
                             available_options = json.dumps(''),
                             required = True
                             )

ContentFlagFixture = ConfigFixture(help_text = 'Configure content flags that can be set on objects.',
                                   app_label = _CURRENT_APP,
                                   module_name = 'contentflag')

ReasonFixture = ConfigFixture(help_text = 'Configure the reasons that users can provide when flagging content',
                              app_label = _CURRENT_APP,
                              module_name = 'reason')

ModeratedContentFixture = ConfigFixture(help_text = 'Configure which content will undergo a moderation process before shown on the site.',
                                        app_label = _CURRENT_APP,
                                        module_name = 'moderatedcontent')

fixtures.register(ContentFlagFixture)
fixtures.register(ReasonFixture)
fixtures.register(ModeratedContentFixture)

configs.register(ANONYMOUS_APPROVAL_ENABLED)
configs.register(DEFAULT_FLAG_VOTE_WEIGHT)
configs.register(FLAG_VOTE_THRESHOLD)
configs.register(DEFAULT_REASONS)
Ejemplo n.º 5
0
"""
Configurations definitions for this module to the specs od django-config-wizard.
"""

try:
    import json
except:
    import simplejson as json

from django_wizard.wizard import config_index as configs
from django_wizard.wizard import fixtures_index as fixtures
from django_wizard.models import ConfigOption, ConfigFixture

BadgeFixture = ConfigFixture(help_text = 'Configure the Badges that are available to the users of this site.',
                             app_label = 'django_badges',
                             module_name = 'badge')

fixtures.register(BadgeFixture)
Ejemplo n.º 6
0
try:
    import json
except:
    import simplejson as json

from django_wizard.wizard import config_index as configs
from django_wizard.wizard import fixtures_index as fixtures
from django_wizard.models import ConfigOption, ConfigFixture

TrackedContentFixture = ConfigFixture(help_text = 'Configure the models that will have their histories tracked by django_contenthistory.',
                                      app_label = 'django_contenthistory',
                                      module_name = 'trackedcontent')

ModelFieldFixture = ConfigFixture(help_text = 'Configure the fields for each TrackedContent object that will be tracked',
                                  app_label = 'django_contenthistory',
                                  module_name = 'modelfield')

fixtures.register(TrackedContentFixture)
fixtures.register(ModelFieldFixture)