Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread youpsla
Thanks for all. Agai I apologize for not having post this "etail" in my originl post. Regards Alain -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/cvt5q

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread Ivo Brodien
> I've done the test with another class, it's the same. Then I think > @login_required works only for function and not for Class. https://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-class-based-views explains how to use decorators for classes. -- You received this messa

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread youpsla
Hello all, I've verified that I don't override the class. I've found the reason of the bug. When I delete "@login_required", it works. My class was in view.py: @login_required class EvenementCreateView(.): . I apologize for not have copy/paste that in my first post. I've done the test

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread eprikazc
You might be overriding EvenementCreateView somewhere else. To check it I would suggest you to look up all occurencies of EvenementCreateView in your files Eugene On Nov 23, 3:47 pm, youpsla wrote: > Hi, > thnaks for your answer. It's the same. it doesn't work. > > For information I use generic

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread eprikazc
You might be re-defining EvenementCreateView somewhere else as a function. To check it, I would suggest you to look up all occurences of "EvenementCreateView" in your files. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread youpsla
.py" in get_response 89. response = middleware_method(request) File "C:\Python27\Lib\site-packages\debug_toolbar\middleware.py" in process_request 70. original_urlconf = __import__(getattr(request, 'urlconf', settings.ROOT_URLCONF),

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread Ivo Brodien
yeah, very strange. > url(r"magasin/(?P\d+)/evenement/new/$", > EvenementCreateView.as_view(model=Evenement), > name='new_evenement_magasin'), and you are sure the error is caused by the line above? Commenting it out and works? Just asking, since you did not provide the whole error description?

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread youpsla
Hi, thnaks for your answer. It's the same. it doesn't work. For information I use generic view for other part of the site with: url(r"magasin/(?P\d+)/supprimer/$", DeleteView.as_view(model=Magasin, success_url="/magasins/liste"), name='magasin_supprimer'), and it works fine. And has you say, dj

Re: 'function' object has no attribute 'as_view'

2011-11-23 Thread Ivo Brodien
does this work? ... (r"magasin/(?P\d+)/evenement/new/$",EvenementCreateView.as_view(model=Evenement,)), ... I haven’t used Class based Views yet, but everytime they show up in the docs it is always without using the url function and giving a name. So this is just a wild guess. It seems like

'function' object has no attribute 'as_view'

2011-11-23 Thread youpsla
Hello, the issue here seems to be trivial, maybe I got something in my eyes, but I can't find the solution. Here is my code: urls.py url(r"magasin/(?P\d+)/evenement/new/$", EvenementCreateView.as_view(model=Evenement), name='new_evenement_magasin'), views.py: class EvenementCreateView(CreateView