And why do you use the doc property in
data = column_property(A.data, doc="B's data")
and why do you change A.data in class B?

On Fri, Jun 29, 2018 at 4:18 PM, Mike Bayer <mike...@zzzcomputing.com>
wrote:

> a Column is a Core schema construct that is not part of the ORM.   The
> ORM maps a Column to your mapped class using a column_property() that
> wraps around it.  When you use declarative_base, the declarative
> system is automatically generating these column_property() objects for
> each Column you have by itself.
>
> On Fri, Jun 29, 2018 at 4:16 PM, Marcus Mann <mitymar...@gmail.com> wrote:
> > I guess I am still a little confused about the relationship between
> Column
> > and column_property
> >
> > On Fri, Jun 29, 2018 at 4:14 PM, Mike Bayer <mike...@zzzcomputing.com>
> > wrote:
> >>
> >> On Fri, Jun 29, 2018 at 11:46 AM, Marcus Mann <mitymar...@gmail.com>
> >> wrote:
> >> > When I said description, I just meant a simple string that describes
> the
> >> > object, not a python docstring. Just an example column.
> >>
> >> so....does my example answer your question?
> >>
> >>
> >>
> >>
> >> >
> >> > On Friday, June 29, 2018 at 9:49:07 AM UTC-4, Mike Bayer wrote:
> >> >>
> >> >> your question is getting no answers because it is vague and doesn't
> >> >> provide any code.   what's a "description"?   you mean a Python
> >> >> docstring ?   Python attributes don't have a __doc__ normally, if you
> >> >> mean the "doc" parameter, just make a separate property:
> >> >>
> >> >> class A(Base):
> >> >>     __tablename__ = 'a'
> >> >>
> >> >>     id = Column(Integer, primary_key=True)
> >> >>
> >> >>     data = column_property(Column(String), doc="the data")
> >> >>
> >> >>
> >> >> class B(A):
> >> >>     __tablename__ = 'b'
> >> >>
> >> >>     id = Column(ForeignKey('a.id'), primary_key=True)
> >> >>
> >> >>     data = column_property(A.data, doc="B's data")
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> On Fri, Jun 29, 2018 at 8:41 AM, Marcus Mann <mitym...@gmail.com>
> >> >> wrote:
> >> >> >
> >> >> >
> >> >> > https://stackoverflow.com/questions/51046900/how-to-
> access-override-defaults-on-parents-attribute-in-sql-alchemy
> >> >> >
> >> >> > --
> >> >> > 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 sqlalchemy+...@googlegroups.com.
> >> >> > To post to this group, send email to sqlal...@googlegroups.com.
> >> >> > Visit this group at https://groups.google.com/group/sqlalchemy.
> >> >> > For more options, visit https://groups.google.com/d/optout.
> >> >
> >> > --
> >> > 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 sqlalchemy+unsubscr...@googlegroups.com.
> >> > To post to this group, send email to sqlalchemy@googlegroups.com.
> >> > Visit this group at https://groups.google.com/group/sqlalchemy.
> >> > For more options, visit https://groups.google.com/d/optout.
> >>
> >> --
> >> 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 sqlalchemy+unsubscr...@googlegroups.com.
> >> To post to this group, send email to sqlalchemy@googlegroups.com.
> >> Visit this group at https://groups.google.com/group/sqlalchemy.
> >> For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > 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 sqlalchemy+unsubscr...@googlegroups.com.
> > To post to this group, send email to sqlalchemy@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sqlalchemy.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to