Re: Update to Tutorial 4 - Generic Views

2022-03-11 Thread Heman Okumbo
> question to a potentially more useful place. > > Anyway; I am pretty new to Django but I've been following the tutorials > and in the Generic Views section here: > https://docs.djangoproject.com/en/4.0/intro/tutorial04/ > > I beleive that there is a missing import statem

Re: Update to Tutorial 4 - Generic Views

2022-03-11 Thread Antonis Christofides
but I can't seem to find a way. If you could help me there I could take this question to a potentially more useful place. Anyway; I am pretty new to Django but I've been following the tutorials and in the Generic Views section here: https://docs.djangoproject.com/en/4.0/intro/tutorial04/ I

Update to Tutorial 4 - Generic Views

2022-03-11 Thread Dan Cox
Hi I've been searching on how I might contribute to the tutorials but I can't seem to find a way. If you could help me there I could take this question to a potentially more useful place. Anyway; I am pretty new to Django but I've been following the tutorials and in the Generic Views section

RES: testing class based generic views

2020-10-26 Thread Samuel Nogueira
/SamuelNoB Linkedin: https://www.linkedin.com/in/samuel-nogueira-87800b1aa/ - De: Patrick CarraEnviado:sábado, 24 de outubro de 2020 16:53Para: Django usersAssunto: testing class based generic views Can

testing class based generic views

2020-10-24 Thread Patrick Carra
Can anyone point me towards a tutorial for how to test a CreateView function? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Re: Generic Views in Django Tutorial Not Working

2019-11-01 Thread Nijo Joseph
e to see specifically. I am at > https://docs.djangoproject.com/en/2.2/intro/tutorial04/#use-generic-views-less-code-is-better > in > the Django tutorial and it seems replacing HTTPRequests with GenericViews > broke the web server. I followed the instructions and now have this: > >

Re: Generic Views in Django Tutorial Not Working

2019-11-01 Thread Kasper Laudrup
Hi Mike, On 01/11/2019 09.14, Mike Starr wrote: Hi! There's a lot of error message to copy and paste so please request what you would like to see specifically. I am at https://docs.djangoproject.com/en/2.2/intro/tutorial04/#use-generic-views-less-code-is-better in the Django tutorial

Generic Views in Django Tutorial Not Working

2019-11-01 Thread Mike Starr
Hi! There's a lot of error message to copy and paste so please request what you would like to see specifically. I am at https://docs.djangoproject.com/en/2.2/intro/tutorial04/#use-generic-views-less-code-is-better in the Django tutorial and it seems replacing HTTPRequests with GenericViews

Help with reusing generic views in my little finance/budget application

2018-07-17 Thread rod termaat
'] template_name_suffix = '_update_form' class CheckDelete(DeleteView): model = Check success_url = reverse_lazy('checkbook-month') I would like to be able to render the generic views from either functional view and then get back to the view when the form is updated. Right now I have to pick only 1 via

Re: generic views empty args problem

2017-09-15 Thread Rafał Szymański
Does it help? return super(SampleUpdateView, self).get(request, project_name, *args, **kwargs) W dniu czwartek, 14 września 2017 13:25:06 UTC+2 użytkownik Adrian Jasiński napisał: > > > > When I have in my urlpatterns args and kwargs in any of generic views then > the view

Re: Generic forms (ModelForm) provide HTML for a form! Can generic views (DetailView) do same?

