Permalink
Browse files

Switching ORM for the third time:

* reusing Django ORM
* add Django framework stuff
* minimal `Prices()` works after `makemigrations`, `migrate`
* packaging stuff: `setup.py`, `requirements.py`
  • Loading branch information...
stnbu committed Sep 2, 2018
1 parent deb4575 commit e4f8deffb4f5a7082781304fed8b00158c5cfdcd
Showing with 51 additions and 35 deletions.
  1. 0 coincharts/__init__.py
  2. +2 −1 coincharts/schema.py
  3. +1 −0 coincharts/templates/main/index.html
  4. +15 −0 manage.py
  5. +0 −34 multi_symbol.py
  6. +4 −0 requirements.txt
  7. +29 −0 setup.py
No changes.
@@ -71,7 +71,8 @@ def get_db_table(symbol_id, orm):
raise Exception('Unknown ORM "{}"'.format(orm))
if orm == 'django':
klass = type(symbol_id, (models.Model,), columns)
columns['__module__'] = __name__
klass = type(symbol_id, (django.db.models.Model,), columns)
klass.__str__ = __str__
elif orm == 'sqlalchemy':
Base = sqlalchemy.ext.declarative.declarative_base()
@@ -0,0 +1 @@
<h1>foo</h1>
@@ -0,0 +1,15 @@
#!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'coincharts.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,4 @@
python-daemon>=2.2
requests>=2.18
python-dateutil>=2.7
PyYAML>=3.13
@@ -0,0 +1,29 @@
# -*- mode: pyton coding: utf-8 -*-
from distutils.core import setup
import time
_author = 'Mike Burr'
_email = 'mburr@unintuitive.com'
__author__ = '%s <%s>' % (_author, _email)
import coincharts
name = coincharts.__name__
def read(file):
with open(file, 'r') as f:
return f.read().strip()
setup(
name=name,
version='0.0.1-%s' % time.time(), # HACK
long_description=read('README.md'),
author=_author,
author_email=_email,
provides=[name],
packages=[name],
entry_points = {
'console_scripts': ['coincharts-daemon=coincharts.daemon:main'],
}
)

0 comments on commit e4f8def

Please sign in to comment.