Ejemplo n.º 1
0
class Campaign(models.Model):
    account = models.ForeignKey('accounts.Account',
                                related_name='campaign',
                                blank=True,
                                null=True)
    multimedia = models.ManyToManyField('multimedia.Multimedia')
    backers = models.CommaSeparatedIntegerField(max_length=10000,
                                                blank=True,
                                                null=True)

    active = models.BooleanField()
    completed = models.BooleanField()
    consummated = models.BooleanField()

    currently_featured = models.BooleanField()
    feature_score = models.IntegerField(null=True, blank=True)

    title = models.CharField(max_length=50)
    caption = models.CharField(max_length=100, null=True, blank=True)
    headline = models.CharField(max_length=50)
    description = models.TextField()

    endline = models.CharField(max_length=50, default="Summary")
    summary = models.TextField(null=True, blank=True)
    call_to_action = models.CharField(max_length=50, null=True, blank=True)

    minimum_pledge = models.IntegerField(default=1)
    number_backers = models.IntegerField(default=0)

    goal = models.IntegerField()
    amount_pledged = models.IntegerField(default=0)

    city = models.CharField(max_length=34)
    state = models.CharField(max_length=34, null=True, blank=True)
    country = models.CharField(max_length=50)

    created_on = models.DateTimeField(auto_now_add=True)
    start_date = models.DateTimeField(default=datetime.now)
    end_date = models.DateTimeField()
    completion_date = models.DateTimeField(null=True, blank=True)
    tags = TaggableManager()

    def __unicode__(self):
        return unicode("%s: %s" % (self.account, self.title))
Ejemplo n.º 2
0
class Person(models.Model):
    """
        test model
    """
    role = models.ForeignKey(Role, null=True)
    big_age = models.BigIntegerField()
    comma_separated_age = models.CommaSeparatedIntegerField(max_length=255)
    age = models.IntegerField()
    positive_age = models.PositiveIntegerField()
    positive_small_age = models.PositiveSmallIntegerField()
    small_age = models.SmallIntegerField()
    height = models.DecimalField(max_digits=3, decimal_places=2)
    float_height = models.FloatField()

    certified = models.BooleanField(default=False)
    null_certified = models.NullBooleanField()

    name = models.CharField(max_length=140, blank=True, null=True)
    email = models.EmailField()
    file_path = models.FilePathField()
    slug = models.SlugField()
    text = models.TextField()
    url = models.URLField()

    date_time = models.DateTimeField(null=True, blank=True)
    date = models.DateField(null=True, blank=True)
    time = models.TimeField(null=True, blank=True)

    remote_addr = models.GenericIPAddressField(null=True, blank=True)

    my_file = models.FileField(upload_to='/some/path/', null=True, blank=True)
    image = models.ImageField(upload_to='/some/path/', null=True, blank=True)

    data = JSONField(null=True, blank=True)

    default = models.IntegerField(null=True,
                                  blank=True,
                                  help_text="A reserved keyword")

    jobs = models.ManyToManyField('Company',
                                  blank=True,
                                  related_name='workers')

    objects = BulkUpdateManager()
class Migration(migrations.Migration):

    dependencies = [
        ('lgbdb', '0004_auto_20160126_2333'),
    ]

    operations = [
        migrations.AlterField(
            model_name='benchmark',
            name='additional_notes',
            field=models.CharField(blank=True, max_length=1000),
        ),
        migrations.AlterField(
            model_name='benchmark',
            name='fps_data',
            field=models.CommaSeparatedIntegerField(default='',
                                                    max_length=1500),
        ),
    ]
