Пример #1
0
class Migration(migrations.Migration):

    dependencies = [
        ('auctions', '0008_auto_20200822_1342'),
    ]

    operations = [
        migrations.AddField(
            model_name='user',
            name='auction',
            field=models.ManyToManyField(to='auctions.Auction'),
        ),
        migrations.AlterField(
            model_name='auction',
            name='image',
            field=models.ImageField(blank=True,
                                    upload_to=auctions.models.get_upload_path),
        ),
        migrations.AlterField(
            model_name='image',
            name='image',
            field=models.ImageField(upload_to=auctions.models.get_upload_path),
        ),
    ]
Пример #2
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category',
                 models.CharField(choices=[('Electronics', 'Electronics'),
                                           ('Home', 'Home'),
                                           ('Books', 'Books'),
                                           ('Sports', 'Sports'),
                                           ('Automobile', 'Automobile'),
                                           ('Others', 'Others')],
                                  default='Others',
                                  max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Listing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=15)),
                ('description', models.TextField(max_length=250)),
                ('image_url', models.URLField(blank=True)),
                ('category',
                 models.ManyToManyField(blank=True,
                                        related_name='listings',
                                        to='auctions.Category')),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='birth_date',
            field=models.DateField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='user',
            name='location',
            field=models.CharField(blank=True, max_length=30),
        ),
        migrations.CreateModel(
            name='Watchlist',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('listings',
                 models.ManyToManyField(blank=True,
                                        related_name='watchlists',
                                        to='auctions.Listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='watchlists',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
                ('author',
                 models.ForeignKey(on_delete=models.SET(
                     auctions.models.get_sentinel_user),
                                   related_name='comments',
                                   to=settings.AUTH_USER_MODEL)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='auctions.listing')),
            ],
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('value', models.FloatField()),
                ('bidder',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bids',
                                   to=settings.AUTH_USER_MODEL)),
                ('listing',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bids',
                                   to='auctions.listing')),
            ],
        ),
    ]
