Esempio n. 1
0
def create_context_by_bill(bill):
    sender_req = RequisitesDB.get_by_id(
        UserDB.get_by_id(bill['user'])['requisites'])
    recipient_req = RequisitesDB.get_by_id(
        ContactorDB.get_by_id(bill['contractor'])['requisites'])
    items = ContentDB.get_by_id(bill['content'])['items']
    return create_context(sender_req, recipient_req, bill['number'],
                          bill['date_created'], items)
Esempio n. 2
0
def create_context_by_bill(bill):
    sender_req = RequisitesDB.get_by_id(UserDB.get_by_id(bill['user'])['requisites'])
    recipient_req = RequisitesDB.get_by_id(ContactorDB.get_by_id(bill['contractor'])['requisites'])
    items = ContentDB.get_by_id(bill['content'])['items']
    return create_context(sender_req, recipient_req, bill['number'], bill['date_created'], items)
Esempio n. 3
0
 def user_obj(self):
     u_id = self.session.get('user_id', None)
     if u_id:
         return UserDB.get_by_id(u_id)
     else:
         return None
Esempio n. 4
0
 def user_obj(self):
     u_id = self.session.get('user_id', None)
     if u_id:
         return UserDB.get_by_id(u_id)
     else:
         return None