You might want to have a look at what pyramid_layout does. On Apr 28, 2013 1:01 AM, "Ahmed" <[email protected]> wrote:
> Hello all, > I have a design question, pertaining to the use of the component registry. > > I have recently implemented some @model decorators that I will use to keep > track of my sqlalchemy models. These decorators will be added to the > registry on a Configurator.scan() and queried by name where name will be in > my case the lower() of the model class name. The decorators registers these > with an config.add_model() method which registers them as named utilities > in the registry in a new category "models", which I can lookup by name. > > Now I want to do the same for my form classes. > The problem is that form lookup is more complex than model lookup because > it depends on lots of criteria like the action of the form e.g. create > forms, edit forms, listing forms ... plus the model e.g. create Employee, > create Manager, create Product forms etc. > There may be also extra criteria for some form types .. e.g. create child > model form, with additional criteria of a relationship or a parent or child > class etc.. > > The problem is that this does not conform to the utility or adapter > functions of the component registry. > > So do I abandon the pyramid registry for this job and just cache them in a > dictionary with perhaps tuples containing all possible criteria acting as > keys? Or is there a way to make for the component registry to hold this > data in some way. > > Cheers, > Ahmed > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" 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 http://groups.google.com/group/pylons-discuss?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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 http://groups.google.com/group/pylons-discuss?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
