예제 #1
0
class BaseFieldEntry(FieldEntry):
    verbose_name = schema.CharField(blank=True, null=True)
    blank = schema.BooleanField(default=True)
    null = schema.BooleanField(default=True)

    default = schema.CharField(blank=True, null=True)
    help_text = schema.CharField(blank=True, null=True)

    scaffold_template_name = 'dockitcms/scaffold/field.html'

    class Meta:
        proxy = True
예제 #2
0
class ThumbnailFieldEntrySchema(schema.Schema):
    key = schema.SlugField()
    format = schema.CharField(blank=True, null=True, choices=IMAGE_FORMATS)
    quality = schema.IntegerField(blank=True, null=True)
    width = schema.IntegerField(blank=True, null=True)
    height = schema.IntegerField(blank=True, null=True)
    upscale = schema.BooleanField(
        default=False,
        help_text='Upsize the image if it doesn\'t match the width and height')
    crop = schema.CharField(blank=True, null=True, choices=CROP_CHOICES)
    autocrop = schema.BooleanField(
        default=False, help_text='Remove white space from around the image')

    def __unicode__(self):
        return self.key or repr(self)
예제 #3
0
class BaseField(schema.Schema):
    name = schema.SlugField()
    required = schema.BooleanField(default=True)
    label = schema.CharField(blank=True)
    initial = schema.CharField(blank=True)
    help_text = schema.CharField(blank=True)

    class Meta:
        typed_field = 'field_type'
예제 #4
0
class BasePage(schema.Schema):
    parent = schema.ReferenceField('self', blank=True, null=True)
    url = schema.CharField(blank=True)
    url_name = schema.SlugField(blank=True, help_text='registers the page with the url tag with this name')
    path = schema.CharField(editable=False)
    title = schema.CharField()
    slug = schema.SlugField()
    published = schema.BooleanField()
    template = schema.CharField()

    inline_css = schema.TextField(blank=True)
    inline_js = schema.TextField(blank=True)

    def clean_path(self):
        if self.url:
            return self.url
        if self.parent:
            return self.parent.path + self.slug + '/'
        return self.slug + '/'
예제 #5
0
class CanonicalMixin(schema.Schema):
    canonical = schema.BooleanField(help_text=_(
        'If checked, this view point defines the canonical urls for these collections'
    ))
예제 #6
0
class AuthConfiguration(schema.Schema):
    authenticated_users_only = schema.BooleanField(default=False)
    staff_only = schema.BooleanField(default=False)
    required_permissions = schema.ListField(
        schema.CharField(),
        blank=True)  #object or app permissions required for the user