-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from uppsaladatavetare/feature/suppliers
Automatised inventory system (#4)
- Loading branch information
Showing
31 changed files
with
1,168 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,4 @@ six==1.9.0 | |
requests==2.8.1 | ||
pytz==2015.7 | ||
raven==5.8.1 | ||
pynarlivs==0.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.9 on 2016-09-19 12:24 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
import utils.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('foobar', '0014_card_date_used'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='card', | ||
name='number', | ||
field=utils.models.ScannerField(max_length=20, unique=True), | ||
), | ||
] |
32 changes: 32 additions & 0 deletions
32
src/foobar/migrations/0016_migrate_product_trx_references.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.10.5 on 2017-02-11 21:54 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
from django.contrib.contenttypes.models import ContentType | ||
|
||
|
||
def migrate_references(apps, schema_editor): | ||
ProductTransaction = apps.get_model("shop", "ProductTransaction") | ||
PurchaseItem = apps.get_model("foobar", "PurchaseItem") | ||
ContentType = apps.get_model("contenttypes", "ContentType") | ||
trxs = ProductTransaction.objects.all() | ||
for trx in trxs: | ||
if trx.reference_old: | ||
item_obj = PurchaseItem.objects.get(id=trx.reference_old) | ||
trx.reference_ct = ContentType.objects.get_for_model(item_obj) | ||
trx.reference_id = item_obj.id | ||
trx.save() | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('foobar', '0015_auto_20160919_1224'), | ||
('shop', '0007_auto_20170212_0932'), | ||
('contenttypes', '__first__'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(migrate_references), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ | |
'NAME': ':memory:', | ||
}, | ||
} | ||
|
||
INSTALLED_APPS += ('shop.tests',) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.