Ejemplo n.º 4
0
class Rabbit(models.Model):
    title = models.CharField(max_length=16)
    username = models.CharField(max_length=16, unique=True)
    active = models.BooleanField(default=True)
    email = models.EmailField()
    text = models.TextField(max_length=512)

    created_at = models.DateField()
    updated_at = models.DateTimeField()

    opened_at = models.TimeField()
    percent = models.FloatField()
    money = models.IntegerField()
    ip = models.IPAddressField()
    ip6 = models.GenericIPAddressField(protocol='ipv6')
    picture = models.FileField(upload_to=settings.TMPDIR)

    some_field = models.CommaSeparatedIntegerField(max_length=12)
    funny = models.NullBooleanField(null=False, blank=False)
    slug = models.SlugField()
    speed = models.DecimalField(max_digits=3, decimal_places=1)

    url = models.URLField(null=True, blank=True, default='')

    file_path = models.FilePathField()
    content_type = models.ForeignKey(ct_models.ContentType)
    object_id = models.PositiveIntegerField()
    error_code = models.PositiveSmallIntegerField()
    custom = CustomField(max_length=24)
    content_object = GenericForeignKey('content_type', 'object_id')

    binary = models.BinaryField()

    one2one = models.OneToOneField('django_app.Simple')

    def save(self, **kwargs):
        """ Custom save. """

        if not self.created_at:
            import datetime
            self.created_at = datetime.datetime.now()

        return super(Rabbit, self).save(**kwargs)
Ejemplo n.º 5
0
class Migration(migrations.Migration):

    dependencies = [
        ('mainsite', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('member', models.CommaSeparatedIntegerField(max_length=20)),
            ],
        ),
    ]
Ejemplo n.º 6
0
class Contest(models.Model):
    contest_name = models.CharField(primary_key=True,
                                    max_length=200,
                                    default="",
                                    editable=True,
                                    unique=True)
    college_name = models.CharField(max_length=200, default="", editable=True)
    no_of_candidates = models.IntegerField(default=0)
    start_date = models.DateTimeField(default=datetime.now(timezone.utc),
                                      blank=False)
    end_date = models.DateTimeField(default=datetime.now(timezone.utc),
                                    blank=False)
    time = models.DurationField(default=timedelta())
    questions = models.CommaSeparatedIntegerField(max_length=200,
                                                  default=0,
                                                  editable=True)

    def __str__(self):
        return self.contest_name
Ejemplo n.º 7
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Int_List',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('values', models.CommaSeparatedIntegerField(max_length=200)),
            ],
        ),
    ]
Ejemplo n.º 8
0
class AllFieldsModel(models.Model):
    big_integer = models.BigIntegerField()
    binary = models.BinaryField()
    boolean = models.BooleanField(default=False)
    char = models.CharField(max_length=10)
    csv = models.CommaSeparatedIntegerField(max_length=10)
    date = models.DateField()
    datetime = models.DateTimeField()
    decimal = models.DecimalField(decimal_places=2, max_digits=2)
    duration = models.DurationField()
    email = models.EmailField()
    file_path = models.FilePathField()
    floatf = models.FloatField()
    integer = models.IntegerField()
    ip_address = models.IPAddressField()
    generic_ip = models.GenericIPAddressField()
    null_boolean = models.NullBooleanField()
    positive_integer = models.PositiveIntegerField()
    positive_small_integer = models.PositiveSmallIntegerField()
    slug = models.SlugField()
    small_integer = models.SmallIntegerField()
    text = models.TextField()
    time = models.TimeField()
    url = models.URLField()
    uuid = models.UUIDField()

    fo = ForeignObject(
        'self',
        from_fields=['abstract_non_concrete_id'],
        to_fields=['id'],
        related_name='reverse'
    )
    fk = ForeignKey(
        'self',
        related_name='reverse2'
    )
    m2m = ManyToManyField('self')
    oto = OneToOneField('self')

    object_id = models.PositiveIntegerField()
    content_type = models.ForeignKey(ContentType)
    gfk = GenericForeignKey()
    gr = GenericRelation(DataModel)
