# Path: social/apps/flask_app/models.py
# class User(Document, UserMixin):
#     username = StringField(max_length=200)
#     email = StringField(max_length=200)
#     active = BooleanField(default=True)
# 
#     def is_active(self):
#         return self.active
# 
# class UserSocialAuth(Document, MongoengineUserMixin):
#     #id = StringField(primary_key=True)   
#     user = ReferenceField(User, dbref=True)
#     provider = StringField(max_length=32)
#     uid = StringField(max_length=255)
#     extra_data = DictField()
#     meta = {
#         'indexes': ['uid']
#         }
# 
#     @classmethod
#     def username_max_length(cls):
#         return User.username.max_length
# 
#     @classmethod
#     def user_model(cls):
#         return User
# 
#     @classmethod
#     def _del_session(cls, qs):
#         session.clear()
#         #session.pop(username, None)


import sys
from flask_script import Server, Manager, Shell
from social.apps.flask_app.models import User, UserSocialAuth
from flask_reveal import app, db, models
# coding=utf-8

sys.path.append('..')


manager = Manager(app)
manager.add_command('runserver', Server())
manager.add_command('shell', Shell(make_context=lambda: {
    'app': app,
    'db': db,
    'models': models,

# Path: social/apps/flask_app/models.py
# class User(Document, UserMixin):
#     username = StringField(max_length=200)
#     email = StringField(max_length=200)
#     active = BooleanField(default=True)
# 
#     def is_active(self):
#         return self.active
# 
# class UserSocialAuth(Document, MongoengineUserMixin):
#     #id = StringField(primary_key=True)   
#     user = ReferenceField(User, dbref=True)
#     provider = StringField(max_length=32)
#     uid = StringField(max_length=255)
#     extra_data = DictField()
#     meta = {
#         'indexes': ['uid']
#         }
# 
#     @classmethod
#     def username_max_length(cls):
#         return User.username.max_length
# 
#     @classmethod
#     def user_model(cls):
#         return User
# 
#     @classmethod
#     def _del_session(cls, qs):
#         session.clear()
#         #session.pop(username, None)


# Path: manage.py
import sys
from flask_script import Server, Manager, Shell
from social.apps.flask_app.models import User, UserSocialAuth
from flask_reveal import app, db, models

# coding=utf-8

sys.path.append('..')


manager = Manager(app)
manager.add_command('runserver', Server())
manager.add_command('shell', Shell(make_context=lambda: {
    'app': app,
    'db': db,
    'models': models,

    'user': User,