Re: How to effectively use PUT and DELETE HTTP methods in Django Class-Based Views?

2024-04-12 Thread Luis Zárate
: > See > https://docs.djangoproject.com/en/5.0/topics/class-based-views/#supporting-other-http-methods > Also on view you have a variable called, where you can limit the available > methods. > > http_method_names > > > El vie, 12 abr 2024 a las 7:20, Mamadou Alp

Re: How to effectively use PUT and DELETE HTTP methods in Django Class-Based Views?

2024-04-12 Thread Luis Zárate
See https://docs.djangoproject.com/en/5.0/topics/class-based-views/#supporting-other-http-methods Also on view you have a variable called, where you can limit the available methods. http_method_names El vie, 12 abr 2024 a las 7:20, Mamadou Alpha Bah (< mamadoualphabah...@gmail.com>) es

How to effectively use PUT and DELETE HTTP methods in Django Class-Based Views?

2024-04-12 Thread Mamadou Alpha Bah
<https://stackoverflow.com/posts/78314829/timeline> I'm setting up a CRUD system with Django, using Class-Based Views. Currently I'm trying to figure out how to handle HTTP PUT and DELETE requests in my application. Despite searching the Django documentation extensively, I&

Re: Beginner: How to find fields that can be over-ridden in a Generic Class Based Views

2023-04-11 Thread PULKIT AGRAWAL
6:14 PM PULKIT AGRAWAL wrote: > >> Hello Everyone, >> >> I am very new to Django and am still learning the ropes. If anyone can >> point me in the right direction, I will be thankful to you. >> >> My problems is as follows: >> 1. I have learned about

Re: Beginner: How to find fields that can be over-ridden in a Generic Class Based Views

2023-04-11 Thread Sebastian Jung
My problems is as follows: > 1. I have learned about class based views and have started using them > 2. But every now and then I come across a new field that could have been > overwritten in the class based view to shorted the code > 3. Is there a way to identify all the fields that ca

Re: Beginner: How to find fields that can be over-ridden in a Generic Class Based Views

2023-04-11 Thread Chetan Ganji
you. > > My problems is as follows: > 1. I have learned about class based views and have started using them > 2. But every now and then I come across a new field that could have been > overwritten in the class based view to shorted the code > 3. Is there a way to identify all the f

Beginner: How to find fields that can be over-ridden in a Generic Class Based Views

2023-04-11 Thread PULKIT AGRAWAL
Hello Everyone, I am very new to Django and am still learning the ropes. If anyone can point me in the right direction, I will be thankful to you. My problems is as follows: 1. I have learned about class based views and have started using them 2. But every now and then I come across a new field

Re: Function-based Views vs Class-based Views

2023-03-06 Thread Carsten Fuchs
I would like to recommend this excellent guide by Luke Plant: https://spookylukey.github.io/django-views-the-right-way/ Best regards, Carsten Am 06.03.23 um 21:19 schrieb Michael Starr: > What are the pros and cons of either method of rendering HTTP request > responses? > > https://ww

Re: Function-based Views vs Class-based Views

2023-03-06 Thread Prosper Lekia
Using classes is always a good way of promoting code usability, and inheritance. With class base views you don't need to reinvent the wheel. You can access other Django classes and methods and reduce code complexity. Although most codes are encapsulated, but you can always go back to the Djang

Function-based Views vs Class-based Views

2023-03-06 Thread Michael Starr
What are the pros and cons of either method of rendering HTTP request responses? https://www.geeksforgeeks.org/class-based-vs-function-based-views-which-one-is-better-to-use-in-django/ In the article above it states that CBVs are DRYer, but I don't understand why. The article doesn't explain, i

Re: Class based views with forms

2022-04-28 Thread Vishesh Mangla
il.html' > > form_class = forms.ContactForm > > success_url = 'tours.html' > > > > As far as i understand i need to get data from request , but i dont > > know how to do it. There are a lot of information in function based > > views, but i

Re: Class based views with forms