Ejemplo n.º 9
0
class UserInfo(models.Model):
    uname = models.CharField(max_length=20)  # 用户姓名
    upwd = models.CharField(max_length=40)  # 用户密码
    # ugender = models.BooleanField()

    umail = models.CharField(max_length=30)  # 用户邮箱
    goodsids = models.CommaSeparatedIntegerField(default='', max_length=40)  # 用户最经浏览商品id
    default_id = models.IntegerField(default=0)  # 收货地址id
    isDelete = models.BooleanField(default=0)  # 逻辑删除
    user = models.Manager()
    muser = UserInfoManager()

    # 指定编码格式,防止中文乱码
    def __str__(self):
        return self.uname.encode('utf-8')

    # 修改表名
    class Meta():
        db_table = 'userinfo'
Ejemplo n.º 10
0
class Problem(models.Model):
    contest = models.ForeignKey(Contest)
    problemSetter = models.CharField(max_length=200)
    problemTitle = models.CharField(max_length=200)
    problemStatement = RichTextField(config_name='awesome_ckeditor')
    testInput = models.FileField(upload_to='testInput')
    testOutput = models.FileField(upload_to='testOutput')
    marks = models.PositiveSmallIntegerField()
    timeLimit = models.PositiveSmallIntegerField()
    languagesAllowed = models.CommaSeparatedIntegerField(max_length=200)
    inputFormat = RichTextField(config_name='awesome_ckeditor')
    outputFormat = RichTextField(config_name='awesome_ckeditor')
    constraints = RichTextField(config_name='awesome_ckeditor')
    sampleInput = RichTextField(config_name='awesome_ckeditor')
    sampleOutput = RichTextField(config_name='awesome_ckeditor')
    solvedBy = models.PositiveSmallIntegerField(default=0)
    
    def __unicode__(self):
        return self.problemTitle
Ejemplo n.º 11
0
class Migration(migrations.Migration):

    dependencies = [
        ('contest', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Fight',
            fields=[
                ('id',
                 models.AutoField(serialize=False,
                                  primary_key=True,
                                  verbose_name='ID',
                                  auto_created=True)),
                ('x', models.ForeignKey(to_field='id', to='contest.Entry')),
                ('o', models.ForeignKey(to_field='id', to='contest.Entry')),
                ('gameplay',
                 models.CommaSeparatedIntegerField(
                     max_length=230,
                     help_text=
                     "Gameplay flow. Board is separated to 81 cells. Each number means a move by alternating player. For example, '10,1,0' means: x placed (2,1,1,1), o placed (1,1,1,1) and x made an error. In case 0 is at the end (like in the example), 'error' field is non-empty."
                 )),
                ('error',
                 models.CharField(
                     max_length=255,
                     help_text="Non-empty if `gameplay' ends with zero",
                     blank=True)),
                ('result',
                 models.CharField(
                     max_length=10,
                     help_text=
                     'Fight result of x (e1) versus o (e2). Relative to e1.',
                     choices=[('win', 'win'), ('draw', 'draw'),
                              ('loss', 'loss')])),
            ],
            options={
                'unique_together': set([('x', 'o')]),
                'index_together': set([('x', 'result'), ('o', 'result')]),
            },
            bases=(models.Model, ),
        ),
    ]
Ejemplo n.º 12
0
class Migration(migrations.Migration):

    dependencies = [
        ("base", "0006_auto_20150602_0616"),
    ]

    operations = [
        migrations.AddField(
            model_name="locale",
            name="cldr_plurals",
            field=models.CommaSeparatedIntegerField(
                blank=True,
                max_length=11,
                verbose_name=b"CLDR Plurals",
                validators=[pontoon.base.models.validate_cldr],
            ),
        ),
        migrations.AlterField(
            model_name="resource",
            name="format",
            field=models.CharField(
                blank=True,
                max_length=20,
                verbose_name=b"Format",
                choices=[
                    (b"po", b"po"),
                    (b"xliff", b"xliff"),
                    (b"properties", b"properties"),
                    (b"dtd", b"dtd"),
                    (b"inc", b"inc"),
                    (b"ini", b"ini"),
                    (b"lang", b"lang"),
                    (b"l20n", b"l20n"),
                ],
            ),
        ),
        migrations.AlterField(
            model_name="translation",
            name="date",
            field=models.DateTimeField(auto_now_add=True),
        ),
    ]
