Created
September 12, 2013 23:25
-
-
Save thequbit/6545155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# do import stuff ... | |
class MyModel(): | |
id = Column(Integer, primary_key=True) | |
name = Column(Text) | |
value = Column(Integer) | |
def __init__(self,name): | |
self.name = name | |
def func(): | |
mymodel = MyModel() | |
mymodel.name = getname() | |
mymodel.value = getvalue() | |
return mymodel | |
## -- OR -- ## | |
def func2(): | |
name = getname() | |
value = getvalue() | |
mymodel = MyModel( | |
name = name, | |
value = value, | |
) | |
return mymodel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment