Commit 1e7645a320f7e5a3162fd7ea8ac49e7341e7ccd3

Update code after removing submodule

  Updated the code to work w/o user management submodule.
This removes cloning the sub-module separately and configuring it.
  
1from user import User
2#from group import Group
3#from membership import Membership
14from context import Context
25from sweet import Sweet
36from client import Client, AuthorizedClients
  
66from flask import current_app
77
88from swtstore.classes.database import db
9from swtstore.classes.models.um import User
9from swtstore.classes.models import User
1010from swtstore.classes import oauth
11
1112
1213class Client(db.Model):
1314 """
  
66
77from datetime import datetime
88
9from .config import db
9from swtstore.classes.database import db
10
1011
1112class Group(db.Model):
1213 """
  
33
44from datetime import datetime
55
6from .config import db
6from swtstore.classes.database import db
7
78
89class Membership(db.Model):
910 """ docstring """
  
99# custom SQLAlchemy type JSONType
1010from swtstore.classes.models.types import JSONType
1111from swtstore.classes.utils import urlnorm # normalize URLs
12from swtstore.classes.models import Context
13from swtstore.classes.models.um import User
12from swtstore.classes.models import Context, User
1413
1514class Sweet(db.Model):
1615 """ customary docstring """
  
33
44from datetime import datetime
55from flask import session
6
7#from .config import db
86from flask import current_app
9# TODO: remove dependency from config file
10db = current_app.db
117
8from swtstore.classes.database import db
129
10
1311class User(db.Model):
1412 """ docstring """
1513
2828 self.username = kwargs.get('username')
2929 if kwargs.get('last_active'):
3030 current_app.logger.debug('Updated last_active timestamp %s for %s',
31 self, kwargs.get('last_active'))
31 kwargs.get('last_active'), self)
3232 self.last_active = kwargs.get('last_active')
3333
3434 self.persist()
  
77from hashlib import md5
88from werkzeug.security import gen_salt
99
10from swtstore.classes.models import Client
11from swtstore.classes.models.um import User
10from swtstore.classes.models import Client, User
1211from swtstore.classes.utils import urlnorm
1312
1413
  
44from flask import Module, jsonify, request, render_template, redirect,\
55 url_for, json, current_app
66
7from swtstore.classes.models import Context
8from swtstore.classes.models.um import User
7from swtstore.classes.models import Context, User
98
109
1110context = Module(__name__)
  
77
88from sqlalchemy import desc
99
10from swtstore.classes.models import Sweet
11from swtstore.classes.models.um import User
10from swtstore.classes.models import Sweet, User
1211
1312
1413frontend = Module(__name__)
  
66import requests
77
88from swtstore.classes import oauth
9from swtstore.classes.models.um import User
10from swtstore.classes.models import Client, AuthorizedClients
9from swtstore.classes.models import Client, AuthorizedClients, User
1110
1211
1312Oauth = Module(__name__)
  
55from flask import Module, jsonify, request, render_template, redirect,\
66 url_for, abort, json
77
8from swtstore.classes.models import Context
9from swtstore.classes.models import Sweet
10from swtstore.classes.models.um import User
8from swtstore.classes.models import Context, Sweet, User
119
1210
1311sweet = Module(__name__)
  
88 make_response, url_for, redirect, json, current_app
99
1010# swtstore imports
11from swtstore.classes.models.um import User
12from swtstore.classes.models import Sweet, Context, Client, AuthorizedClients
11from swtstore.classes.models import User, Sweet, Context, Client,\
12 AuthorizedClients
1313
1414from swtstore.classes.utils.httputils import makeCORSHeaders
1515from swtstore.config import DefaultConfig