parent
385e785cc1
commit
5f609401e3
12 changed files with 60 additions and 4 deletions
@ -0,0 +1,22 @@ |
||||
# Generated by Django 2.0.6 on 2018-11-09 14:02 |
||||
|
||||
from django.db import migrations, models |
||||
|
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('payment', '0026_auto_20181101_1546'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.RemoveField( |
||||
model_name='usergiftcertificate', |
||||
name='recipient', |
||||
), |
||||
migrations.AddField( |
||||
model_name='giftcertificate', |
||||
name='cover', |
||||
field=models.CharField(blank=True, default='', max_length=255), |
||||
), |
||||
] |
||||
@ -0,0 +1,21 @@ |
||||
# Generated by Django 2.0.6 on 2018-11-09 14:03 |
||||
|
||||
from django.db import migrations |
||||
from django.contrib.staticfiles.storage import staticfiles_storage |
||||
|
||||
|
||||
def add_gift_certificates(apps, schema_editor): |
||||
GiftCertificate = apps.get_model('payment', 'GiftCertificate') |
||||
for price in [1000, 2000, 3000, 5000, 10000]: |
||||
GiftCertificate.objects.create(price=price, |
||||
cover=staticfiles_storage.url('img/gift-certificates/%d.jpg' % price)) |
||||
|
||||
class Migration(migrations.Migration): |
||||
|
||||
dependencies = [ |
||||
('payment', '0027_auto_20181109_1402'), |
||||
] |
||||
|
||||
operations = [ |
||||
migrations.RunPython(add_gift_certificates), |
||||
] |
||||
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 300 KiB |
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 300 KiB |
Loading…
Reference in new issue