comparison downloads/migrations/0001_initial.py @ 1206:02181fa5ac9d modernize tip

Update to Django 1.9.
author Brian Neal <bgneal@gmail.com>
date Wed, 22 Jan 2025 17:58:16 -0600
parents 5ba2508939f7
children
comparison
equal deleted inserted replaced
1205:510ef3cbf3e6 1206:02181fa5ac9d
50 ('update_date', models.DateTimeField(db_index=True, blank=True)), 50 ('update_date', models.DateTimeField(db_index=True, blank=True)),
51 ('hits', models.IntegerField(default=0)), 51 ('hits', models.IntegerField(default=0)),
52 ('average_score', models.FloatField(default=0.0)), 52 ('average_score', models.FloatField(default=0.0)),
53 ('total_votes', models.IntegerField(default=0)), 53 ('total_votes', models.IntegerField(default=0)),
54 ('is_public', models.BooleanField(default=False, db_index=True)), 54 ('is_public', models.BooleanField(default=False, db_index=True)),
55 ('category', models.ForeignKey(to='downloads.Category')), 55 ('category', models.ForeignKey(to='downloads.Category',
56 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), 56 on_delete=models.CASCADE)),
57 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL,
58 on_delete=models.CASCADE)),
57 ], 59 ],
58 options={ 60 options={
59 'abstract': False, 61 'abstract': False,
60 }, 62 },
61 ), 63 ),
68 ('html', models.TextField(blank=True)), 70 ('html', models.TextField(blank=True)),
69 ('file', models.FileField(upload_to=downloads.models.download_path)), 71 ('file', models.FileField(upload_to=downloads.models.download_path)),
70 ('date_added', models.DateTimeField(db_index=True)), 72 ('date_added', models.DateTimeField(db_index=True)),
71 ('ip_address', models.IPAddressField(verbose_name=b'IP Address')), 73 ('ip_address', models.IPAddressField(verbose_name=b'IP Address')),
72 ('update_date', models.DateTimeField(db_index=True, blank=True)), 74 ('update_date', models.DateTimeField(db_index=True, blank=True)),
73 ('category', models.ForeignKey(to='downloads.Category')), 75 ('category', models.ForeignKey(to='downloads.Category',
74 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), 76 on_delete=models.CASCADE)),
77 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL,
78 on_delete=models.CASCADE)),
75 ], 79 ],
76 options={ 80 options={
77 'ordering': ('date_added',), 81 'ordering': ('date_added',),
78 }, 82 },
79 ), 83 ),
80 migrations.CreateModel( 84 migrations.CreateModel(
81 name='VoteRecord', 85 name='VoteRecord',
82 fields=[ 86 fields=[
83 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), 87 ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
84 ('vote_date', models.DateTimeField(auto_now_add=True)), 88 ('vote_date', models.DateTimeField(auto_now_add=True)),
85 ('download', models.ForeignKey(to='downloads.Download')), 89 ('download', models.ForeignKey(to='downloads.Download',
86 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), 90 on_delete=models.CASCADE)),
91 ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL,
92 on_delete=models.CASCADE)),
87 ], 93 ],
88 options={ 94 options={
89 'ordering': ('-vote_date',), 95 'ordering': ('-vote_date',),
90 }, 96 },
91 ), 97 ),