On 13 jan, 13:14, Alex Koshelev <[EMAIL PROTECTED]> wrote:
> You wrote:
>
>  P/
>   APP2/
>     middlewares.py -> MyMiddleware
>
> And then:
> 'P.APP2.middlewares.ProfileMiddleware',
>
> MyMiddleware != ProfileMiddleware
>
> Is it right?
>
> On 13 янв, 13:53, Grindizer <[EMAIL PROTECTED]> wrote:


when i wrote MyMiddleware i juste wanted to give a symbolic name (like
P or APP1). The real name of my middleware is ProfileMiddleware
(sorry, for MIDDLEWARE_CLASSES i juste make a copy/past of my project
i replace tje reeal name of my application by APP2 but i forgot to
replace ProfileMiddleware).

So i insiste in the fact that the middleware works (i can see that in
the front end of my project),  the only thing is that APP2 does not
appear in the admin interface:
at the index level, in addition to this when i manually enter the url
of an existing model of APP2 (thing like ....../admin/APP2/MyModelsX/)
i was able to see the change list.

Finally, I tried to trace the problem, and wanted to see when APP2 is
lost, i put some code in adminapplist.py ( file at
django.contrib.admin.templatetags) and found that when i put this line
"models.get_app('APP2')" in the render method (juste after the import
statments) APP2 appear in admin interface. (note that it is suffisant
to put this statement without assigning the result to any variable)
so i had this in django.contrib.admin.templatetags.adminapplist.py

--------
from django import template
from django.db.models import get_models
from django.utils.encoding import force_unicode
from django.utils.safestring import mark_safe

register = template.Library()

class AdminApplistNode(template.Node):
    def __init__(self, varname):
        self.varname = varname

    def render(self, context):
        from django.db import models
        from django.utils.text import capfirst

        models.get_app('vreports')

        app_list = []
        user = context['user']
...etc
-----------

here "vcreports" is the real name of my application (APP2).

This is why i found this i little strange.

Thank you for your comment.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to