Пример #1
0
 def get_currency_rate(self, base, currency, date):
     session = get_session()
     return session.query(Currency) \
         .filter(and_(
             Currency.base_currency == base,
             Currency.currency == currency,
             Currency.date == date
         )) \
         .first()
Пример #2
0
 def get_notes(self):
     session = get_session()
     return session.query(Note).all()
Пример #3
0
 def get_all_notes_with_growth(self):
     session = get_session()
     return session.query(Note) \
         .filter(or_(Note.growth == True, Note.growth == False)) \
         .all()
Пример #4
0
 def get_notes_by_currency(self, curency):
     session = get_session()
     return session.query(Note) \
         .filter(Note.currency == curency) \
         .all()
Пример #5
0
 def get_all_notes_with_currency(self):
     session = get_session()
     return session.query(Note) \
         .filter(Note.currency != '') \
         .all()
Пример #6
0
    def get_notes_by_language_with_session(self, lang):
        session = get_session()

        return session, session.query(Note)\
            .filter(Note.feed.like("{}_%".format(lang)))\
            .all()
Пример #7
0
 def get_note_by_id(self, id):
     session = get_session()
     return session.query(Note) \
         .get(int(id))