# Path: ngcrowd/models.py
# class JsonifyMixin:
# class Application(Base, JsonifyMixin):
# class User(Base):
# class Entity(Base, JsonifyMixin):
# class EntityProperty(Base, JsonifyMixin):
# class EntityPropertyValue(Base):
# class ReferenceBookValue(Base):
# class EntityVersions(Base):
#     def __init__(self):
#     def as_json_dict(self, **init):
#     def password_hash(cls, password, salt):
#     def as_dict(self, **addon):
#     def to_dict(self):
#     def to_json_binary_dump(self, json_object):
# 
# Path: ngcrowd/security.py
# def generate_session_id():
#     import random
#     import string
# 
#     return ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(10))


import time
from pyramid.view import view_config
from sqlalchemy.orm import joinedload
from ngcrowd.models import DBSession, User, EntityProperty, Application
from ngcrowd.security import generate_session_id
# -*- coding: utf-8 -*-





@view_config(route_name='home', renderer='base.mako')
def home(request):
    user_name = None
    if hasattr(request, 'cookies') and 'sk' in request.cookies.keys() and 'sk' in request.session and \
                    request.session['sk'] == request.cookies['sk'] and 'u_name' in request.session:
        user_name = request.session['u_name']

    session = DBSession()

    fields = session.query(EntityProperty)\
        .options(joinedload('reference_book_values'))\

# Path: ngcrowd/models.py
# class JsonifyMixin:
# class Application(Base, JsonifyMixin):
# class User(Base):
# class Entity(Base, JsonifyMixin):
# class EntityProperty(Base, JsonifyMixin):
# class EntityPropertyValue(Base):
# class ReferenceBookValue(Base):
# class EntityVersions(Base):
#     def __init__(self):
#     def as_json_dict(self, **init):
#     def password_hash(cls, password, salt):
#     def as_dict(self, **addon):
#     def to_dict(self):
#     def to_json_binary_dump(self, json_object):
# 
# Path: ngcrowd/security.py
# def generate_session_id():
#     import random
#     import string
# 
#     return ''.join(random.choice(string.ascii_uppercase + string.digits) for x in range(10))


# Path: ngcrowd/views/home.py
import time
from pyramid.view import view_config
from sqlalchemy.orm import joinedload
from ngcrowd.models import DBSession, User, EntityProperty, Application
from ngcrowd.security import generate_session_id

# -*- coding: utf-8 -*-





@view_config(route_name='home', renderer='base.mako')
def home(request):
    user_name = None
    if hasattr(request, 'cookies') and 'sk' in request.cookies.keys() and 'sk' in request.session and \
                    request.session['sk'] == request.cookies['sk'] and 'u_name' in request.session:
        user_name = request.session['u_name']

    session = DBSession()

    fields = session.query(EntityProperty)\
        .options(joinedload('reference_book_values'))\

        .order_by(EntityProperty.visible_order)\