Example #1
0
 def register_login(class_, username, session, request):
     user = db.query(AdminUser).filter(AdminUser.username==username).first()
     if user:
         now = datetime.now()
         user.last_login = now
         user.session_id = session.id
         user.remote_addr = request.environ["HTTP_REMOTE_EU"]
         db.commit()
Example #2
0
 def register_login(class_, username, session, request):
     user = db.query(AdminUser).filter(
         AdminUser.username == username).first()
     if user:
         now = datetime.now()
         user.last_login = now
         user.session_id = session.id
         user.remote_addr = request.environ["HTTP_REMOTE_EU"]
         db.commit()
Example #3
0
 def get_context(self):
     co = db.query(Customer).filter(Customer.id==self.customer_id).first()
     return co.context
Example #4
0
 def has_call_center(self):
     co = db.query(Customer).filter(Customer.id==self.customer_id).first()
     return co.has_call_center
Example #5
0
 def get_gateway(self):
     gw = db.query(PbxContext.gateway).join(Customer).join(User).filter(User.customer_id==Customer.id).first()
     return 0 if not gw else gw[0]
Example #6
0
 def by_domain(self, domain=None):
     return db.query(PbxContext).filter_by(domain=domain).first()
Example #7
0
 def get_gateways(self):
     return db.query(PbxGateway).filter_by(pbx_profile_id=self.id)
Example #8
0
 def has_call_center(self):
     co = db.query(Customer).filter(Customer.id == self.customer_id).first()
     return co.has_call_center
Example #9
0
 def get_email_account(self):
     email = db.query(EmailAccount).filter(EmailAccount.user_id==self.id).first()
     if email:
         return email
Example #10
0
 def get_gateways(self):
     return db.query(PbxGateway).filter_by(pbx_profile_id=self.id)
Example #11
0
 def get_email_account(self):
     email = db.query(EmailAccount).filter(
         EmailAccount.user_id == self.id).first()
     if email:
         return email
Example #12
0
 def get_customer_name(class_, customer_id):
     customer = db.query(Customer).filter(
         Customer.id == customer_id).first()
     if customer:
         return customer.name
Example #13
0
 def get_groups(self):
     return db.query(Group.name).join(UserGroup).filter(
         UserGroup.user_id == self.id).all()
Example #14
0
 def get_context(self):
     co = db.query(Customer).filter(Customer.id == self.customer_id).first()
     return co.context
Example #15
0
 def get_groups(self):
     return db.query(Group.name).join(UserGroup).filter(UserGroup.user_id==self.id).all()
Example #16
0
 def get_customer_name(class_, customer_id):
     customer = db.query(Customer).filter(Customer.id==customer_id).first()
     if customer:
         return customer.name
Example #17
0
 def by_domain(self, domain=None):
     return db.query(PbxContext).filter_by(domain=domain).first()
Example #18
0
 def index(self, category):
     return  db.query(Help)
Example #19
0
 def get_gateway(self):
     gw = db.query(PbxContext.gateway).join(Customer).join(User).filter(
         User.customer_id == Customer.id).first()
     return 0 if not gw else gw[0]