Ejemplo n.º 13
0
class VariantModel(models.Model):
    """
    This model should contain all variants of all existing types,
    without the related fields.

    TODO: Add tests for all variants!
    """
    boolean = models.BooleanField(default=True)
    null_boolean = models.NullBooleanField()

    char = models.CharField(max_length=1, blank=True, null=True)
    text = models.TextField(blank=True, null=True)
    # skip: models.SlugField()

    integer = models.IntegerField(blank=True, null=True)
    integers = models.CommaSeparatedIntegerField(max_length=64, blank=True, null=True)
    positive_integer = models.PositiveIntegerField(blank=True, null=True)
    big_integer = models.BigIntegerField(blank=True, null=True)
    # skip:
    # models.PositiveSmallIntegerField()
    # models.SmallIntegerField()

    time = models.TimeField(blank=True, null=True)
    date = models.DateField(blank=True, null=True)
    datetime = models.DateTimeField(blank=True, null=True)

    decimal = models.DecimalField(max_digits=5, decimal_places=3, blank=True, null=True)
    float = models.FloatField(blank=True, null=True)

    email = models.EmailField(blank=True, null=True)
    url = models.URLField(blank=True, null=True)

    filepath = models.FilePathField(
        path=settings.UNITTEST_TEMP_PATH,
        blank=True, null=True
    )

    ip_address = models.IPAddressField(blank=True, null=True)
    # skip: models.GenericIPAddressField()

    def __str__(self):
        return "VariantModel instance pk: %i" % self.pk
Ejemplo n.º 14
0
class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('name', models.CharField(max_length=200)),
                ('birthday', models.CommaSeparatedIntegerField(max_length=3)),
                ('date_updated', models.DateField(auto_now=True)),
                ('date_created', models.DateField(auto_now_add=True)),
            ],
            options={
            },
            bases=(models.Model,),
        ),
    ]
Ejemplo n.º 15
0
class Migration(migrations.Migration):

    dependencies = [
        ('keystr', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='stroke',
            name='email',
            field=models.EmailField(default='*****@*****.**',
                                    max_length=254),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='stroke',
            name='timecsv',
            field=models.CommaSeparatedIntegerField(max_length=500),
        ),
    ]
Ejemplo n.º 16
0
class DockerContainer(models.Model):
    tag = models.CharField(verbose_name=_('tag'), max_length=50, unique=True)
    description = models.TextField(verbose_name=_('description'), blank=True)
    dockerfile_src = models.FileField(verbose_name=_('dockerfile source'),
                                      upload_to='docker/dockerfiles',
                                      storage=syncing_storage,
                                      null=True,
                                      blank=True)
    version = models.PositiveSmallIntegerField(verbose_name=_('version'),
                                               default=1)
    cores = models.CommaSeparatedIntegerField(verbose_name=_('cores'),
                                              default=1024,
                                              max_length=512)
    memory = models.PositiveIntegerField(verbose_name=_('memory'),
                                         default=100 * 1024 * 1024)
    swap = models.PositiveIntegerField(verbose_name=_('swap'), default=0)
    build_log = models.TextField(verbose_name=_('build log'), blank=True)

    def __unicode__(self):
        return '%s:%d' % (self.tag, self.version)
Ejemplo n.º 17
0
class Migration(migrations.Migration):

    dependencies = [
        ('rhyme', '0003_auto_20150121_2204'),
    ]

    operations = [
        migrations.AddField(
            model_name='word',
            name='synonyms',
            field=models.ManyToManyField(related_name='synonym', to='rhyme.Word'),
            preserve_default=True,
        ),
        migrations.AlterField(
            model_name='word',
            name='pos',
            field=models.CommaSeparatedIntegerField(default=b'', max_length=255, choices=[(0, b'Noun'), (1, b'Verb'), (2, b'Adjective'), (3, b'Adverb'), (4, b'Preposition')]),
            preserve_default=True,
        ),
    ]
