Skip to content

Instantly share code, notes, and snippets.

@Weyzu
Created October 17, 2017 15:00
Show Gist options
  • Save Weyzu/40ff34a65c2bccfaf7113434ef17c64c to your computer and use it in GitHub Desktop.
Save Weyzu/40ff34a65c2bccfaf7113434ef17c64c to your computer and use it in GitHub Desktop.
daft_blog_06.py
class PersonRepository:
@db_session
def create(self, name, age):
return Person(name=name, age=age)
@db_session
def get_by_name(self, name):
return list(select(p for p in Person if p.name == name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment