Le dimanche 11 mai 2014 02:14:20 UTC+2, Stephen McDonald a écrit : > > Great stuff. > > We (and most open source django apps that implement models) have this > fundamental customization problem. Mezzanine has tried to solve it in > different ways with EXTRA_MODEL_FIELDS and countless other bits of > configuration throughout its apps, but I think the swappable model approach > is spot on. I also think this approach could be applied across more of > Mezzanine - particularly the page model. > > Personally I haven't had the space to invest any time in this, so it's > great to see this being done, and if you Hervé or anyone else has space for > continuing it further, that'd be fantastic - I'm out of action over the > next few weeks or so, but after then I'll hopefully be able to take a look > at what's been done and bring it all into a new major version. > > Thanks again, and thanks for discussing it to begin with. Here are a few > quick notes on the code so far: > > - Given the idea of applying this to other areas, we probably use a > "get_post_model()" function, instead opting for something like > "get_swappable_model()" which could live in mezzanine.utils somewhere. > > - Prefer to have "BlogPost = get_post_model()" (or get_swappable_model()) > somewhere at the top of each module rather than calling "get_post_model()" > all throughout the file - it's probably faster, and makes the code read > more like we're dealing with a model class. > > - Don't think we need an abstract base model if we're using swappable > models - one seems to make the other redundant. >
Thanks for your feedback! I'll generalize the idea to other content types, and add it to the documentation. You'll have a proper branch to review in a few weeks. Hervé -- You received this message because you are subscribed to the Google Groups "Mezzanine Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
