Please, find below an example of what I mean:
class User(Base):
id = Column(Integer, primary_key=True)
name = Column(String)
fullname = Column(String)
def __init__(self, name, fullname):
self.name = name
self.fullname = fullname
is the __init__() method recommended ?
El jueves, 26 de abril de 2018, 18:48:53 (UTC+2), Jose Miguel Ibáñez
escribió:
>
> Hi all !
>
> when defining a class (derived from Base), when is recommended to define
> the __init__() method ? I know this consideration https://goo.gl/2umBJv,
> but I can't see the diference when creating objects for database
> population. It seems __init_() is never required.
>
> Thanks !
> José M.
>
>
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.