Haha, no worries. Glad that you figured it out!
On Mon, Dec 23, 2013 at 4:58 PM, Diego Ponci <[email protected]> wrote: > I've read the docs before, but the processor wasn't being executed, hence > why I tried registering it as a context processor. > Now I followed your advice, read it again, and noticed I had skipped the > section where you put the processor in a page_processors.py file, and it > worked. > So, yeah, typical RTFM mistake =P > > Thank you! > > On Monday, December 23, 2013 5:01:30 PM UTC-2, Josh Cartmell wrote: > >> Hey Diego, processor_form is used for page_processors ( >> http://mezzanine.jupo.org/docs/content-architecture.html#page-processors) >> not context processors. Context processors are a part of Django that allow >> you to globally add things to your template context. Page processors are >> something that Mezzanine does which allow you to do extra processing when >> pages of a specific model type or with a specific slug are accessed. >> >> I would read over the docs I posted above which I think will help clear >> things up. >> >> >> On Mon, Dec 23, 2013 at 10:13 AM, Diego Ponci <[email protected]>wrote: >> >>> If if helps, the stacktrace goes back to local/lib/python2.7/site- >>> packages/django/template/context.py in __init__, in this section: >>> >>> 1. >>> >>> Context.__init__(self, dict_, current_app=current_app, >>> >>> 2. >>> >>> use_l10n=use_l10n, use_tz=use_tz) >>> >>> 3. >>> >>> if processors is None: >>> >>> 4. >>> >>> >>> processors = () >>> >>> 5. >>> >>> else: >>> >>> 6. >>> >>> processors = tuple(processors) >>> >>> 7. >>> >>> for processor in get_standard_processors() + processors: >>> >>> >>> >>> 1. >>> >>> self.update(processor(request)) # ERROR HERE >>> >>> >>> >>> Maybe the processor shouldn't be executing there? >>> >>> On Monday, December 23, 2013 3:47:16 PM UTC-2, Diego Ponci wrote: >>>> >>>> I've written a context processor, as stated in the docs, so, I have >>>> >>>> #context_processors.py >>>> from mezzanine.pages.page_processors import processor_for >>>> @processor_for('myform') >>>> def another_form_processor(request, page): >>>> return {"form": {}} >>>> >>>> and added "context_processors.another_form_processor" >>>> to TEMPLATE_CONTEXT_PROCESSORS on my settings.py. >>>> >>>> But when I try to use it, I get a "TypeError: another_form_processor() >>>> takes exactly 2 arguments (1 given)" error, that only goes away if I remove >>>> the page argument from the processor. >>>> >>>> Anu suggestions? Did I configure something wrong? >>>> >>> -- >>> 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/groups/opt_out. >>> >> >> -- > 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/groups/opt_out. > -- 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/groups/opt_out.
