How to pass values of drop down from html template to views in Django?

2020-06-26 Thread ratnadeep ray
I need to send the value of the selected option in a drop down to the views. My html code is as follows: > > Select version to compare with > {%for ver in version_list%} > **{{ver}} option>** > {% endfor %} > The above is giving me the following error: > Page not found (404) > Request Meth

Re: Generic Views in Django Tutorial Not Working

2019-11-01 Thread Nijo Joseph
class IndexView(generic.ListView): template_name = 'polls/index.html' context_object_name = 'latest_question_list' def get_queryset(self): """Return the last five published questions.""" return Question.objects.order_by('-pub_date')[:5] the def get_queryset(self): f

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 and it se

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 bro

Re: How to handle database VIEWS in Django

2018-10-11 Thread Andréas Kühne
It works perfectly by coding them as a model in the same way you always do. The only thing you have to do is make sure that you set the table name and that migrations shouldn't be handled for the view: class Meta: managed = False db_table = 'events_sessionparticipant' Regards, Andréas

Re: How to handle database VIEWS in Django

2018-10-11 Thread Gurmeet Kaur
Just code for them in models.py just as a table. And it will work. I have done that in my project. It is working fine. On Thu, Oct 11, 2018, 1:38 AM django_learner wrote: > Hi everyone, > > I am using SQL SERVER and I have some predefines VIEWS in the database, > what I am looking for is to man

How to handle database VIEWS in Django

2018-10-10 Thread django_learner
Hi everyone, I am using SQL SERVER and I have some predefines VIEWS in the database, what I am looking for is to manage that VIEWS Thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

How do you disable SECURE_SSL_REDIRECT for some views in Django?

2016-09-09 Thread Mauro Sánchez
Hello, I configured in my settings SECURE_SSL_REDIRECT=True, but now I want to disable it for some views. I have seen that there is an option SECURE_REDIRECT_EXEMPT where I can define a list of regular expressions for it. But for some reason I can't make it work. I've tried to use the same regul

How do I use database views in django

2015-04-28 Thread David Levy
How do I use database views in django, many falão that view must be mapped same table, but it should certainly give problems using the migration. What is the best alternative to be used in this situation? heard in django- datatable-view is an alternative? -- You received this message because

How to use Database Views in Django Rest Framework

2014-04-18 Thread Shoaib Ijaz
I am using Django Rest Framework for serialize data. I came across a scenario where I have to use Database Views as Model. *My Model* class A(models.Model): name = models.CharField(max_length=240, blank=True) value = models.CharField(max_length=240, blank=True) class Meta:

[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 a

Re: Views in django

2012-02-05 Thread Sandeep kaur
On Sun, Feb 5, 2012 at 1:33 AM, Peter of the Norse wrote: > You should look into making a foreign key relationship if there actually is > one. That way you can just annotate the the sums. Opted for the same now. > Otherwise you should calculate the sum in the view (NOT the template) and add >

Re: Views in django

2012-02-04 Thread Peter of the Norse
You should look into making a foreign key relationship if there actually is one. That way you can just annotate the the sums. Otherwise you should calculate the sum in the view (NOT the template) and add it to the client. Python allows you to add any value you want to any object. On Feb 3, 2012

Re: Views in django

2012-02-03 Thread Weldan
Calculate in view, in template should print values . Can group it in dict i think. On Feb 3, 2012 10:39 PM, "Sandeep kaur" wrote: > On Fri, Feb 3, 2012 at 7:52 PM, Weldan wrote: > > Entries.objects.count() > > > That will be applicable if I want to his for only 1 table's entry. > But here I ha

Re: Views in django

2012-02-03 Thread Sandeep kaur
On Fri, Feb 3, 2012 at 7:52 PM, Weldan wrote: > Entries.objects.count() > That will be applicable if I want to his for only 1 table's entry. But here I have views as : cd = form.cleaned_data name_and_address = cd['name_and_address']

Re: Views in django

2012-02-03 Thread Weldan
Entries.objects.count() On Feb 3, 2012 10:12 PM, "Sandeep kaur" wrote: > Can I apply some operations on the views ( of database) that are > created by me? Eg: to do sum of some filtered entries. If yes, then > how? > > -- > Sandeep Kaur > E-Mail: mkaurkha...@gmail.com > Blog: sandymadaan.wordpre

Views in django

2012-02-03 Thread Sandeep kaur
Can I apply some operations on the views ( of database) that are created by me? Eg: to do sum of some filtered entries. If yes, then how? -- Sandeep Kaur E-Mail: mkaurkha...@gmail.com Blog: sandymadaan.wordpress.com -- You received this message because you are subscribed to the Google Groups

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > Wow! I didn't know it would be that simple! > > > > What about convenience functions, get_relatedobjectname()? > > Can 'relatedobjectname' be a field name passed as a parameter? > > Yes,

Re: Create generic views in Django 0.91

2006-06-16 Thread Jeremy Dunck
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > Note that this is just Python -- there's nothing Django-specific about > these examples. Isn't Python the best? :) I find that in Python, the main obstacle between my thoughts and simple code that does exactly what I want is generally my ow

Re: Create generic views in Django 0.91

2006-06-16 Thread Adrian Holovaty
On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > Wow! I didn't know it would be that simple! > > What about convenience functions, get_relatedobjectname()? > Can 'relatedobjectname' be a field name passed as a parameter? Yes, you can pass that in dynamically. For that example, you'd do this:

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/16/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > As for my initial question I apologize for the confusion, I didn't > > mean to use the generic views as described in the Django tutorials. I > > want to be able to make some functions gen

Re: Create generic views in Django 0.91

2006-06-16 Thread Adrian Holovaty
On 6/16/06, Sam Tran <[EMAIL PROTECTED]> wrote: > As for my initial question I apologize for the confusion, I didn't > mean to use the generic views as described in the Django tutorials. I > want to be able to make some functions generic. Please let me give you > an example: http://paste.e-scribe.

Re: Create generic views in Django 0.91

2006-06-16 Thread Sam Tran
On 6/14/06, Adrian Holovaty <[EMAIL PROTECTED]> wrote: > > On 6/13/06, Sam Tran <[EMAIL PROTECTED]> wrote: > > Now we want to use the same model to create a contact tree for a given > > user: we determine who this user can view, e.g. personal phone > > numbers. The tables have different name but h

Re: Create generic views in Django 0.91

2006-06-14 Thread Adrian Holovaty
On 6/13/06, Sam Tran <[EMAIL PROTECTED]> wrote: > Now we want to use the same model to create a contact tree for a given > user: we determine who this user can view, e.g. personal phone > numbers. The tables have different name but have the same function. > Obviously we'd like to use the same view

Create generic views in Django 0.91

2006-06-13 Thread Sam Tran
Hi All, We are working on a service provisioning workflow interface using Django 0.91. We wrote some views that are being used to create/modify/delete manager/subordinates relationships with or without inheritance (Manager can also manage a subordinate's subordinates). We can also visualize the