Exemplo n.º 1
0
 def queryJid(self, jid):
     jid = jid.lower()
     jids = UserHistory.select().where((pw.fn.Lower(pw.fn.Substr(UserHistory.jid, 1, len(jid))) == jid))
     jids = list(jids)
     if len(jids) > 0:
         instance = jids[0]
         others = dict(selStart=len(jid), selEnd=len(instance.jid))
         self._obj = peeweeWrapper(jids[0], others)
         return self._obj
     return QtCore.QVariant()
Exemplo n.º 2
0
 def queryJid(self, jid):
     jid = jid.lower()
     jids = UserHistory.select().where(
         (pw.fn.Lower(pw.fn.Substr(UserHistory.jid, 1, len(jid))) == jid))
     jids = list(jids)
     if len(jids) > 0:
         instance = jids[0]
         others = dict(selStart=len(jid), selEnd=len(instance.jid))
         self._obj = peeweeWrapper(jids[0], others)
         return self._obj
     return QtCore.QVariant()
Exemplo n.º 3
0
 def removeByIndex(self, index):
     obj = self.get(index)
     dq = UserHistory.delete().where(UserHistory.id == obj.id)
     dq.execute()
     self.removeAt(index)
Exemplo n.º 4
0
 def load(self):
     return UserHistory.select()
Exemplo n.º 5
0
 def removeByIndex(self, index):
     obj = self.get(index)
     dq = UserHistory.delete().where(UserHistory.id == obj.id)
     dq.execute()
     self.removeAt(index)
Exemplo n.º 6
0
 def load(self):
     return UserHistory.select()