Re: django Query filter

2019-04-04 Thread Abhineet Baranwal
I edited it as you suggested but it is giving another error like 'method' object is not subscriptable On Wed, Apr 3, 2019 at 10:24 PM Nikolay Smirnov wrote: > Your request.POST does not contain "search1". > Do so search1 = request.POST.get('search1') > > Example: > def viewstr(request): > vi

Re: django Query filter

2019-04-04 Thread Abhineet Baranwal
Thanks..I'll search for that but i think its not related to the query, its related to two search i have used in one post request On Wed, Apr 3, 2019 at 5:57 PM Guru Murthy wrote: > Hi abhineet baranwal, > You have to use q(id__in=search) instead q(id__icontains=search) ..search > more about how

Download html file using python

2019-04-04 Thread Guru Murthy
Hi all, IAM having html content file similar to as follows: educa login I have to download this html content file using python remember I have to download the html file not to write the data in another file name -- You received this message because you are subscribed to the Google Gro

Re: google chrome extension

2019-04-04 Thread Abhineet Baranwal
Thanks for the good explanation On Wed, Apr 3, 2019, 6:40 PM Alex Chiaranda wrote: > Greetings, > > for Chrome Extension, you must use Javascript, or Javascript + Native Code > (compiling for the target platform, and distributing it with the > extension). So the quick answer is "You shouldn't do

Re: django Query filter

2019-04-04 Thread Abhineet Baranwal
Thanks for the help, this is showing only one value in dictionary at a time . There is no fault here but i have a question can we run multiple search query in same page with different id ? And it shows that error even now On Wed, Apr 3, 2019 at 5:56 PM dvij parekh wrote: > > seems like search1 k

Re: Models

2019-04-04 Thread Mike Dewhirst
On 4/04/2019 5:52 pm, John Crosby wrote: Hi all, does any one have any good tips or resources to help me get my head around designing models? Everyone would love to dive in and help but it is just a tad too soon. You need to follow the tutorial and marry the polls models with the way you pe

Migration auth.0011_update_proxy_permissions from Django 2.2 fails to apply

2019-04-04 Thread Julien Enselme
Hi, I am trying to update my project to Django 2.2 (we are currently on 2.0.13). When I launch `python manage.py migrate`, I get this error message when migration auth.0011_update_proxy_permissions is applying (full stacktrace is available here ): django.db.utils.Integri

Edubancassurance: Proposed Evolution of Virtual Government for the Universe.

2019-04-04 Thread Hemant Shirbavikar
Name: Hemant Shirbavikrar S/o Sharadchandra Shirbavikar DOB : 08.10.1956 POB Nagpur Permanent Address: Plot S-16, Sahasrabuddhe Layout, Bharatnagar, NagpurMS 0712-2549936 Current Address: Flat 12, Krishan Residency, Paras Paradise Apartment, Rau, Indore MP 450 001 (M) 7389732800 Mail

I cannot import my model classes in order to add data to my database

2019-04-04 Thread Demayne Collins
below is the code. When I try t import the class Membership I get an error message saying "*ModuleNotFoundError: No module named 'membership'" * * at the python IDLE. I need to create an object from the class by instantiating a variable.. It appears my object class is not being recognized. *

Re: Using forms to handle request.GET data?

2019-04-04 Thread Carsten Fuchs
Hello, Am 03.04.19 um 21:28 schrieb Mohammad Etemaddar: > Set default value: > year = forms.ChoiceField(required=False, choices=[(j, j) for j in range(2018, > 2021)], default=2019) Thanks for your reply, but unfortunately, `default` is a keyword for model fields only, not for form fields: TypeE

How to render the result of Model's method after submitting to another model?

2019-04-04 Thread Олег Котов
Hello. I have a model which saves data from field forms on site to the PostgreSQL. And another model which must take some data her table and handle it. So how can i print result of my second model's method to another field form on site? I think it's a stupid question, but i've read many tutoria

Re: Using forms to handle request.GET data?

2019-04-04 Thread Carsten Fuchs
To elaborate on this further: Searching the web for this yields numerous hits, e.g. https://stackoverflow.com/questions/16026479/django-forms-default-values-for-bound-forms mentions some ways to address this, but I've not come across a fully satisfactory solution. Another approach might be thi

RE: Using forms to handle request.GET data?

2019-04-04 Thread Matthew Pava
If you need a default year in your template context, put it there. def get_context_data(self, request, *args, **kwargs): context = super().get_context_data(request, *args, **kwargs) context['default_year'] = 2019 return context In your template, you could use this type of construct: {

RE: Using forms to handle request.GET data?

2019-04-04 Thread Matthew Pava
And, since you really don't want constants littering your code, you probably want something like this: context['default_year'] = timezone.now().year -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Carsten Fuchs Sent: Thursday, Ap

Re: Using forms to handle request.GET data?

2019-04-04 Thread Carsten Fuchs
Am 04.04.19 um 16:24 schrieb Matthew Pava: > And, since you really don't want constants littering your code, you probably > want something like this: > context['default_year'] = timezone.now().year Sure, thanks, but the year was only used to keep the example code minimal and the focus on how to

Re: Using forms to handle request.GET data?

2019-04-04 Thread Carsten Fuchs
Am 04.04.19 um 16:23 schrieb Matthew Pava: > If you need a default year in your template context, put it there. > > def get_context_data(self, request, *args, **kwargs): > context = super().get_context_data(request, *args, **kwargs) > context['default_year'] = 2019 > return context >

Re: django Query filter

2019-04-04 Thread Nikolay Smirnov
The global POST variable allows you to access the data sent with the POST method by* input name*. See more info https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data . Your html: First name: Last name: On Thursday, 4 April 2019 09:43

Re: django Query filter

2019-04-04 Thread Nikolay Smirnov
The global POST variable allows you to access the data sent with the POST method by* input name*. See more info https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Sending_and_retrieving_form_data . Your html: First name: Last name: On Wednesday, 3 April 2019 13:33:20

RE: Using forms to handle request.GET data?

2019-04-04 Thread Matthew Pava
You could try something like this: data = request.GET.copy() data.setdefault('year', 2019) # fill 'year' in data if it's not already set; returns 2019 year_form = JahrAuswahl(data) -Original Message- From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf O

How is the best way to separate costumers on my django site?

2019-04-04 Thread Fellipe Henrique
Hello, I need to separate my django website, for different costumers... Which is the best option: 1) One database and separate each costumer as a django user 2) different database, one for each costumer? There's no need the costumer has "users"... Any tips or ideas? Regards, T.·.F.·.A.·.

Re: How is the best way to separate costumers on my django site?

2019-04-04 Thread Sithembewena L. Dube
Hi https://www.codementor.io/pauloscardine/15-minute-guide-to-secure-saas-multitenancy-with-django-and-let-s-encrypt-ijtlarca8 https://blog.usejournal.com/building-a-saas-application-with-django-web-framework-part-1-2-the-principe-2f0730a6693f Kind regards, Sithembewena *Sent with Shift

Django validation

2019-04-04 Thread veera nagaraja sankar Inti
Hi All, I working on Django validation, i have done some practice, I observed somethig plase let know if any misunderstadings, 1) When every datatype in models have default validators or worked, it is worked on the form contains *is_valid()* or else ?.. 2)we can add the custom validations u

Re: Django validation

2019-04-04 Thread אורי
I think the default validators are relevant to the type of field you define. If you define a general field which is not required and without max_length, I assume there will not be any default validators. You can then define your own validators, either in the model or in the relevant forms and views