forked from expo/troggle
Part one of getting troggle to work with django 1.10
Major rework of how survex is processed
This commit is contained in:
@@ -3,6 +3,11 @@ import time
|
||||
import settings
|
||||
os.environ['PYTHONPATH'] = settings.PYTHON_PATH
|
||||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
|
||||
|
||||
if __name__ == '__main__':
|
||||
import django
|
||||
django.setup()
|
||||
|
||||
from django.core import management
|
||||
from django.db import connection
|
||||
from django.contrib.auth.models import User
|
||||
@@ -28,7 +33,7 @@ def reload_db():
|
||||
cursor.execute("CREATE DATABASE %s" % databasename)
|
||||
cursor.execute("ALTER DATABASE %s CHARACTER SET=utf8" % databasename)
|
||||
cursor.execute("USE %s" % databasename)
|
||||
management.call_command('syncdb', interactive=False)
|
||||
management.call_command('migrate', interactive=False)
|
||||
user = User.objects.create_user(expouser, expouseremail, expouserpass)
|
||||
user.is_staff = True
|
||||
user.is_superuser = True
|
||||
@@ -90,14 +95,16 @@ def reset():
|
||||
import_caves()
|
||||
import_people()
|
||||
import_surveyscans()
|
||||
import_survex()
|
||||
|
||||
import_logbooks()
|
||||
import_QMs()
|
||||
|
||||
import_survex()
|
||||
try:
|
||||
import_tunnelfiles()
|
||||
except:
|
||||
print("Tunnel files parser broken.")
|
||||
|
||||
|
||||
import_surveys()
|
||||
|
||||
|
||||
@@ -146,7 +153,7 @@ def dumplogbooks():
|
||||
persons = [{"name": get_name(pt.personexpedition), "TU": pt.time_underground, "author": pt.is_logbook_entry_author} for pt in pts]
|
||||
f = open(filename, "wb")
|
||||
template = loader.get_template('dataformat/logbookentry.html')
|
||||
context = Context({'trip': trip,
|
||||
context = Context({'trip': trip,
|
||||
'persons': persons,
|
||||
'date': dateStr,
|
||||
'expeditionyear': lbe.expedition.year})
|
||||
@@ -239,7 +246,3 @@ if __name__ == "__main__":
|
||||
else:
|
||||
print("%s not recognised" % sys.argv)
|
||||
usage()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user