Ejemplo n.º 18
0
class Migration(migrations.Migration):

    dependencies = [
        ('game', '0011_auto_20160217_0012'),
    ]

    operations = [
        migrations.AlterField(
            model_name='dockercontainer',
            name='cores',
            field=models.CommaSeparatedIntegerField(default=1024,
                                                    max_length=512,
                                                    verbose_name='cores'),
        ),
        migrations.AlterField(
            model_name='dockercontainer',
            name='description',
            field=models.TextField(verbose_name='description', blank=True),
        ),
    ]
Ejemplo n.º 19
0
class Roll(models.Model):
    game = models.OneToOneField('Game')
    dice = models.CommaSeparatedIntegerField(max_length=100)
    guid = models.CharField(max_length=32)

    def __init__(self, *args, **kwargs):
        super(Roll, self).__init__(*args, **kwargs)

        if not self.guid:
            self.guid = uuid.uuid1().hex

    def __unicode__(self):
        return "%s" % self.dice

    def roll(self, num_dice):
        self.dice = [random.randint(1, 6) for n in range(num_dice)]
        self.save()

    def get_json(self):
        return json.dumps({'dice': self.dice, 'guid': self.guid})
Ejemplo n.º 20
0
class Tweet(models.Model):
	def within(self):
		return self.tid >= timezone.now() - datetime.timedelta(weeks=w)
	tid = models.CharField(max_length=20)
	time = models.DateTimeField()
	text = models.CharField(max_length=150)
	geo = models.CharField(max_length=150)
	coordinates = models.CommaSeparatedIntegerField(max_length=100)
	place = models.CharField(max_length=100)
	user_tz = models.CharField(max_length=100)
	lang = models.CharField(max_length=10)
	within1mo = models.BooleanField()
	within2wk = models.BooleanField()
	within1wk = models.BooleanField()

	def __str__(self):
		return "{time: "+self.tid+ \
				",\ntext: "+self.text+ \
				",\ngeo: "+self.geo+ \
				",\ntimezone: "+self.user_tz+"}"
Ejemplo n.º 21
0
class Migration(migrations.Migration):

    dependencies = [
        ('shop', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='item',
            name='price',
            field=models.CommaSeparatedIntegerField(default=10000,
                                                    max_length=10),
        ),
        migrations.AlterField(
            model_name='itemphoto',
            name='item',
            field=models.ForeignKey(related_name='photos_of_item',
                                    to='shop.Item'),
        ),
    ]
Ejemplo n.º 22
0
class Image(models.Model):
    pass
    #date/time - the date/time this image was created
    created_datetime = models.DateTimeField(auto_now_add=True)

    #genome - the geome that the image is generated from.
    genome = models.CommaSeparatedIntegerField(
        max_length=generator.GENETIC_CODE_LENGTH)

    #generation - the generation number that the image is from
    generation = models.IntegerField(default=0)

    #popularity - how popular the image is. 0 is default, lower is better
    popularity = models.IntegerField(default=0)

    #parents - many to many with image.
    parents = models.ManyToManyField("Image", blank=True)

    def __unicode__(self):
        return 'Image ' + str(self.id)
Ejemplo n.º 23
0
class OtherFieldsModel(models.Model):
    """
    This class is supposed to include other newly added fields types, so that
    adding new supported field doesn't end in adding new test model.
    """
    # That's rich! PositiveIntegerField is only validated in forms, not in models.
    int = models.PositiveIntegerField(
        default=42, validators=[validators.MinValueValidator(0)])
    boolean = models.BooleanField()
    nullboolean = models.NullBooleanField()
    csi = models.CommaSeparatedIntegerField(max_length=255)
    float = models.FloatField(blank=True, null=True)
    decimal = models.DecimalField(max_digits=5,
                                  decimal_places=2,
                                  blank=True,
                                  null=True)
    ip = models.IPAddressField(blank=True, null=True)
    date = models.DateField(blank=True, null=True)
    datetime = models.DateTimeField(blank=True, null=True)
    time = models.TimeField(blank=True, null=True)
