On Sun, Nov 26, 2017 at 7:20 AM, Olaf <bastien...@gmail.com> wrote: > Thank you. Yes, it could be interesting to use SQLAlchemy functionalities to > reduce all these metaclass conflicts. But, is it possible, in the > "on_new_class" method, to access to the 'name', 'bases' and 'attrs'
sure, you've got cls.__name__, cls.__bases__, and dir(cls). > attributes habitually gived by the _init_ method of a metaclass ? > > I tried to search in cls_.__dict__ without finding and the documentation > don't seem to mention other possible parameters. > > Example: > > class MetaExample(type): > def __init__(self, name, bases, attrs): > pass > #Here, I can use the name, bases and attrs attributes > > > Versus > > @event.listens_for(Stockable, 'instrument_class', propagate=True) > def on_new_class(mapper, cls_): > pass > #Only the cls_ attribute > > > Thank you ! > > -- > 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.