Пример #3
0
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Listing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('description', models.TextField()),
                ('price',
                 models.DecimalField(decimal_places=2,
                                     max_digits=10,
                                     null=True)),
                ('slug', models.SlugField(max_length=150, unique=True)),
                ('status',
                 models.CharField(choices=[('ACTIVE', 'Active'),
                                           ('SOLD', 'Sold')],
                                  default='ACTIVE',
                                  max_length=6)),
                ('username',
                 models.ForeignKey(default=auctions.models.User,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='WatchList',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('active', models.BooleanField(default=False)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.listing')),
                ('username',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bidden', models.BooleanField(default=False)),
                ('bidprice',
                 models.DecimalField(decimal_places=2, max_digits=20)),
                ('listings', models.ManyToManyField(to='auctions.Listing')),
                ('username',
                 models.ForeignKey(null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #4
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Listing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title', models.CharField(max_length=64)),
                ('description', models.TextField()),
                ('category',
                 models.CharField(choices=[('H', 'Home'), ('F', 'Fashion'),
                                           ('T', 'Toys'), ('E', 'Electronics'),
                                           ('O', 'Other')],
                                  max_length=1)),
                ('active', models.BooleanField(default=True)),
                ('date', models.DateField(default=django.utils.timezone.now)),
                ('image', models.URLField(blank=True, default=None)),
                ('owner',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='my_listings',
                                   to=settings.AUTH_USER_MODEL)),
                ('watching',
                 models.ManyToManyField(related_name='listings',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('text', models.TextField()),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='auctions.Listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('bid',
                 models.DecimalField(decimal_places=2,
                                     max_digits=11,
                                     validators=[auctions.models.valid_bid])),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bids',
                                   to='auctions.Listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bids',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(db_index=True, max_length=64, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Listing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('created_at',
                 models.DateTimeField(default=datetime.datetime.now)),
                ('title', models.CharField(db_index=True, max_length=64)),
                ('description', models.TextField()),
                ('image_url', models.URLField()),
                ('starting_bid',
                 models.DecimalField(decimal_places=2, max_digits=9)),
                ('opens_at',
                 models.DateTimeField(default=datetime.datetime.now)),
                ('closes_at', models.DateTimeField()),
                ('category',
                 models.ForeignKey(
                     null=True,
                     on_delete=django.db.models.deletion.SET_NULL,
                     related_name='listings',
                     to='auctions.category')),
                ('creator',
                 models.ForeignKey(on_delete=models.SET(
                     auctions.models.get_sentinel_user),
                                   to=settings.AUTH_USER_MODEL)),
                ('users_watching',
                 models.ManyToManyField(blank=True,
                                        related_name='watchlist',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('content', models.TextField()),
                ('time', models.DateTimeField(default=datetime.datetime.now)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to='auctions.listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comments',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2,
                                               max_digits=9)),
                ('time', models.DateTimeField(default=datetime.datetime.now)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bids',
                                   to='auctions.listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bids',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Listing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('category', models.CharField(max_length=64)),
                ('title', models.CharField(max_length=100)),
                ('make', models.CharField(max_length=20)),
                ('model', models.CharField(max_length=20)),
                ('year',
                 models.IntegerField(choices=[(1900, 1900), (1901, 1901),
                                              (1902, 1902), (1903, 1903),
                                              (1904, 1904), (1905, 1905),
                                              (1906, 1906), (1907, 1907),
                                              (1908, 1908), (1909, 1909),
                                              (1910, 1910), (1911, 1911),
                                              (1912, 1912), (1913, 1913),
                                              (1914, 1914), (1915, 1915),
                                              (1916, 1916), (1917, 1917),
                                              (1918, 1918), (1919, 1919),
                                              (1920, 1920), (1921, 1921),
                                              (1922, 1922), (1923, 1923),
                                              (1924, 1924), (1925, 1925),
                                              (1926, 1926), (1927, 1927),
                                              (1928, 1928), (1929, 1929),
                                              (1930, 1930), (1931, 1931),
                                              (1932, 1932), (1933, 1933),
                                              (1934, 1934), (1935, 1935),
                                              (1936, 1936), (1937, 1937),
                                              (1938, 1938), (1939, 1939),
                                              (1940, 1940), (1941, 1941),
                                              (1942, 1942), (1943, 1943),
                                              (1944, 1944), (1945, 1945),
                                              (1946, 1946), (1947, 1947),
                                              (1948, 1948), (1949, 1949),
                                              (1950, 1950), (1951, 1951),
                                              (1952, 1952), (1953, 1953),
                                              (1954, 1954), (1955, 1955),
                                              (1956, 1956), (1957, 1957),
                                              (1958, 1958), (1959, 1959),
                                              (1960, 1960), (1961, 1961),
                                              (1962, 1962), (1963, 1963),
                                              (1964, 1964), (1965, 1965),
                                              (1966, 1966), (1967, 1967),
                                              (1968, 1968), (1969, 1969),
                                              (1970, 1970), (1971, 1971),
                                              (1972, 1972), (1973, 1973),
                                              (1974, 1974), (1975, 1975),
                                              (1976, 1976), (1977, 1977),
                                              (1978, 1978), (1979, 1979),
                                              (1980, 1980), (1981, 1981),
                                              (1982, 1982), (1983, 1983),
                                              (1984, 1984), (1985, 1985),
                                              (1986, 1986), (1987, 1987),
                                              (1988, 1988), (1989, 1989),
                                              (1990, 1990), (1991, 1991),
                                              (1992, 1992), (1993, 1993),
                                              (1994, 1994), (1995, 1995),
                                              (1996, 1996), (1997, 1997),
                                              (1998, 1998), (1999, 1999),
                                              (2000, 2000), (2001, 2001),
                                              (2002, 2002), (2003, 2003),
                                              (2004, 2004), (2005, 2005),
                                              (2006, 2006), (2007, 2007),
                                              (2008, 2008), (2009, 2009),
                                              (2010, 2010), (2011, 2011),
                                              (2012, 2012), (2013, 2013),
                                              (2014, 2014), (2015, 2015),
                                              (2016, 2016), (2017, 2017),
                                              (2018, 2018), (2019, 2019),
                                              (2020, 2020)],
                                     default=2020)),
                ('description', models.CharField(max_length=300)),
                ('image',
                 models.ImageField(blank=True,
                                   upload_to=auctions.models.rename)),
                ('startingBid',
                 models.DecimalField(decimal_places=0, max_digits=10)),
                ('startTime', models.DateTimeField(auto_now_add=True)),
                ('endTime',
                 models.DateTimeField(default=datetime.datetime(
                     2020, 12, 21, 14, 49, 6, 411353))),
                ('active', models.BooleanField(default=True)),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='user_listings',
                                   to=settings.AUTH_USER_MODEL)),
                ('watchListUser',
                 models.ManyToManyField(blank=True,
                                        related_name='watchlist',
                                        to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.CharField(max_length=100)),
                ('commentTime', models.DateTimeField(auto_now_add=True)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comment_listing',
                                   to='auctions.listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='comment_user',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('currentBid',
                 models.DecimalField(decimal_places=0, max_digits=10)),
                ('bidder',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bid_user',
                                   to=settings.AUTH_USER_MODEL)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='bid_listing',
                                   to='auctions.listing')),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Auction_Categories',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('caterogy', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='Auction_Listing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('item_name', models.CharField(max_length=64)),
                ('item_description', models.CharField(max_length=500)),
                ('starting_bid',
                 models.IntegerField(validators=[auctions.models.valid_bid])),
                ('isActive', models.BooleanField(default=True)),
                ('reference_image', models.ImageField(null=True,
                                                      upload_to='')),
                ('listing_time',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('item_category',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.auction_categories')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Watchlist',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.auction_listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comments',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.CharField(max_length=500)),
                ('comment_time',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.auction_listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Bids',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('user_bid', models.IntegerField()),
                ('isWinner', models.BooleanField(default=False)),
                ('item',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.auction_listing')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
Пример #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('avatar', models.URLField(blank=True)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='AuctionListing',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('item', models.CharField(max_length=64)),
                ('category',
                 models.CharField(choices=[
                     ('', '--Category--'),
                     ('BKS', 'Books'), ('BNI', 'Business & Industrial'),
                     ('CSE', 'Clothing, Shoes & Accessories'),
                     ('COL', 'Collectibles'), ('CEL', 'Consumer Electronics'),
                     ('CFT', 'Crafts'), ('HNG', 'Home & Garden'),
                     ('MTR', 'Motors'), ('PTS', 'Pet Supplies'),
                     ('SPT', 'Sporting Goods'),
                     ('SPM', 'Sports Mem, Cards & Fan Shop'),
                     ('TNH', 'Toys & Hobbies'), ('ATQ', 'Antiques'),
                     ('CNN', 'Computers/Tablets & Networking')
                 ],
                                  max_length=3)),
                ('starting_bid',
                 models.DecimalField(decimal_places=2, max_digits=13)),
                ('buyout_price',
                 models.DecimalField(decimal_places=2, max_digits=13)),
                ('details', models.TextField(max_length=400)),
                ('img', models.URLField(blank=True)),
                ('expiration',
                 models.DateTimeField(
                     default=auctions.models.return_exp_datetime)),
                ('is_active', models.BooleanField(default=True)),
                ('seller',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='WatchList',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.auctionlisting')),
                ('user',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='watchlist',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rating',
                 models.DecimalField(
                     decimal_places=1,
                     max_digits=2,
                     validators=[django.core.validators.MaxValueValidator(5)
                                 ])),
                ('evaluator',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='evaluator',
                                   to=settings.AUTH_USER_MODEL)),
                ('seller',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='seller',
                                   to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('comment', models.TextField(max_length=150)),
                ('votes', models.IntegerField()),
                ('timestamp', models.DateField(auto_now=True)),
                ('commentor',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.auctionlisting')),
            ],
        ),
        migrations.CreateModel(
            name='Bid',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2,
                                               max_digits=13)),
                ('is_active', models.BooleanField(default=True)),
                ('is_winner', models.BooleanField(default=False)),
                ('timestamp', models.DateTimeField(auto_now=True)),
                ('bidder',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to=settings.AUTH_USER_MODEL)),
                ('listing',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='auctions.auctionlisting')),
            ],
        ),
    ]