Ejemplo n.º 24
0
class AllFields(models.Model):
    boolean = models.BooleanField(default=False)
    char = models.CharField(max_length=50)

    if DJANGO_VERSION < (1, 11):
        comma_separated = models.CommaSeparatedIntegerField(max_length=50)
    else:
        comma_separated = models.CharField(
            max_length=50, validators=[validate_comma_separated_integer_list])

    date = models.DateField()
    datetime = models.DateTimeField()
    decimal = models.DecimalField(decimal_places=2, max_digits=4)
    email = models.EmailField()
    file_path = models.FilePathField(path='tests/demo/', match='.*\.html')
    float_field = models.FloatField()
    integer = models.IntegerField()
    big_integer = models.BigIntegerField()

    if DJANGO_VERSION < (1, 9):
        ip_address = models.IPAddressField()

    generic_ip_address = models.GenericIPAddressField()
    null_boolean = models.NullBooleanField()
    positive_integer = models.PositiveIntegerField()
    positive_small_integer = models.PositiveSmallIntegerField()
    slug = models.SlugField()
    small_integer = models.SmallIntegerField()
    text = models.TextField()
    time = models.TimeField()
    url = models.URLField()
    file_field = models.FileField(upload_to="test/")
    image = models.ImageField(upload_to="test/")
    fk = models.ForeignKey(Registration,
                           related_name='all_fk',
                           on_delete=models.CASCADE)
    m2m = models.ManyToManyField(Registration, related_name='all_m2m')
    one = models.OneToOneField(Registration,
                               related_name='all_one',
                               on_delete=models.CASCADE)
    choices = models.CharField(max_length=50, choices=(('a', 'a'), ))
Ejemplo n.º 25
0
class Wechat(models.Model):
    """
    公众号
    """
    appid = models.CharField('公众号 ID', max_length=20, default='')
    alias = models.CharField('公众号名称', max_length=20, null=True, blank=True)
    service_type = models.IntegerField('公众号类型',
                                       choices=choices.WECHAT_TYPE_CHOICES,
                                       default=consts.WECHAT_TYPE_SUB)
    nick_name = models.CharField('昵称', max_length=32, null=True, blank=True)
    head_img = models.URLField('头像', max_length=256, null=True, blank=True)
    user_name = models.CharField('内部名称', max_length=32)
    qrcode_url = models.URLField('二维码URL',
                                 max_length=256,
                                 null=True,
                                 blank=True)
    authorized = models.BooleanField('授权')
    verify_type = models.PositiveIntegerField(
        '认证类型', choices=choices.VERIFY_TYPE_CHOICES)
    funcscope_categories = models.CommaSeparatedIntegerField('权限集',
                                                             max_length=64)
    join_time = models.DateTimeField('授权时间', auto_now_add=True)

    class Meta:
        get_latest_by = 'join_time'
        verbose_name = '公众号'
        verbose_name_plural = '公众号'

    def __unicode__(self):
        return '公众号 {0}'.format(self.alias)

    def __str__(self):
        return self.__unicode__().encode('utf-8')

    def is_valid(self):
        return self.authorized

    @property
    def client(self):
        component = get_component()
        return component.get_client_by_appid(self.appid)
Ejemplo n.º 26
0
class Migration(migrations.Migration):

    dependencies = [
        ('app3', '0005_currency_dust'),
    ]

    operations = [
        migrations.AlterField(
            model_name='currency',
            name='api_url',
            field=models.CharField(blank=True,
                                   default='http://localhost:8332',
                                   max_length=100,
                                   null=True,
                                   verbose_name='API hostname'),
        ),
        migrations.AlterField(
            model_name='currency',
            name='label',
            field=models.CharField(default='Bitcoin',
                                   max_length=20,
                                   unique=True,
                                   verbose_name='Label'),
        ),
        migrations.AlterField(
            model_name='currency',
            name='magicbyte',
            field=models.CommaSeparatedIntegerField(default='0,5',
                                                    max_length=10,
                                                    verbose_name='Magicbytes'),
        ),
        migrations.AlterField(
            model_name='currency',
            name='ticker',
            field=models.CharField(default='BTC',
                                   max_length=4,
                                   primary_key=True,
                                   serialize=False,
                                   verbose_name='Ticker'),
        ),
    ]
