nope, it anyway called on class created, not on loading понедельник, 17 декабря 2018 г., 13:28:40 UTC+3 пользователь Simon King написал: > > On Mon, Dec 17, 2018 at 9:05 AM Tolstov Sergey <whist...@gmail.com > <javascript:>> wrote: > > > > Decorator sqlalchemy.orm.reconstructor compilated once, when build code. > > How can i create dynamic content(like __init__?) > > > > Are you asking how you can override the reconstructor in subclasses? > If so, perhaps you could do something like this: > > from sqlalchemy import orm > > class MyMappedClass(object): > @orm.reconstructor > def _handle_init_on_load(self): > # call a normal method that can be overridden in subclasses > self._init_on_load() > > def _init_on_load(): > # override this method in subclasses > pass > > > Hope that helps, > > Simon >
-- 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.