2022-04-28 Thread Ryan Nowakowski
#x27;     form_class = forms.ContactForm     success_url = 'tours.html' As far as i understand i need to get data from request , but i dont know how to do it. There are a lot of information in function based views, but i didnt get how to do it in class based views. And it would be nice of you

Class based views with forms

2022-04-26 Thread alex smolyakov
request , but i dont know how to do it. There are a lot of information in function based views, but i didnt get how to do it in class based views. And it would be nice of you to explain where should i put send_mail function. Any help will be appreciated. -- You received this message because y

Re: CELERY CLASS BASED VIEWS

2022-03-08 Thread John Dollosa
I think this might help https://docs.celeryproject.org/en/stable/userguide/tasks.html#task-custom-classes Let me know if this works, if not I will try to find a working example. I have been using Celery but I don't do class based tasks. On Tuesday, 8 March 2022 at 16:30:01 UTC+8 aadil1...@gmail.

CELERY CLASS BASED VIEWS

2022-03-08 Thread Aadil Rashid
i am using celery version 5.2.3, How can i register this class based task, and how can we name add name to this class based task, I would appreciate your valuable suggestions Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

How to display class based views

2022-02-18 Thread Wilford Chidawanyika
Good day, Trust you are all well i have written my models and they are working very well. l am struggling to create a class based view which will diplay on the client dashboard side so that he can enter data on a form please i need help you can app on +27 66 3838 041 With thanks Wilford --

Re: Handling url in class based views.

2021-11-20 Thread Lalit Suthar
you can get that slug value from kwargs def get(self, request, *args, **kwargs): slug = self.kwargs.get("slug") also if you like to pass it in the context you can override get_context_data refer: https://ccbv.co.uk/ to know more about class based views you can refer to thi

Re: Handling url in class based views.

2021-11-19 Thread Perry Bates
You can use the DetailListView from generic views. Pass in the template name, form class, and query(which in this case takes in the slug to query the db) On Mon, Nov 15, 2021, 21:27 Aadil Rashid wrote: > Hello my dear Friends, I have a question regarding Class Based Views. > > If we h

Re: Handling url in class based views.

2021-11-15 Thread Aadil Rashid
lug) : >>>#logic >>>return render(request, "tempName") >>> >>> >>> We can even pass this slug as a context in this template, >>> >>> >>> My question is how can we achieve this by using class Based Views.

Re: Handling url in class based views.

2021-11-15 Thread pankaj palmate
Also request in def get itself On Tue, 16 Nov, 2021, 9:40 am pankaj palmate, wrote: > def get(self, pk, *args,**kwargs ) : > ...body.. > > On Tue, 16 Nov, 2021, 2:57 am Aadil Rashid, > wrote: > >> Hello my dear Friends, I have a question reg

Re: Handling url in class based views.

2021-11-15 Thread pankaj palmate
def get(self, pk, *args,**kwargs ) : ...body.. On Tue, 16 Nov, 2021, 2:57 am Aadil Rashid, wrote: > Hello my dear Friends, I have a question regarding Class Based Views. > > If we have a url e.g, > path('item//', views.funView) > > We can handle

Handling url in class based views.

2021-11-15 Thread Aadil Rashid
Hello my dear Friends, I have a question regarding Class Based Views. If we have a url e.g, path('item//', views.funView) We can handle it in Function Based Views, By simply def funView(request, slug) : #logic return render(request, "tempName") We can even

Re: Good Django libraries to read to really understand class-based views?

2021-01-12 Thread Robert F.
yond that supports more specific use cases that usually > simplifies handling the request - i.e. templates - and each of those > provides its own set of patterns. > > HTH, > /d > > > On 12 January 2021 at 02:15:11, Robert F. (robert....@gmail.com) wrote: > > Are there

Re: Good Django libraries to read to really understand class-based views?

2021-01-12 Thread David Nugent
t;) wrote: Are there any Django libraries that make extensive use of class-based views that I might study if I want to gain an in-depth understanding of how to use them? The Django documentation is OK at explaining what they are and how they work but most of the examples are very trivial in natur

