Skip to content

Instantly share code, notes, and snippets.

@yershalom
Created September 18, 2017 09:00
Show Gist options
  • Save yershalom/0a2e29cd35cc694ebdca0aee47df6180 to your computer and use it in GitHub Desktop.
Save yershalom/0a2e29cd35cc694ebdca0aee47df6180 to your computer and use it in GitHub Desktop.
@classmethod
def groups_name(cls, email):
t = db.session.query(F.unnest(cls.group_ids)).filter(cls.email == email)
print "New Q is coming !!!! {}".format(t)
print "!!!!!!!!!!!!!!!!!! {} !!!!!!!!".format(cls.group_ids)
return list([g.name for g in Group.query.filter(Group.id.in_(cls.query(t)))])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment