示例#1
0
                           )

OPENID_PAPE = ConfigOption(app = _CURRENT_APP,
                                   name = 'OPENID_PAPE',
                                   help_text = """If True, enables usage of the Pape extension.""",
                                   default = json.dumps(False),
                                   available_options = json.dumps([True, False]),
                                   required = True,
                                   )

OPENID_SREG = ConfigOption(app = _CURRENT_APP,
                                   name = 'OPENID_SREG',
                                   help_text = """If True, enables usage of the Simple Registration extension.""",
                                   default = json.dumps(False),
                                   available_options = json.dumps([True, False]),
                                   required = True,
                                   )

OPENID_AX = ConfigOption(app = _CURRENT_APP,
                                   name = 'OPENID_AX',
                                   help_text = """If True, enables usage of the AX extension.""",
                                   default = json.dumps(True),
                                   available_options = json.dumps([True, False]),
                                   required = True,
                                   )

configs.register(BASE_URI)
configs.register(URI_GROUPS)
configs.register(OPENID_PAPE)
configs.register(OPENID_SREG)
configs.register(OPENID_AX)
示例#2
0
                                   )

MARKDOWN_ENABLED = ConfigOption(app = 'django_qa',
                                name = 'MARKDOWN_ENABLED',
                                help_text = """If True, Markdown markup is enabled for question and answer submission, else Markdown markup is disabled for question and answer submission.""",
                                default = json.dumps(True),
                                available_options = json.dumps([True, False]),
                                required = True,
                                )

CODE_HIGHLIGHTING_ENABLED = ConfigOption(app = 'django_qa',
                                name = 'CODE_HIGHLIGHTING_ENABLED',
                                help_text = """If True, content between <code></code> tags will be highlighted as code, else no highlighting will be provided.""",
                                default = json.dumps(True),
                                available_options = json.dumps([True, False]),
                                required = True,
                                )

CODE_HIGHLIGHTING_LANGUAGE = ConfigOption(app = 'django_qa',
                                name = 'CODE_HIGHLIGHTING_LANGUAGE',
                                help_text = """Determined which language is the default for highlighting content between <code></code> tags.""",
                                default = json.dumps('Python'),
                                available_options = json.dumps(['Python', 'Javascript', 'Ruby', 'C', 'C++', 'Java']),
                                required = True,
                                )

configs.register(MULTIPLE_ANSWERS_PER_USER)
configs.register(ANSWER_OWN_QUESTION)
configs.register(MARKDOWN_ENABLED)
configs.register(CODE_HIGHLIGHTING_ENABLED)
configs.register(CODE_HIGHLIGHTING_LANGUAGE)
示例#3
0
                                   name = 'BASE_REPUTATION',
                                   help_text = """Amount of reputation that each new user starts with.""",
                                   default = json.dumps(5000),
                                   available_options = json.dumps(''),
                                   required = True,
                                   )

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,
示例#4
0
                                   )

ANONYMOUS_USERS_ENABLED = ConfigOption(app = _CURRENT_APP,
                                   name = 'ANONYMOUS_USERS_ENABLED',
                                   help_text = """If True, enables middleware which creates uniquely identified anonymous django.contrib.auth.models.User objects.  Useful for letting anonmyous users access to community tools which need to attach an User object via a ForeignKey.""",
                                   default = json.dumps(False),
                                   available_options = json.dumps([True, False]),
                                   required = True,
                                   )

PROFILE_TEMPLATE = ConfigOption(app = _CURRENT_APP,
                                   name = 'PROFILE_TEMPLATE',
                                   help_text = """Template that should be used to display user profiles.""",
                                   default = json.dumps('django_community/profile.html'),
                                   available_options = json.dumps(''),
                                   required = True,
                                   )

PROFILES_ENABLED = ConfigOption(app = _CURRENT_APP,
                                name = 'PROFILES_ENABLED',
                                help_text = """If True, enables a view for displaying user profile data.""",
                                default = json.dumps(True),
                                available_options = json.dumps([True, False]),
                                required = True,
                                )

configs.register(OPENID_FIELD_MAPPING)
configs.register(OPENID_ENABLED)
configs.register(ANONYMOUS_USERS_ENABLED)
configs.register(PROFILES_ENABLED)
configs.register(PROFILE_TEMPLATE)
示例#5
0
try:
    import json
except:
    import simplejson as json

from django_wizard.wizard import config_index as configs
from django_wizard.models import ConfigOption

_CURRENT_APP = 'django_community_wiki'