Re: Good Django libraries to read to really understand class-based views?

2021-01-12 Thread Benjamin Schollnick
> I recommend you consider > https://spookylukey.github.io/django-views-the-right-way/ I second this, I’m going through this right now, and it’s very useful information regarding Class Based views vs Function Based views… It’s making me consider rewriting Quickbbs/Gallery again, with

Re: Good Django libraries to read to really understand class-based views?

2021-01-12 Thread Carsten Fuchs
Dear Robert, I recommend you consider https://spookylukey.github.io/django-views-the-right-way/ Best regards, Carsten Am 11.01.21 um 16:14 schrieb Robert F.: > Are there any Django libraries that make extensive use of class-based views > that I might study if I want to gain an in

Re: Good Django libraries to read to really understand class-based views?

2021-01-11 Thread Arisophy
Hello Robert. Did you read class based views code? Original django class-based view code is below. https://github.com/django/django/tree/master/django/views/generic I made an extension class for FormView and ListView. https://github.com/Arisophy/django-searchview I hope it helps you

Good Django libraries to read to really understand class-based views?

2021-01-11 Thread Robert F.
Are there any Django libraries that make extensive use of class-based views that I might study if I want to gain an in-depth understanding of how to use them? The Django documentation is OK at explaining what they are and how they work but most of the examples are very trivial in nature. I&#

Re: Class based views vs methods

2020-03-04 Thread guettli
Thank you for this hint. Am Montag, 2. März 2020 23:04:38 UTC+1 schrieb Ernest Thuku: > > first I can advice you to learn the function based views. They will give > you a good foundation of how views work and after that switch to Class > Based Views(they are magical and easy to use)

Re: Class based views vs methods

2020-03-02 Thread Ernest Thuku
first I can advice you to learn the function based views. They will give you a good foundation of how views work and after that switch to Class Based Views(they are magical and easy to use). On Tue, Mar 3, 2020 at 12:59 AM guettli wrote: > The django tutorial starts with method based vi

Class based views vs methods

2020-03-02 Thread guettli
The django tutorial starts with method based views. What is the state of the art? If I am unsure: Do you suggest to use class-based or method-based views? Regards, Thomas -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from t

Re: How to load an instance in class based views using form_valid

2020-01-12 Thread Integr@te System
Hi Sam, How about your app namespace definition and url you defined, bc of using reverse(). Plz take a look in link for more info: https://docs.djangoproject.com/en/3.0/topics/http/urls/#topics-http-reversing-url-namespaces On Mon, Jan 13, 2020, 03:35 Sam Hefer wrote: > 0 > > I'm trying to

How to load an instance in class based views using form_valid

2020-01-12 Thread Sam Hefer
0 I'm trying to build a form that automatically fills some fields in a class based create view that lets logged in users create a Job. However, I can't seem to find the correct way of doing this for fields that aren't the user (eg. request.user). So the create view is trying to get a company_n

Re: username on URL with Class Based Views

