diff options
author | luxagraf <sng@luxagraf.net> | 2016-12-31 15:50:59 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2016-12-31 15:50:59 -0500 |
commit | a3d1261de5b29b88a5211900328f0b3c434dd11d (patch) | |
tree | 4e8d77d51952a330ab04e356b50c7cf4764369e7 /app/ebay | |
parent | c80b4dea965ac903d984e0e4b415b430e1fdfb21 (diff) |
added update script for ebay
Diffstat (limited to 'app/ebay')
-rw-r--r-- | app/ebay/update_price.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/ebay/update_price.py b/app/ebay/update_price.py new file mode 100644 index 0000000..b8b4c8c --- /dev/null +++ b/app/ebay/update_price.py @@ -0,0 +1,17 @@ +import sys +import os +from os.path import dirname, abspath +import django +PROJECT_ROOT = abspath(dirname(dirname(dirname(__file__)))) + '/' +sys.path.append(PROJECT_ROOT) +sys.path.append(PROJECT_ROOT + '/app') +sys.path.append(PROJECT_ROOT + '/app/lib') +sys.path.append(PROJECT_ROOT + '/config') +sys.path.append(PROJECT_ROOT + '/venv/bin/python3') +os.environ['DJANGO_SETTINGS_MODULE'] = 'config.settings' +django.setup() +import datetime +from ebay.models import TrackedItem, update_tracked_item_price +items = TrackedItem.objects.filter(date_ending__gte=datetime.datetime.now()) +for item in items: + update_tracked_item_price(item) |