Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(0)  |  Derive(0)  |  Import(1)

src/k/n/knpay-0.1.0/knpay/forms_builder/forms/models.py   knpay(Download)
    slug = models.SlugField(_('Slug'), max_length=100, blank=True,
            default="")
    field_type = models.IntegerField(_("Type"), choices=fields.NAMES)
    required = models.BooleanField(_("Required"), default=True)
    visible = models.BooleanField(_("Visible"), default=True)

src/k/n/knpay-0.1.0/knpay/forms_builder/forms/tests.py   knpay(Download)
from knpay.forms_builder.forms.models import (Form, Field,
                                        STATUS_DRAFT, STATUS_PUBLISHED)
from knpay.forms_builder.forms.fields import NAMES, FILE
from knpay.forms_builder.forms.settings import USE_SITES
from knpay.forms_builder.forms.signals import form_invalid, form_valid
                form.sites.add(self._site)
                form.save()
            for (field, _) in NAMES:
                form.fields.create(label=field, field_type=field,
                                   required=required, visible=True)
            form.sites.add(self._site)
            form.save()
        form.fields.create(label="field", field_type=NAMES[0][0],
                           required=True, visible=True)
        self.client.post(form.get_absolute_url(), data={})
    def test_field_validate_slug_names(self):
        form = Form.objects.create(title="Test")
        field = Field(form=form,
                label="First name", field_type=NAMES[0][0])
        field.save()
        self.assertEqual(field.slug, 'first_name')
 
        field_2 = Field(form=form,
                label="First name", field_type=NAMES[0][0])