COMMUNITY_WIKI_VOTE_LIMIT = ConfigOption(app = _CURRENT_APP,
                                         name = 'COMMUNITY_WIKI_VOTE_LIMIT',
                                         help_text = """Number of up votes above which an object will be owned by the community_wiki user""",
                                         default = json.dumps(25),
                                         available_options = json.dumps(''),
                                         required = True,
                                      )

COMMUNITY_WIKI_POPULARITY_LIMIT = ConfigOption(app = _CURRENT_APP,
                                   name = 'COMMUNITY_WIKI_POPULARITY_LIMIT',
                                   help_text = """Lower threshold of popularity below which an object will be owned by the community_wiki.""",
                                   default = json.dumps(-7),
                                   available_options = json.dumps(''),
                                   required = True,
                                   )

configs.register(COMMUNITY_WIKI_VOTE_LIMIT)
configs.register(COMMUNITY_WIKI_POPULARITY_LIMIT)
示例#6
0
                                      available_options = json.dumps(''),
                                      required = True,
                                   )

UPDATE_MODES = ConfigOption(app = _CURRENT_APP,
                              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,
示例#7
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)
示例#8
0
try:
    import json
except:
    import simplejson as json

from django_wizard.wizard import config_index as configs
from django_wizard.models import ConfigOption

COMMENT_HIDE_THRESHOLD = ConfigOption(app = 'django_comments',
                                      name = 'COMMENT_HIDE_THRESHOLD',
                                      help_text = """Popularity threshold below which comments will be hidden.""",
                                      default = json.dumps(-1),
                                      available_options = json.dumps(''),
                                      required = True,
                                      )

MAX_COMMENTS_PER_DAY = ConfigOption(app = 'django_comments',
                                   name = 'MAX_COMMENTS_PER_DAY',
                                   help_text = """Max number of comments a user is allowed to post per day to avoid spamming.""",
                                   default = json.dumps(20),
                                   available_options =json.dumps(''),
                                   required = True,
                                   )

configs.register(COMMENT_HIDE_THRESHOLD)
configs.register(MAX_COMMENTS_PER_DAY)
示例#9
0
    name='ANONYMOUS_USERS_ENABLED',
    help_text=
    """If True, enables middleware which creates uniquely identified anonymous django.contrib.auth.models.User objects.  Useful for letting anonmyous users access to community tools which need to attach an User object via a ForeignKey.""",
    default=json.dumps(False),
    available_options=json.dumps([True, False]),
    required=True,
)

PROFILE_TEMPLATE = ConfigOption(
    app=_CURRENT_APP,
    name='PROFILE_TEMPLATE',
    help_text="""Template that should be used to display user profiles.""",
    default=json.dumps('django_community/profile.html'),
    available_options=json.dumps(''),
    required=True,
)

PROFILES_ENABLED = ConfigOption(
    app=_CURRENT_APP,
    name='PROFILES_ENABLED',
    help_text="""If True, enables a view for displaying user profile data.""",
    default=json.dumps(True),
    available_options=json.dumps([True, False]),
    required=True,
)

configs.register(OPENID_FIELD_MAPPING)
configs.register(OPENID_ENABLED)
configs.register(ANONYMOUS_USERS_ENABLED)
configs.register(PROFILES_ENABLED)
configs.register(PROFILE_TEMPLATE)
示例#10
0
from django_wizard.models import ConfigOption

_CURRENT_APP = 'django_multivoting'

ANONYMOUS_VOTING_ENABLED = ConfigOption(app = _CURRENT_APP,
                                        name = 'ANONYMOUS_VOTING_ENABLED',
                                        help_text = """If True, enables anonymous users cast votes on content.""",
                                        default = json.dumps(True),
                                        available_options = json.dumps([True, False]),
                                        required = True,
                                      )

MAX_VOTES_PER_OBJECT = ConfigOption(app = _CURRENT_APP,
                                   name = 'MAX_VOTES_PER_OBJECT',
                                   help_text = """Determines how many votes each user can cast on each object.""",
                                   default = json.dumps(1),
                                   available_options = json.dumps(''),
                                   required = True,
                                   )

CAN_OWNER_VOTE = ConfigOption(app = _CURRENT_APP,
                                   name = 'CAN_OWNER_VOTE',
                                   help_text = """If True, allows owner of content to vote on said content.""",
                                   default = json.dumps(False),
                                   available_options = json.dumps([True, False]),
                                   required = True,
                                   )

configs.register(ANONYMOUS_VOTING_ENABLED)
configs.register(MAX_VOTES_PER_OBJECT)
configs.register(CAN_OWNER_VOTE)