2015-08-12 Thread Mike Dewhirst
On 13/08/2015 7:20 AM, Bernd Wechner wrote: Mike, Thanks. This was just a quick hack ripped off from ModelForm (although not as quick as I'd have liked as reverse engineering never is and had to read through ModelForm and get my head around bits) In any case wouldn't be ready for adding to

Re: Generic forms (ModelForm) provide HTML for a form! Can generic views (DetailView) do same?

2015-08-12 Thread Bernd Wechner
Mike, Thanks. This was just a quick hack ripped off from ModelForm (although not as quick as I'd have liked as reverse engineering never is and had to read through ModelForm and get my head around bits) In any case wouldn't be ready for adding to Django as is, but others could improve it to

Re: Generic forms (ModelForm) provide HTML for a form! Can generic views (DetailView) do same?

2015-08-12 Thread Mike Dewhirst
On 12/08/2015 8:54 PM, Bernd Wechner wrote: OK, I give up, seriously dismayed that Django doesn't have this built in already Well done Bernd! Welcome to open source. Unfortunately, I can't use your code unless it is part of Django. I have tried implementing my own improvements in the past

Re: Generic forms (ModelForm) provide HTML for a form! Can generic views (DetailView) do same?

2015-08-12 Thread Bernd Wechner
OK, I give up, seriously dismayed that Django doesn't have this built in already I did as I threatened to and derived a class as follows: from django.utils import six from django.utils.safestring import mark_safe from django.utils.html import conditional_escape from django.utils.encoding import

Re: problem with using generic views

2015-08-10 Thread Doaa Hassan
AM, "Doaa Hassan" <hsd...@gmail.com > > wrote: > >> Hi all, >> >> I am trying to convert poll app introduced on: >> >> https://docs.djangoproject.com/en/1.8/intro/tutorial01/ >> >> to use the generic views system as describe

Generic forms (ModelForm) provide HTML for a form! Can generic views (DetailView) do same?

2015-08-10 Thread Bernd Wechner
This has bamboozled me for a while. I Have a wonderful little test app I'm playing with which lists objects (ListView) and next to each object puts an edit and view link. Sort of like: - [view] [edit] Object 1 - [view] [edit] Object 2 - [view] [edit] Object 3 The ListView works like a

Re: problem with using generic views

2015-08-08 Thread James Schneider
gt; wrote: > Hi all, > > I am trying to convert poll app introduced on: > > https://docs.djangoproject.com/en/1.8/intro/tutorial01/ > > to use the generic views system as described on: > > https://docs.djangoproject.com/en/1.8/intro/tutorial04/ > > However, w

problem with using generic views

2015-08-08 Thread Doaa Hassan
Hi all, I am trying to convert poll app introduced on: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ to use the generic views system as described on: https://docs.djangoproject.com/en/1.8/intro/tutorial04/ However, when I convert the URLconf by opening the polls/urls.py

Re: Generic Views and Django.contrib.auth

2014-12-04 Thread Rootz
w where login is required? >>> >>> Collin >>> >>> On Sunday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote: >>>> >>>> Hi can this work with url reversing namespaced urls? >>>> thanks >>>> >>>> On Thur

Re: Generic Views and Django.contrib.auth

2014-12-04 Thread Collin Anderson
>>> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote: >>>> >>>> If you are usign class based generic views you can use the decorators >>>> in the URL config of your app, for example >>>> >>>> urlpatterns = patte

Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Rootz
unday, November 30, 2014 11:07:42 PM UTC-5, Rootz wrote: >> >> Hi can this work with url reversing namespaced urls? >> thanks >> >> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote: >>> >>> If you are usign class based

Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Rootz
, Rootz wrote: >> >> Hi can this work with url reversing namespaced urls? >> thanks >> >> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote: >>> >>> If you are usign class based generic views you can use the decorators in

Re: Generic Views and Django.contrib.auth

2014-12-03 Thread Marcus Cl
M UTC-5, Rootz wrote: >> >> Hi can this work with url reversing namespaced urls? >> thanks >> >> On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote: >>> >>> If you are usign class based generic views you can use the decorators

Re: Generic Views and Django.contrib.auth

2014-12-02 Thread Collin Anderson
16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote: >> >> If you are usign class based generic views you can use the decorators in >> the URL config of your app, for example >> >> urlpatterns = patterns('', >> (r'^about/', login_required(AboutView.as_view(

Re: Generic Views and Django.contrib.auth

2014-11-30 Thread Rootz
Hi can this work with url reversing namespaced urls? thanks On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote: > > If you are usign class based generic views you can use the decorators in > the URL config of your app, for example > > urlpatterns = patterns('',

Re: Generic Views and Django.contrib.auth

2014-10-19 Thread Rootz
Thanks. On Thursday, October 16, 2014 11:54:45 AM UTC-5, Vijay Khemlani wrote: > > If you are usign class based generic views you can use the decorators in > the URL config of your app, for example > > urlpatterns = patterns('', > (r'^about/', login_required

Re: Generic Views and Django.contrib.auth

2014-10-16 Thread Vijay Khemlani
If you are usign class based generic views you can use the decorators in the URL config of your app, for example urlpatterns = patterns('', (r'^about/', login_required(AboutView.as_view())), ) On Thu, Oct 16, 2014 at 12:49 PM, Rootz <arc4g...@gmail.com> wrote: > Can I use both Gen

Generic Views and Django.contrib.auth

2014-10-16 Thread Rootz
Can I use both Generic View and the Django.contrib.auth features (such as login_required decorator and other auth interface tool)? And if it is not possible to integrate auth into Generic Views then can you recommend alternative way of making the two work together? Adding to this I am using

Re: Django 1.7 tutorial: Use generic views

2014-09-01 Thread Michael Martin
t; - dir(views) >>> >>> What output do you get? i.e, nspect views like the regular python module >>> that it is. >>> >>> >>> On Sat, Aug 30, 2014 at 6:41 PM, Pitchblack <mikemartin...@gmail.com> >>> wrote: >>> >>>

Re: Django 1.7 tutorial: Use generic views

2014-09-01 Thread James Schneider
wrote: >> >>> I need to use Jython instead of Python, I found that jython2.7b2 works >>> with DJango 1.7. So, I am stuck using the beta version. I am trying to >>> follow the current Django tutorial and I have ran into a problem. I am not >>> sure if I am using

Re: Django 1.7 tutorial: Use generic views

2014-09-01 Thread Michael Martin
is. > > > On Sat, Aug 30, 2014 at 6:41 PM, Pitchblack <mikemartin...@gmail.com> > wrote: > >> I need to use Jython instead of Python, I found that jython2.7b2 works >> with DJango 1.7. So, I am stuck using the beta version. I am trying to >> follow the current Django

Re: Django 1.7 tutorial: Use generic views

2014-08-30 Thread Sithembewena Lloyd Dube
, I found that jython2.7b2 works > with DJango 1.7. So, I am stuck using the beta version. I am trying to > follow the current Django tutorial and I have ran into a problem. I am not > sure if I am using generic views properly. When I try to change the urls.py > (polls) file. I see

Django 1.7 tutorial: Use generic views

2014-08-30 Thread Pitchblack
I need to use Jython instead of Python, I found that jython2.7b2 works with DJango 1.7. So, I am stuck using the beta version. I am trying to follow the current Django tutorial and I have ran into a problem. I am not sure if I am using generic views properly. When I try to change the urls.py

Re: hoping for a quick code review of a few simple class-based generic views

2014-05-28 Thread Howard Edson
4 2:43:03 PM UTC-7, Howard Edson wrote: >> >> I am working on a simple "to do list" app in django (two models: List and >> Item). Trying to learn and make use of class-based generic views. I have >> the following three display views working, but am requesting a qu

Re: hoping for a quick code review of a few simple class-based generic views

2014-05-27 Thread Kelvin Wong
(self.request.user) return q K On Tuesday, May 27, 2014 2:43:03 PM UTC-7, Howard Edson wrote: > > I am working on a simple "to do list" app in django (two models: List and > Item). Trying to learn and make use of class-based generic views. I have > the following three

hoping for a quick code review of a few simple class-based generic views

2014-05-27 Thread Howard Edson
I am working on a simple "to do list" app in django (two models: List and Item). Trying to learn and make use of class-based generic views. I have the following three display views working, but am requesting a quick code review to see if there's anything I can do to improve

How to get the right url of models in generic views?

2013-07-25 Thread Floor Tile
#urls.py from .models import Entry from django.conf.urls import patterns, url from django.views.generic.dates import (ArchiveIndexView, YearArchiveView, MonthArchiveView,

[ANN] 'django-smarter' app for declarative style generic views in Django

2013-03-28 Thread Alexey Kinyov
Hello, everyone! I've released 1.0 beta of the app: https://github.com/05bit/django-smarter It helps with adding generic views. Actually, I've build this app for one of my projects, which is 80% based on generic views, and it seemed very useful for that particular case :) As my project evolved

Re: Are Generic Views limited to querysets that are fixed for any one view?

2013-03-22 Thread Doug S
Sorry, I guess I should have looked a bit harder before posting this question, I've figured it out. Hopefully this will be of help to someone else. the discussion here: http://stackoverflow.com/questions/8925434/django-class-based-generic-views-url-variable-passing answers my question. The URL

Are Generic Views limited to querysets that are fixed for any one view?

2013-03-22 Thread Doug S
I'm new to using generic views and the genericness is obviously powerful, but I'm wondering how far it goes. If I have a model and want to display it as a list, I can use a generic view and even specify the query set it displays for a given view, but what if I want to constrain the query set

Re: Generic views and url issues

2013-01-24 Thread amy . cerrito
or: >> NoReverseMatch at /testadcall/1/detail/ >> >> Reverse for 'adcalls' with arguments '()' and keyword arguments '{}' not >> found. >> >> >> >> >> >> On Thu, Jan 24, 2013 at 2:53 AM, <mgc_djan...@chamberlain.net.au> wrote: >&

Re: Generic views and url issues

2013-01-24 Thread Tom Christie
} > {{ form.as_p }} > > > > Back to adcall list > > > Error: > NoReverseMatch at /testadcall/1/detail/ > > Reverse for 'adcalls' with arguments '()' and keyword arguments '{}' not > found. > > > > > > On Thu, Jan 24, 2013 at 2:53 AM, <mgc

Re: Generic views and url issues

2013-01-24 Thread Bill Freeman
t; Error: > NoReverseMatch at /testadcall/1/detail/ > > Reverse for 'adcalls' with arguments '()' and keyword arguments '{}' not > found. > > > > > > On Thu, Jan 24, 2013 at 2:53 AM, <mgc_django-us...@chamberlain.net.au>wrote: > >> On 24/01/2013 10:39 AM, amy.cerr

Re: Generic views and url issues

2013-01-24 Thread Amy Cerrito
3 AM, <mgc_django-us...@chamberlain.net.au>wrote: > On 24/01/2013 10:39 AM, amy.cerr...@cbsinteractive.com wrote: > >> I've been trying to understand how to use generic views. I've followed >> some tutorials, and read through Django docs, but I can't get the url >> funct

Re: Generic views and url issues

2013-01-23 Thread mgc_django-users
On 24/01/2013 10:39 AM, amy.cerr...@cbsinteractive.com wrote: I've been trying to understand how to use generic views. I've followed some tutorials, and read through Django docs, but I can't get the url function to work in my templates. I get the error NoReverseMatch at /testadcall/ Reverse

Re: Generic views and url issues

2013-01-23 Thread Sanjay Bhangar
(reply inline) On Thu, Jan 24, 2013 at 5:09 AM, <amy.cerr...@cbsinteractive.com> wrote: > I've been trying to understand how to use generic views. I've followed some > tutorials, and read through Django docs, but I can't get the url function to > work in my templates. >

Re: Generic views and url issues

2013-01-23 Thread Sergiy Khohlov
try to check testaddcall/1/ please Many thanks, Serge +380 636150445 skype: skhohlov 2013/1/24 <amy.cerr...@cbsinteractive.com>: > I've been trying to understand how to use generic views. I've followed some > tutorials, and read through Django docs, but I can't get the

Generic views and url issues

2013-01-23 Thread amy . cerrito
I've been trying to understand how to use generic views. I've followed some tutorials, and read through Django docs, but I can't get the url function to work in my templates. I get the error NoReverseMatch at /testadcall/ Reverse for 'detail' with arguments '(1,)' and keyword arguments

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-08-16 Thread Jamie Re
I have had to reboot my VM so it recognizes new files, that could have been your problem? -- 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/-/Q3NRvTo_Jr0J. To

Re: Hot to use widgets with generic views

2012-08-14 Thread Tomas Neme
well, for starters, you won't magically get "on keyup" behavior by adding something on your backend, you'll need to use ajax for this, and, depending on your expected number of elements, it might be better to send everything and do any filtering on the client side (if you're handling, say, up to a

Hot to use widgets with generic views

2012-08-14 Thread mjd
This is a general question. Im am using generic views to display all objects in a model. This is working great. However, i want to add text field widget to filter the objects onkeyup. That is, I want the text field to re-render the generic view after applying the text filter in the queryset

Re: Adding more data to Generic Views

2012-08-02 Thread Melvyn Sopacua
On 31-7-2012 22:45, Lachlan Musicman wrote: > Yes, I was doing that originally (when there was no Compensation objects), > but I was struggling with only rendering when a set existed - for example, > in my person_detail.html I was rendering from the wrong direction - via the > non-Person object

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Wed, Aug 1, 2012 at 8:45 AM, Lachlan Musicman wrote: > On Wed, Aug 1, 2012 at 12:43 AM, Melvyn Sopacua wrote: > >> On 31-7-2012 6:17, Lachlan Musicman wrote: >> >> > I have Person, Certificate, Job and Compensation objects. The last three >> > all >>

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
e. > Of course, the other thing that I can't help but thinking is that at this > > point, the non-generic-view method of urls/views might be a simpler way > to > > go. While Generic Views are quite versatile, is there a point at which > > they are considered to restricting? &

Re: Adding more data to Generic Views

2012-07-31 Thread Lachlan Musicman
On Tue, Jul 31, 2012 at 11:15 PM, Karl Sutt wrote: > So, in conclusion, Lachlan, you would want to do something like: > > def get_context_data(self,**kwargs): >> #Call the base implementation first to get a context >> context = super(PersonDetailView,

Re: Adding more data to Generic Views

2012-07-31 Thread Melvyn Sopacua
se-the-template-system> > Of course, the other thing that I can't help but thinking is that at this > point, the non-generic-view method of urls/views might be a simpler way to > go. While Generic Views are quite versatile, is there a point at which > they are considered to restricting?

Re: Adding more data to Generic Views

2012-07-31 Thread Karl Sutt
>> .filter(self.get_id) >> .filter(self.request.get_id) >> .filter(self.person.get_id) >> .filter(self.request.person.**get_id) >> .filter(applicants__get_id__**exact=self.get_id) (in the case of >> Vacancy) etc >> >> How do I filter by the person object

Re: Adding more data to Generic Views

2012-07-31 Thread Per-Olof Åstrand
ilter by the person object that is already in the context? > I know the answer is simple - I should wait until tomorrow when my brain > is > fresher, but I want to finish this off tonight if possible. > > Of course, the other thing that I can't help but thinking is that at this >

Adding more data to Generic Views

2012-07-30 Thread Lachlan Musicman
f possible. Of course, the other thing that I can't help but thinking is that at this point, the non-generic-view method of urls/views might be a simpler way to go. While Generic Views are quite versatile, is there a point at which they are considered to restricting? L. -- You received this message b

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-24 Thread Rob
Sometimes the browser cache is making trouble too. Especially with Firefox I occasionally have this kind of problems. Clear the browser cache, or test with a different browser mostly helps. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-23 Thread Carlos Palol
I'm glad. Not very prone to randomness, actually. Make sure the web server is restarting after your changes, and that the browser cache is not lying to you. Also, if you are changing module (file) names, better delete the .pyc files. Cheers, Carlos Palol On 23 Jul 2012, at 16:11,

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-23 Thread Ricardo Cardoso
Oddly, when i started up the server this morning i could now see the polls correctly, while not having changed my code, by accessing http://127.0.0.1:8000/polls. Don't know if Django is prone to such randomness but am happy that it works now. Tested everything, added a view so that

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-23 Thread Carlos Palol
helpful and got me on my feet but >> while finishing up the tutorial i hit a major snag. While everything was >> working properly using custom views, i can't seem to make my app load the >> correct templates after switching to generic views. >> >> Here's the co

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-22 Thread Ricardo Cardoso
the > correct templates after switching to generic views. > > Here's the code: > > #urls.py > from django.conf.urls import patterns, include, url > from django.views.generic import DetailView, ListView > from polls.models import Poll > > urlpatterns = patterns(''

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-19 Thread Carlos Palol
> > url(r'^$', > ListView.as_view( > queryset=Poll.objects.order_by('-pub_date')[:5], > context_object_name='latest_poll_list', > template_name='polls/index.html')), > > Here you are setting template_name='polls/index.html' > >

Re: Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-19 Thread Sergiy Khohlov
jor snag. While everything was > working properly using custom views, i can't seem to make my app load the > correct templates after switching to generic views. > > Here's the code: > > #urls.py > from django.conf.urls import patterns, include, url > from django.views.gen

Difficulties using generic views (Tutorial 4, Django 1.4)

2012-07-18 Thread Ricardo Cardoso
the correct templates after switching to generic views. Here's the code: #urls.py from django.conf.urls import patterns, include, url from django.views.generic import DetailView, ListView from polls.models import Poll urlpatterns = patterns('', url(r'^$', ListView.as_view

How override RequestContext in generic views?

2012-06-07 Thread Mikhail Golubev
like render or render_to_response cause RequestContext instance is updated with supplied context dictionary inside render_to_string function as 'context_instance.update(dictionary)'. But if I use class based generic views their render_to_response method behaves differently. e.g. I override

Re: Generic views create_object and prefill form data?

2012-05-23 Thread Andre Terra
May 23, 2012 at 5:09 PM Subject: Re: Generic views create_object and prefill form data? To: Django users <django-users@googlegroups.com> Solved it by migrating to the class based generic views, then fed initial form data to the constructor of the form by overloading get_initial on the view

Re: Generic views create_object and prefill form data?

2012-05-23 Thread Paul
Solved it by migrating to the class based generic views, then fed initial form data to the constructor of the form by overloading get_initial on the view class. Paul -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Generic views create_object and prefill form data?

2012-05-19 Thread Paul
I have a model like this: class Website(models.Model): user = models.ForeignKey(User) name = models.CharField(unique=True, max_length=32) And use a generic view to create new items: def website_create(request): return create_update.create_object( request = request,

Re: Generic Views with flair?

2012-05-09 Thread sbrandt
There is another way: Class Based View decorators: http://djangosnippets.org/snippets/2668/ -- 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

Re: Generic Views with flair?

2012-05-07 Thread Daniel Sokolowski
: Lachlan Musicman Sent: Sunday, May 06, 2012 6:57 PM To: Django users Subject: Generic Views with flair? I've happily worked out how to work @login_required for entries in views.py, but since the latest tutorial (which I followed) recommends moving to the Generic Views my code is now like

Generic Views with flair?

2012-05-06 Thread Lachlan Musicman
I've happily worked out how to work @login_required for entries in views.py, but since the latest tutorial (which I followed) recommends moving to the Generic Views my code is now like this: urls.py ... url(r'^people/$', ListView.as_view( queryset

Re: Why using Generic Views?

2012-04-07 Thread Phang Mulianto
HI, i understand why need to use generic views after i code some of my function like showing list of data, and the view is the same and i end up copy paste it , not type it (smarter huh?) , just change my db object and pass to my template. well , generic view is come in the rescue and we can

Re: Django Contrib Auth + Class Based Generic Views

2012-04-05 Thread Sergiy Khohlov
As I understand you would like to send some values to the templates ? Are you eould like to check if user is authenticated ? I 've understand near to nothing from your last message. 2012/4/5 Matheus Ashton : > Ok, Thanks for the advices :) but I still have the original

Re: Django Contrib Auth + Class Based Generic Views

2012-04-04 Thread Matheus Ashton
Ok, Thanks for the advices :) but I still have the original problem, when i access the HomeView the template is rendered with a render_to_response view, with a simple Context object and not a RequestContext object, because of that I do not have the authenticated user data in my template...

Re: Why using Generic Views?

2012-04-04 Thread Dan Gentry
I use generic views - either function or class based - for the common functionality in my apps. As Serge mentioned, a list works pretty much the same in every application, so I just provide a few parameters to a generic view. More complicated forms still require custom code. On Apr 3, 1:07 am

Re: Django Contrib Auth + Class Based Generic Views

2012-04-04 Thread Sergiy Khohlov
Sound good! Usually project is not so simple (only url.py + settings.py) 2012/4/4 Javier Guerra Giraldez : > On Wed, Apr 4, 2012 at 4:14 AM, Sergiy Khohlov wrote: >> As result  your views.py should be : >> >> from django.views.generic import TemplateView

Re: Django Contrib Auth + Class Based Generic Views

2012-04-04 Thread Javier Guerra Giraldez
On Wed, Apr 4, 2012 at 4:14 AM, Sergiy Khohlov wrote: > As result  your views.py should be : > > from django.views.generic import TemplateView > # Create your views here. > class HomeView(TemplateView): >    template_name='home.html' > >  Only three lines of the code ! > You

Re: Django Contrib Auth + Class Based Generic Views

2012-04-04 Thread Sergiy Khohlov
>   def __init__(self, value): >     self.value = value > >   def __str__(self): >     return repr(self.value) > > > Thanks again :) > > 2012/4/3 Sergiy Khohlov <skhoh...@gmail.com> >> >> Please provide your urls.py  and  your view which is used for this

Re: Django Contrib Auth + Class Based Generic Views

2012-04-03 Thread Matheus Ashton
> Hello Everybody, > > > > I'm having a problem using the django.contrib.auth app and class based > > generic views in Django 1.3 / 1.4: > > > > After submitting the login form, my view receives the post data and > tries to > > authenticate the user and then redirect to

Re: Django Contrib Auth + Class Based Generic Views

2012-04-03 Thread Sergiy Khohlov
Please provide your urls.py and your view which is used for this 2012/4/3 Matheus Ashton <matheusash...@gmail.com>: > Hello Everybody, > > I'm having a problem using the django.contrib.auth app and class based > generic views in Django 1.3 / 1.4: > > After submi

Re: Why using Generic Views?

2012-04-03 Thread Sergiy Khohlov
Generic views helps to avoid writting some part of the trivial code. For example : you are writing a shop with goods and a lot of the pages contains list of the items. You should about sorting orders, page selecting etc. If you are using generic views then you might not spend time

Why using Generic Views?

2012-04-03 Thread abisson
Good evening, I just finished the Django 1.4 Tutorial, and I really don't understand the point of Generic Views in Django? As far as I can see, we wrote more code than before, and what other example would make the Generic Views better than normal views? Thanks for the clarifications! -- You

Django Contrib Auth + Class Based Generic Views

2012-04-02 Thread Matheus Ashton
Hello Everybody, I'm having a problem using the django.contrib.auth app and class based generic views in Django 1.3 / 1.4: After submitting the login form, my view receives the post data and tries to authenticate the user and then redirect to a success page. Ok nothing new.. The problem

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-27 Thread alej0
it self.object but is a good practice, is how other class-based generic views work self.object is None because you are usin a CreateView, so there is no object to work with until you save the form and get the corresponding instance. -- You received this message because you are subscribed

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-13 Thread Juergen Schackmann
you made my day, working exactly like expected. :-) thanks a lot -- 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/-/RUSugDsY9K0J. To post to this group, send

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-12 Thread Alasdair Nicol
On 11/01/12 20:54, Juergen Schackmann wrote: if is use this code, as proposed by russ: def form_valid(self, form): self.object.user = ... (something meaningful.. e.g., self.request.user) return super(CreateCampaignView, self).form_valid(form) i get the error 'NoneType'

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-12 Thread Juergen Schackmann
I am trying to do the same as described in previous example: I have a model with a foreign key field to User and in the view I want to populate the the field from request.user. And when doing it exactly the way as Russ proposed, I get the described error. -- You received this message because

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-12 Thread Andres Reyes
What are you triying to achieve? 2012/1/12 Juergen Schackmann : > can really no one help? i am really stuck here at the moment > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To view this discussion on

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-12 Thread Juergen Schackmann
can really no one help? i am really stuck here at the moment -- 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/-/RYLQqxJE7HYJ. To post to this group, send

Re: Class-Based Generic Views (CreateView) - field exclusions and defaults

2012-01-11 Thread Juergen Schackmann
if is use this code, as proposed by russ: def form_valid(self, form): self.object.user = ... (something meaningful.. e.g., self.request.user) return super(CreateCampaignView, self).form_valid(form) i get the error 'NoneType' object has no attribute 'user'. and actually, by

Re: Generic views parameter 'extra_context' didn't use form class?

2011-12-23 Thread Andre Terra
il.com> > hi, I use a form class in Generic views 'list_detail.object_list' para > 'extra_context ' > > > form > > > class DevSrcForm(forms.Form): > > f_eqno = forms.CharField(label='编号') > > f_eqclass = > forms.ChoiceField(choices=(),widget

Generic views parameter 'extra_context' didn't use form class?

2011-12-22 Thread 郁夫
hi, I use a form class in Generic views 'list_detail.object_list' para 'extra_context ' form > class DevSrcForm(forms.Form): > f_eqno = forms.CharField(label='编号') > f_eqclass = forms.ChoiceField(choices=(),widget=forms.Select(attrs={}),label='分类') > f_ipaddress = for

Radio Choices and Generic Views

2011-11-20 Thread CrabbyPete
I use the following code that I got from a django snippet, which works great if you want to have radio buttons with different types of fields associated with them from django import forms from django.utils.encoding import

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-15 Thread Reinout van Rees
On 13-10-11 23:57, Andriyko wrote: class Article(models.Model): .. # with django 1.2 was @models.permalink def get_absolute_url(self): return ('article_detail', (), { 'year': self.pub_date.strftime("%Y"), 'month':

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-14 Thread Andriyko
ndfor %} 11 12 {% endblock %} 13 {% block column2 %}Last article here{% endblock %} Could you please give an example about how to use get_absolute_url with class based generic views? On Oct 14, 1:31 pm, Fabrizio Mancini <mr.f...@gmail.com> wrote: > On 13 October 2011 23:57, Andriyk

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-14 Thread Andriyko
10 {% endfor %} 11 12 {% endblock %} 13 {% block column2 %}Last article here{% endblock %} Could you please give an example about how to use get_absolute_url with class based generic views? On Oct 14, 1:31 pm, Fabrizio Mancini <mr.f...@gmail.com> wrote: > On 13 October

Re: django 1.3: how to use get_abolute_url in class based generic views

2011-10-14 Thread Fabrizio Mancini
On 13 October 2011 23:57, Andriyko wrote: > urlpatterns = patterns('django.views.generic.dates', > (r'^(?P\d{4})/v/(?P\d{2})/(?P[-\w]+)/ > $', DateDetailView.as_view(template_name='blog/article_detail.html', > **entry_info_dict)), > ) > Hi, You are using (?P\w{3}) but in

  1   2   3   4   5   6   7   8   >