I see. I thought you were referring specifically to the admin app controller as magic, but its really the entire web2py concept of a controller being executed in a global environment rather than imported.
On Wednesday, January 30, 2013 3:09:18 AM UTC-5, Paul Whipp wrote: > > For me, magic is anything that supplies context or functionality that is > not visible in the usual python manner. For example where the default.py > controller file looks like normal python and mostly behaves that way but > has a whole lot of magic going on in terms of variables it can access. > > On 30 January 2013 16:25, Anthony <[email protected] <javascript:>> wrote: > >> And how do you define "magic" in this case? >> >> >> On Wednesday, January 30, 2013 12:38:25 AM UTC-5, Paul Whipp wrote: >> >>> A very fair question. >>> >>> I'd like to define a class that inherits from the controller class set >>> up in the magic stuff. In that class I'd define the replacement edit >>> method. I'd then have some code indicating that the files for the >>> specialised app are to be searched for in the source app folders and >>> indicating that my controller class is to be used in place of the usual >>> magic controller. >>> >>> >>> On 30 January 2013 15:30, Anthony <[email protected]> wrote: >>> >>>> What sort of solution do you envision? >>>> >>>> >>>> On Tuesday, January 29, 2013 11:02:36 PM UTC-5, Paul Whipp wrote: >>>> >>>>> Thanks for that. >>>>> >>>>> If I use a plug in I can replace the default.py controller file in >>>>> admin in its entirety, if my reading of that section is correct, a plugin >>>>> solution still involves a lot of repetition (although at least we're down >>>>> to one file) and a hole in future update behaviour. >>>>> >>>>> On 30 January 2013 13:42, Anthony <[email protected]> wrote: >>>>> >>>>>> Maybe look into plugins: http://web2py.com/**boo** >>>>>> ks/default/chapter/29/12#**Plugi**ns<http://web2py.com/books/default/chapter/29/12#Plugins> >>>>>> >>>>>> >>>>>> On Tuesday, January 29, 2013 6:39:44 PM UTC-5, Paul Whipp wrote: >>>>>>> >>>>>>> I'm new to web2py but not to Python or web application frameworks. >>>>>>> >>>>>>> I love the dry pythonic nature of web2py. I'm less enamoured by its >>>>>>> use of magic but the convenient REP makes this mostly forgivable. I'm >>>>>>> giving web2py a go on a couple of real projects. >>>>>>> >>>>>>> As I use emacs, it looks like it would be straightforward to modify >>>>>>> the admin app to pass a file to an emacs service (if available) for >>>>>>> editing. Its also easy to copy the admin application, call it myadmin >>>>>>> and >>>>>>> make the change there. These are both bad things to do because; in the >>>>>>> first case an upgrade will overwrite my change (yes I use source >>>>>>> control >>>>>>> but its still going to be a pain), and in the second case I've copied a >>>>>>> large slice of code and lost the benefit of upgrades in myadmin which >>>>>>> could >>>>>>> lead to all sorts of problems in the long term. >>>>>>> >>>>>>> What I want to do is specialize the admin app such that I just use >>>>>>> my specialised default controller with its single specialized edit >>>>>>> method >>>>>>> (the latter specialisation is a little tricky because the method is a >>>>>>> bit >>>>>>> monolithic but you can see what I'm aiming at). >>>>>>> >>>>>>> The result would be a specialization of the admin app called myadmin >>>>>>> containing virtually nothing but the specialized default controller and >>>>>>> edit method. I cannot see any obvious way to do this. Am I going to >>>>>>> have to >>>>>>> make like a PHP programmer and copy the whole application to make one >>>>>>> small >>>>>>> change or is there some cool way to unravel the magic a bit and point >>>>>>> the >>>>>>> myadmin file lookups to admin, except for my controllers/default.py? >>>>>>> >>>>>>> For the time being I'll stick with navigating the file structure and >>>>>>> invoking emacs directly, so my question is more of a "How would I". >>>>>>> I've >>>>>>> tried google to no avail and I'll be happy for an RTFM response if you >>>>>>> can >>>>>>> point me at the FM (or an example) that covers this. >>>>>>> >>>>>>> Cheers, >>>>>>> Paul >>>>>>> >>>>>> -- >>>>>> >>>>>> --- >>>>>> You received this message because you are subscribed to the Google >>>>>> Groups "web2py-users" group. >>>>>> To unsubscribe from this group and stop receiving emails from it, >>>>>> send an email to web2py+un...@**googlegroups.com. >>>>>> >>>>>> For more options, visit >>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out> >>>>>> . >>>>>> >>>>>> >>>>>> >>>>> >>>>> -- >>>> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "web2py-users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to web2py+un...@**googlegroups.com. >>>> For more options, visit >>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>>> . >>>> >>>> >>>> >>> >>> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "web2py-users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- --- You received this message because you are subscribed to the Google Groups "web2py-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/groups/opt_out.