Ejemplo n.º 27
0
class Migration(migrations.Migration):

    dependencies = [
        ('authors', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('books', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='TestModel',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('big_integer', models.BigIntegerField()),
                ('binary', models.BinaryField()),
                ('boolean', models.BooleanField(default=False)),
                ('char', models.CharField(max_length=255)),
                ('comma_separated_integer', models.CommaSeparatedIntegerField(max_length=255)),
                ('date', models.DateField()),
                ('date_time', models.DateTimeField()),
                ('decimal', models.DecimalField(max_digits=10, decimal_places=2)),
                ('email', models.EmailField(max_length=254)),
                ('file_path', models.FilePathField(path=b'/cygdrive/c/Users/barszcz/projekty/moje/django/django-wpadmin/test_project/../docs', recursive=True)),
                ('float', models.FloatField()),
                ('integer', models.IntegerField()),
                ('ip_address', models.IPAddressField()),
                ('generic_ip_address', models.GenericIPAddressField()),
                ('null_boolean', models.NullBooleanField()),
                ('positive_integer', models.PositiveIntegerField()),
                ('positive_small_integer', models.PositiveSmallIntegerField()),
                ('slug', models.SlugField()),
                ('small_integer', models.SmallIntegerField()),
                ('text', models.TextField()),
                ('time', models.TimeField()),
                ('url', models.URLField()),
                ('foreign_key', models.ForeignKey(to='books.Book')),
                ('many_to_many', models.ManyToManyField(to='authors.Author')),
                ('one_to_one', models.OneToOneField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Ejemplo n.º 28
0
class FieldsWithoutOptionsModel(models.Model):
    datetime = models.DateTimeField()
    date = models.DateField()
    time = models.TimeField()
    floating_point = models.FloatField()
    boolean = models.BooleanField()
    null_boolean = models.NullBooleanField()
    text = models.CharField(max_length=32)
    email = models.EmailField()
    comma_seperated_integer = models.CommaSeparatedIntegerField(max_length=10)
    ip_address = models.IPAddressField()
    slug = models.SlugField()
    url = models.URLField()
    #    file = models.FileField()
    #    file_path = models.FilePathField()
    long_text = models.TextField()
    indexed_text = models.TextField()
    integer = models.IntegerField()
    small_integer = models.SmallIntegerField()
    positive_integer = models.PositiveIntegerField()
    positive_small_integer = models.PositiveSmallIntegerField()
Ejemplo n.º 29
0
class Migration(migrations.Migration):

    dependencies = [
        ('feedback', '0005_auto_20160506_2038'),
    ]

    operations = [
        migrations.AddField(
            model_name='comment',
            name='path_as_list',
            field=models.CommaSeparatedIntegerField(default=0,
                                                    editable=False,
                                                    max_length=250),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='notification',
            name='expiration_date',
            field=models.DateField(default=datetime.date(2016, 6, 9)),
        ),
    ]
Ejemplo n.º 30
0
class Participant(models.Model):

    user = models.ForeignKey(to='auth.User',
                             blank=True,
                             null=True,
                             verbose_name=_(u"user"))

    timestamp = models.DateTimeField(auto_now_add=True,
                                     verbose_name=_(u"timestamp"))

    ip = models.IPAddressField(verbose_name=_(u"ip"))

    queue = models.CommaSeparatedIntegerField(max_length=512,
                                              verbose_name=_(u"queue"))

    class Meta:
        verbose_name = _(u"participant")
        verbose_name_plural = _(u"participants")

    def __unicode__(self):
        return ""