2018-09-13 Thread Ricardo Cataldi
Nice! Thanks a lot! On Thu, Sep 13, 2018 at 8:45 AM Jason wrote: > return redirect('settings:profile') > > > The issue is this. you're telling Django to hit up that URL, but you > don't specify the username for that. > > Something like this would be required: return > redirect('settings:profil

Re: username on URL with Class Based Views

2018-09-13 Thread Jason
return redirect('settings:profile') The issue is this. you're telling Django to hit up that URL, but you don't specify the username for that. Something like this would be required: return redirect('settings:profile', args=(username,)) -- You received this message because you are subscrib

Re: username on URL with Class Based Views

2018-09-12 Thread Gear Crew
w. > I have writen a class based views based on generic.base.view to get > information about users profiles, that are comming from different models > and db tables, that will be applied both in viewing some user information > on a social network and by the own user on edditing his

Different behavior in ListVIew Vs CreateView (class based views )

2018-06-14 Thread kanishk tanwar
class SchoolListView(ListView): template_name = 'app/List.html' context_object_name = 'schools' model = models.School # i have this first class here i don't need to define attribute like # ListView.model and ListView.template_name etc # But---> in CreateView its a totally di

Re: Class Based Views : filter items by users

2017-07-07 Thread Nabil BOUDERBALA
Thank you, I have updated the template accordingly. Regardin the views, I solved the issue through the function below : def itemuserfunc(request, user): template = get_template('dcf/user_item_list_noedit.html') profile_owner = DcfUser.objects.filter(username=user) # Assuming you have ent

Re: Class Based Views : filter items by users

2017-07-06 Thread Melvyn Sopacua
Please show all relevant bits of the code (user_list is not part handed off to the template). But you could start but not naming 2 different variables inside eachother's scope identical. On Tuesday 04 July 2017 09:36:51 Nabil BOUDERBALA wrote: > {% if user %} > {% for user

Class Based Views : filter items by users

2017-07-04 Thread Nabil BOUDERBALA
As you can see from my template below, i have a list of users who posted items and I would like to get the list of items for each user. However, using the view below I only get the list for the current logged user. How can I modify my views.py so that it filters items for each one of the list

Re: How to login different user each on different pages using class based views

2017-02-14 Thread ludovic coues
2017-02-14 12:00 GMT+01:00 JJEMBA KENNETH : > Hello guys, > I started using django a month back and I have been using class based views. > they are pretty good. Then am wondering how i can use them to implement > different categories of user where each is redirected to a different page.

How to login different user each on different pages using class based views

2017-02-14 Thread JJEMBA KENNETH
Hello guys, I started using django a month back and I have been using class based views. they are pretty good. Then am wondering how i can use them to implement different categories of user where each is redirected to a different page. Can anyone please help me with that. -- Jjemba Kenneth

Re: Class Based Views VS DRY principle

2016-11-04 Thread Artem Bernatskyy
TNX On Friday, November 4, 2016 at 5:56:56 PM UTC+2, Artem Bernatskyy wrote: > > Hello. > > Suppose i have a code (http://pastebin.com/6rUqKD8q) > > And in CBV there are a bunch of methods with EXACTLY the same code. > > My question is - can i somehow inherit them from ONE place, in order to be >

RE: Class Based Views VS DRY principle

2016-11-04 Thread Matthew Pava
[mailto:django-users@googlegroups.com] On Behalf Of Artem Bernatskyy Sent: Friday, November 4, 2016 10:56 AM To: Django users Subject: Class Based Views VS DRY principle Hello. Suppose i have a code (http://pastebin.com/6rUqKD8q) And in CBV there are a bunch of methods with EXACTLY the same code. My

Class Based Views VS DRY principle

2016-11-04 Thread Artem Bernatskyy
Hello. Suppose i have a code (http://pastebin.com/6rUqKD8q) And in CBV there are a bunch of methods with EXACTLY the same code. My question is - can i somehow inherit them from ONE place, in order to be able to edit them from one place ? Thanks for replies. -- You received this message becau

Re: Django Class-based Views with Multiple Forms

2016-07-11 Thread Edgar Gabaldi
Hi paul. There is a package called django-extra-views that solve exactly this problem. See CreateViewWithInlines (or something like that). Em 7h40 Seg, 11/07/2016, Paul escreveu: > By default Django’s class-based views support just a single form per view. > > I need more forms per vie

Django Class-based Views with Multiple Forms

2016-07-11 Thread Paul
By default Django’s class-based views support just a single form per view. I need more forms per view because I want to combine a ForeignKey relations with various ModelForm instances and also to appear in the FormModel. In Django documentation and other tutorials I found formsets, but in the

localized_fields in class-based views?

2016-02-25 Thread setivolkylany
How include localized_fields in class-based views? -- 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 django-users+unsubscr...@googlegroups.com. To po

How right will working Ajax and Class-Based views?

2016-02-25 Thread setivolkylany
. -- 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 django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com.

Re: How can you use the @cache_page decorator with Django class based views?

2015-11-14 Thread Simon Charette
Hi Daniels, There's a tentative API being worked on Github. You might want to have a look at it . Simon Le samedi 14 novembre 2015 13:38:18 UTC-5, daniels a écrit : > > The only method that seems to be working is adding the decorator in > urls.py whi

How can you use the @cache_page decorator with Django class based views?

2015-11-14 Thread daniels
The only method that seems to be working is adding the decorator in urls.py which is ugly. Is there any way to apply this decorator in the view? class HomeView(View): @method_decorator(cache_page(60 * 60)) def dispatch(self, *args, **kwargs): return super(HomeView, self).dispat

Re: dhango class based views - Saving post data

2015-06-03 Thread Shekar Tippur
Thant worked. Thanks a lot James. - Shekar On Wednesday, 3 June 2015 11:13:41 UTC-7, James Schneider wrote: > > So you don't have any control over the API call? Ok then, you can update > your serializer to take a string representing a symbol and grab the correct > address object, or throw an er

Re: dhango class based views - Saving post data

2015-06-03 Thread James Schneider
So you don't have any control over the API call? Ok then, you can update your serializer to take a string representing a symbol and grab the correct address object, or throw an error if it doesn't exist: http://www.django-rest-framework.org/api-guide/serializers/#validation class UserPrefSerializ

Re: dhango class based views - Saving post data

2015-06-03 Thread Shekar Tippur
> > James, > My apologies. stock_id came in as a artefact of a bad copy/paste. The only deviation from what you have said is that the api call comes with a address string and not a id. But your solution works perfectly well as well. Here are the right ones: serializer=UserPrefSerializer(data=r

Re: dhango class based views - Saving post data

2015-06-03 Thread James Schneider
Whoa...where'd Stock come from? :-D First off, the line where you create user_obj isn't needed. The user object in request.user is already the populated User object. You can either use request.user directly, or you could do user_obj = request.user. Secondly, I don't think this is working the way

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
James, I was able to get thro with the save operation. It was quite a bit of learning. Meta section on the model existed but I was not populating validated_data properly. I was under the assumption that when I did serializer=UserPrefSerializer(data=request.data) seriazer object will be popu

Re: dhango class based views - Saving post data

2015-06-02 Thread James Schneider
No, it looks like you need to set a model in the Meta class as part of your ModelSerializer class. http://www.django-rest-framework.org/api-guide/serializers/#modelserializer Is "XYZ" a valid slug to retrieve that Address object? You probably need to provide the PK value for the 'address' rather

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
James. address table already has a record of name xyz. Request object has a address value of address: xyz. As I am initializing serialize with request.data, why is it that I don't see it in validated_data? Do I need to add address_id to validated_data in my view? -- You received this message

Re: dhango class based views - Saving post data

2015-06-02 Thread James Schneider
The 'address' field is an FK to the Address model (hence the reference to 'address_id'), and you'll either need to 1) add null=True to the address field definition in UserPrefs and update your migrations and allow a UserPref model to not be connected to an Address model, 2) find the right Address m

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
Here is my view. request.data has the 2 fields I am passing however serializer.validated_data has only prefs. class AddToUserProfile(generics.CreateAPIView): permission_classes = (permissions.IsAuthenticatedOrReadOnly,IsOwnerOrReadOnly) serializer_class = UserPrefSerializer querys

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
James, You are right. I am able to get past that issue. The next stumbling block is with null value in column "address_id" violates not-null constraint DETAIL: Failing row contains (10, Likes, null, null). Here is my curl curl -H "Authorization: Bearer $usertoken" -H "Content-Type: applicati

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
Here is my serializer class UserPrefSerializer(serializers.ModelSerializer): #user = serializers.ReadOnlyField(source='owner.username') def create(self, validated_data): print ("Validated data") print (validated_data) #return Screens.objects.create(**validated_data)

Re: dhango class based views - Saving post data

2015-06-02 Thread James Schneider
Wait, what does your serializer look like? I found this in the traceback: ile "/Users//PycharmProjects///modelserializer.py" in create 48. return Screens.objects.create(**validated_data) Are you sure that you are referencing the right serializer and/or is the serializer referencing the

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
James, I have commented save in model code. I have also changed the prefs field to be char(20) for now. I still get 'prefs' is an invalid keyword argument for this function - Shekar -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsu

Re: dhango class based views - Saving post data

2015-06-02 Thread James Schneider
I just looked over your model again. Your save() override has a super(Screens,...) reference, which doesn't match the model class. That may explain why you are getting the invalid parameters error, since you are probably calling the wrong save function from a different class. I'd remove that save

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
Just to add, if I use a curl request curl -H "Authorization: Bearer $usertoken" -H "Content-Type: application/json" -X POST -d '{"user":"foo1","stock":"XYZ","prefs":"Likes"}' http://${endpoint}/addPrefs I get a error: {"prefs":["\"Likes\" is not a valid choice."]} If I use curl -H "Authori

Re: dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
Here is the trace: Traceback: File "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/Library/Frameworks/Pytho

Re: dhango class based views - Saving post data

2015-06-02 Thread James Schneider
Can you post the entire traceback for the error, and the view code as well? -James On Jun 2, 2015 12:47 AM, "Shekar Tippur" wrote: > Hello, > > I am trying to save post data and I get a error. I am trying to use enum > field. > > prefs' is an invalid keyword argument for this function > > Reques

dhango class based views - Saving post data

2015-06-02 Thread Shekar Tippur
Hello, I am trying to save post data and I get a error. I am trying to use enum field. prefs' is an invalid keyword argument for this function Request Method:POSTRequest URL:http://127.0.0.1:8000/setPrefs/Django Version:1.8.2Exception Type:TypeError Here is my model class UserPrefs(models.Mo

Re: csrf_exempt decorator and class based views

2015-04-15 Thread Andreas Kuhne
, check: https://docs.djangoproject.com/en/1.8/topics/class-based-views/intro/#decorating-the-class. There you can see howto use a decorator on one method in the class only. If you used the View class, your "SpecificHandler" should look something like this: from django.views.decorators.c

Re: csrf_exempt decorator and class based views

2015-04-15 Thread Kishor Pawar
Hey Casey, I followed this doc, but still I am not getting this working. Do I need to do anything else to get it work? On Tuesday, 8 March 2011 19:11:32 UTC+5:30, Casey wrote: > > Have you seen this yet: > > > http://docs.djangoproject.com/en/dev/topics/class-based-views/#decorat

Re: Using class based views.

2015-02-24 Thread Javier Guerra Giraldez
On Tue, Feb 24, 2015 at 1:51 AM, James Schneider wrote: > However, if you have working view functions, what is the"need" to switch to > CBV's? this. the switch to CBV, wasn't "modern Django views are classes instead of functions; Get rid of your functions!, FBV are dead!". Instead it's just t

Re: Using class based views.

2015-02-23 Thread James Schneider
unction_1(request): #Some code return HttpResponse(--) def my_view_function_2(request): #Some code return HttpResponse(--) def my_view_function_3(request): #Some code return HttpResponse(--) Some of them are POST requests and some of them are GET. I need

Using class based views.

2015-02-23 Thread Ajay M
quest): #Some code return HttpResponse(--) Some of them are POST requests and some of them are GET. I need to switch to class based views. Is there any ways to include multiple GET requests and POST requests in class based views? -- You received this message because you are subscribed t

Re: Class Based Views tutorials

2015-01-06 Thread Lachlan Musicman
January 2015 at 00:49, Brad Rice wrote: > Does anyone have a recommendation for intermediate reading to understand > Class Based Views? It seems most of the Django books were written when > function based views were prevalent. I'm still having trouble understanding > what the

Re: Class Based Views tutorials

2015-01-06 Thread Sergiy Khohlov
> I have few simpleast class for your request. But I have not commented yet. >> >> Many thanks, >> >> Serge >> >> >> +380 636150445 >> skype: skhohlov >> >> On Tue, Jan 6, 2015 at 3:49 PM, Brad Rice wrote: >>> >>> Does an

Class Based Views tutorials

2015-01-06 Thread Jim Wombles
Two Scoops of Django is definitely the book you are looking for. I don't know if it's out for 1.7 yet, but I purchased the book for Django 1.6 and it covers l of the best practices that you won't read about just from the Django docs. -- You received this message because you are subscribed to t

Re: Class Based Views tutorials

2015-01-06 Thread Brad Rice
hlov > > On Tue, Jan 6, 2015 at 3:49 PM, Brad Rice > > wrote: > >> Does anyone have a recommendation for intermediate reading to understand >> Class Based Views? It seems most of the Django books were written when >> function based views were prevalent. I&#

Re: Class Based Views tutorials

2015-01-06 Thread Sergiy Khohlov
wrote: > Does anyone have a recommendation for intermediate reading to understand > Class Based Views? It seems most of the Django books were written when > function based views were prevalent. I'm still having trouble understanding > what the differences are between CreateView and Up

Class Based Views tutorials

2015-01-06 Thread Brad Rice
Does anyone have a recommendation for intermediate reading to understand Class Based Views? It seems most of the Django books were written when function based views were prevalent. I'm still having trouble understanding what the differences are between CreateView and UpdateView and what Me

Re: Redirect user inside Class-Based views

2014-12-03 Thread Rootz
2, 2014 4:10:40 PM UTC+1, Rootz wrote: >> >> thanks >> >> On Tuesday, December 2, 2014 9:22:32 AM UTC-5, Andréas Kühne wrote: >>> >>> 2014-12-02 15:17 GMT+01:00 Rootz : >>> >>>> I have a small Django App using several Class-Based Vi

Re: Redirect user inside Class-Based views

2014-12-03 Thread pjotr
Kühne wrote: >> >> 2014-12-02 15:17 GMT+01:00 Rootz : >> >>> I have a small Django App using several Class-Based Views but I am >>> contemplating how the class views would redirect a user based upon a >>> condition? In my case I would like to redir

Re: Redirect user inside Class-Based views

2014-12-02 Thread Rootz
thanks On Tuesday, December 2, 2014 9:22:32 AM UTC-5, Andréas Kühne wrote: > > 2014-12-02 15:17 GMT+01:00 Rootz >: > >> I have a small Django App using several Class-Based Views but I am >> contemplating how the class views would redirect a user based upon a >>

Re: Redirect user inside Class-Based views

2014-12-02 Thread Andreas Kuhne
2014-12-02 15:17 GMT+01:00 Rootz : > I have a small Django App using several Class-Based Views but I am > contemplating how the class views would redirect a user based upon a > condition? In my case I would like to redirect user who are not > authenticated. Just how do I go abou

Redirect user inside Class-Based views

2014-12-02 Thread Rootz
I have a small Django App using several Class-Based Views but I am contemplating how the class views would redirect a user based upon a condition? In my case I would like to redirect user who are not authenticated. Just how do I go about doing that? thanks -- You received this message

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Aliane Abdelouahab
you can make for example a custom template that you call inside the except. Le lundi 3 novembre 2014 19:59:33 UTC+1, Daniel Grace a écrit : > > Thanks for the information Aliane and Steven, although I still don't know > what to do when handling exceptions in say form_valid of a CBV. How to > re

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Daniel Grace
Thanks for the information Aliane and Steven, although I still don't know what to do when handling exceptions in say form_valid of a CBV. How to render the error in this case? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe fro

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Steven Cummings
tion? > > try: > context = RequestContext(request) > context_dict = {} > ... > return render_to_response('my_file.html', context_dict, context) > except Exception as e: > # what to do here? > > What about class based views (in form_valid etc)

Re: How to generally handle exceptions in function based and class based views?

2014-11-03 Thread Daniel Grace
OK, say if I have a function based view then how do I handle the exception? try: context = RequestContext(request) context_dict = {} ... return render_to_response('my_file.html', context_dict, context) except Exception as e: # what to do here? What about class based

Re: How to generally handle exceptions in function based and class based views?

2014-11-02 Thread Aliane Abdelouahab
why not using the classic try except ? since it is a normal python? Le dimanche 2 novembre 2014 18:18:11 UTC+1, Daniel Grace a écrit : > > Hi, I'm looking for some information / examples of how to generally handle > exceptions and show a message to the user, in function based and

How to generally handle exceptions in function based and class based views?

2014-11-02 Thread Daniel Grace
Hi, I'm looking for some information / examples of how to generally handle exceptions and show a message to the user, in function based and class based views. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Problems with class based views

2014-08-23 Thread Andreas Kuhne
Hi again, I found what the problem was. I had errors in the template that the internal view was using. Therefore django used the default template. Strange but at least understandable behaviour. Regards, Andréas Med vänliga hälsningar, Andréas Kühne Software Development Manager Suitopia Scandin

Problems with class based views

2014-08-23 Thread Andreas Kuhne
Hi all, I am working on rewrite of our website with the latest version of django and Python 3. I have had alot of strange things occuring because we are using Python 3, however today I had the first problem with django. I would like to know if this is per design or if I have done something wrong.

Re: Digging Up Django Class-based Views

2014-02-18 Thread alois . guillope
Ok thanks! On Friday, February 14, 2014 2:11:43 PM UTC+1, Leo wrote: > > Hi all, > > the third issue of the small series "Digging Up Django Class-based Views" > is out. > This latest post is about form views. > > You find the whole series here > > ht

Re: Digging Up Django Class-based Views

2014-02-18 Thread Tom Evans
On Tue, Feb 18, 2014 at 11:03 AM, wrote: > Seems great ! I am looking forward reading it. > > I have a question about class-based views (hope it's clear enough) : > I wanted to know when the views are instanciated and when there are garbage > collected In Django. The clas

Re: Digging Up Django Class-based Views

2014-02-18 Thread alois . guillope
Seems great ! I am looking forward reading it. I have a question about class-based views (hope it's clear enough) : I wanted to know when the views are instanciated and when there are garbage collected In Django. Thanks, Alois On Friday, February 14, 2014 2:11:43 PM UTC+1, Leo

Re: Digging Up Django Class-based Views

2014-02-17 Thread Leonardo Giordani
Written in > clear simple English. Now I can't wait to use them in my current and next > projects. > > :-) > > Thank you. > > Frank > > > On Fri, Feb 14, 2014 at 4:11 PM, Leonardo Giordani < > giordani.leona...@gmail.com> wrote: > >> Hi all, &

Re: Digging Up Django Class-based Views

2014-02-16 Thread Frankline
4:11 PM, Leonardo Giordani < giordani.leona...@gmail.com> wrote: > Hi all, > > the third issue of the small series "Digging Up Django Class-based Views" > is out. > This latest post is about form views. > > You find the whole series here > > http://lgiord

Digging Up Django Class-based Views

2014-02-14 Thread Leonardo Giordani
Hi all, the third issue of the small series "Digging Up Django Class-based Views" is out. This latest post is about form views. You find the whole series here http://lgiordani.github.io/blog/categories/django/ I hope you will find it interesting and useful. Cheers, Leo Leonard

Re: UUIDField from django-extensions is not available in Class Based Views

2014-01-21 Thread Timothy W. Cook
SOLVED: (sort of) I am not sure if this is the only or best way to solve the problem. But, since I needed to use get_context_data() in the view anyway. I am now doing this to get ct_id into the view template: def get_context_data(self,**kwargs): context = super(DvStringUpdateView, self).get_

  1   2   3   >