Re: django 2.0 to django 2.2 migration

2019-10-17 Thread Sijoy Chirayath
Thank you very much for your quick support. -- 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 view this discussion on

Re: django server not runing

2019-10-17 Thread Mohammad yunus
Seperate your URL file with "," or remove "name" On Fri, 18 Oct 2019, 7:52 am wd, wrote: > The error is pretty clear ... > > [image: image.png] > > May be it should be path('', views.first_view, name='first_view') ? > > On Fri, Oct 18, 2019 at 4:41 AM Muhamed Bešić > wrote: > >> >> -- >> You re

Re: a variable is not defined

2019-10-17 Thread Jorge Gimeno
I saw this that may be relevant: https://stackoverflow.com/questions/7576202/how-can-i-pass-two-models-to-a-class-based-generic-view -Jorge On Thu, Oct 17, 2019 at 8:14 PM sotiris moustogiannis wrote: > I want to make custom function because i want to take one result from 2 > different models

Re: a variable is not defined

2019-10-17 Thread sotiris moustogiannis
I want to make custom function because i want to take one result from 2 different models (inner join), and i dont find a way to use 2 models in my listview class (generic) On Friday, October 18, 2019 at 6:03:18 AM UTC+3, sotiris moustogiannis wrote: > > I read that you can't use the def get_que

Re: a variable is not defined

2019-10-17 Thread sotiris moustogiannis
I read that you can't use the def get_queryset into a function but only in a generic class view, so maybe the def get_queryset function does not run. I want to make my own custom function and i want to find a way to get self parameter in my function. Thanks a lot. On Friday, October 18, 2019 a

Re: set school year and change boolean to False when school year is not active

2019-10-17 Thread Rain
Thanks Sir Alot sir ima check for it! On Fri, Oct 18, 2019 at 9:55 AM Okware Aldo wrote: > hello, > You could use signals pre_save > https://docs.djangoproject.com/en/2.2/topics/signals/ > > > On Fri, Oct 18, 2019 at 4:49 AM Rain wrote: > >> Hello!. thanks for your help.. >> what i want to achi

Re: a variable is not defined

2019-10-17 Thread Jorge Gimeno
wd, The problem here is that when you're creating the context, the name 'result' is not defined. When the get_queryset() method returns, the result name goes out of scope. My guess that's why you're getting a NameError. If that's not it, I would suggest cutting and pasting the traceback and show

Re: a variable is not defined

2019-10-17 Thread wd
oh ,sorry my mistake. But I think the error is pretty clear ... On Fri, Oct 18, 2019 at 10:23 AM wd wrote: > Dude, you need to indent at the line include 'context' ... it's a > beginners problem... > > On Fri, Oct 18, 2019 at 10:14 AM sotiris moustogiannis < > sotom...@outlook.com> wrote: > >>

Re: a variable is not defined

2019-10-17 Thread wd
Dude, you need to indent at the line include 'context' ... it's a beginners problem... On Fri, Oct 18, 2019 at 10:14 AM sotiris moustogiannis wrote: > I have an error: name 'result' is not defined > > > > def search(request): > > def get_queryset(self): > query = self.request.GET.ge

Re: django server not runing

2019-10-17 Thread wd
The error is pretty clear ... [image: image.png] May be it should be path('', views.first_view, name='first_view') ? On Fri, Oct 18, 2019 at 4:41 AM Muhamed Bešić wrote: > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe

a variable is not defined

2019-10-17 Thread sotiris moustogiannis
I have an error: name 'result' is not defined def search(request): def get_queryset(self): query = self.request.GET.get('q') result = Shops.objects.filter(Q(city=query)) return result context={ 'shops' : result, } return render(request, 'b

Re: set school year and change boolean to False when school year is not active

2019-10-17 Thread Okware Aldo
hello, You could use signals pre_save https://docs.djangoproject.com/en/2.2/topics/signals/ On Fri, Oct 18, 2019 at 4:49 AM Rain wrote: > Hello!. thanks for your help.. > what i want to achieve is ti check if end year is already meet. > then if school year already ended. The field would be inac

Re: set school year and change boolean to False when school year is not active

2019-10-17 Thread Rain
Hello!. thanks for your help.. what i want to achieve is ti check if end year is already meet. then if school year already ended. The field would be inactive or the boolean True would be False. if the set year already passed. On Fri, Oct 18, 2019 at 4:41 AM James Gutu wrote: > It depends what yo

Re: django server not runing

2019-10-17 Thread Gabriela Barrera
In your urls.py file, you have a syntax error, change '=' for ',' On Thu, Oct 17, 2019, 17:41 Muhamed Bešić wrote: > > -- > 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 a

Re: Creating an app that generates static files

2019-10-17 Thread Jack Sundberg
Thank you, James! This seems like a good fix. From reading through the documentation (here ), this is how I understand the workflow -- so correct me if I'm wrong please! > First, I can activate Django sessions by adding 'django.cont

Re: Creating an app that generates static files

2019-10-17 Thread James Gutu
Jack, >From what I understand it looks like a conflict of uniquely named files when they are generated simultaneously. Could you resolve this by creating a folder named from the session_id, with the file inside of that. So that if two users request the same file, there will never be a conflict, as

multiplate table inheritance subclass with extra OneToOneField relationship to parent class

2019-10-17 Thread Brian Maissy
I have a model which essentially boils down to this: class Person(models.Model): name = models.TextField() class MarriedMan(Person): wife = models.OneToOneField(Person, on_delete=models.CASCADE, related_name='husband') But when I try to make the migratio

[bug] Django 2.2.6 breaks postgres orm querying for list inside a jsonfield

2019-10-17 Thread Mehran Kader
Assuming I have a model Like this: class Sequence(models.Model): triggers = JSONField() Now, all my instances will be of the format: triggers = {'list1': [], 'list2': []) So a query which worked in 2.2.5 Sequence.objects.filter(triggers__list1__contains=['str']) does not work in d

Multiple table inheritance subclass with an additional OneToOneField relationship to the parent class

2019-10-17 Thread Brian Maissy
I have a model which in essence boils down to this: class Person(models.Model): name = models.TextField() class MarriedMan(Person): wife = models.OneToOneField(Person, on_delete=models.CASCADE, related_name='husband') But when I try to generate the migra

Re: set school year and change boolean to False when school year is not active

2019-10-17 Thread James Gutu
It depends what you are trying to achieve. What do you mean by "then when school year end this would automatically in_active"? Do you need to determine start_date <= self.end_year *only when saving* or you need to check *everyday* to see if datetime.now() > self.end_year? On Thu, Oct 17, 2019 at

Re: django 2.0 to django 2.2 migration

2019-10-17 Thread Simon Charette
This was tracked in https://code.djangoproject.com/ticket/30673 and fixed and 2.2.5[0] Cheers, Simon [0] https://github.com/django/django/commit/1265a26b2fa3cbd73a2bccd91b700268bc28bc07 Le jeudi 17 octobre 2019 10:31:50 UTC-4, Sijoy Chirayath a écrit : > > I am changing one of my application f

set school year and change boolean to False when school year is not active

2019-10-17 Thread Rain
Hi Guys!! Hope Fully someone can help me any hint or answer really appreaciated.. ireally stuck here in a couple of days now. My Problem is i want to set a school year using start_year and end_year field then when school year end this would automatically in_active for example start_year: 2019-01

Re: Creating an app that generates static files

2019-10-17 Thread Jack Sundberg
Yes, I tried getting the idea across in layman terms, as I hope this helps discussion of the issue -- and then I can later translate the solution into django implementation. I avoided the full process in my original post for clarity. I used the *.jpeg file as an illustrative example, when I'm

form_add with pre-filled fields

2019-10-17 Thread Jérôme Le Carrou
Hi, I have a models with 3 classes: Visite, Inclusion, BilanBiologique and ExamenBiologique - Inclusion is linked to Visite (OneToOne) - BilanBiologique is linked to Visite (ForeignKey) - ExamenBiologique is linked to BilanBiologique (ForeignKey) - ExamenBiologique is a subform of BilanBiologiqu

Re: Django URL not working on my windows 10

2019-10-17 Thread vineet daniel
Scrernshot5 there should.be a comma before name. On Thu, 17 Oct 2019, 20:26 vineet daniel, wrote: > Typo in include in urls.py file instead of incliude it should be include. > Thats something that i could see immediately. > > On Thu, 17 Oct 2019, 20:22 Muhamed Bešić, > wrote: > >> wtf i have d

Re: Django URL not working on my windows 10

2019-10-17 Thread vineet daniel
Typo in include in urls.py file instead of incliude it should be include. Thats something that i could see immediately. On Thu, 17 Oct 2019, 20:22 Muhamed Bešić, wrote: > wtf i have done wrong, i'm getting bored, URL mapping not working anyway, > anyone please, review the files and give a soluti

Re: Creating an app that generates static files

2019-10-17 Thread vineet daniel
This problem can happen with any stack and shouldn't be considered as django specific. What you are looking for is a solution in a layman terms.which then can be translated to django implementation. Before that i would like to know image size and kind of image that you create. Is it some qr code o

django 2.0 to django 2.2 migration

2019-10-17 Thread Sijoy Chirayath
I am changing one of my application from djanog 2.0.6 to 2.2.2. I have 2 model files in two different app consists of model classes. Each model file i mapped to two different databases. Some of the model classes in both model files have the same name for dt_table in the meta class. So while doi

Creating an app that generates static files

2019-10-17 Thread Jack Sundberg
Hi all, I am currently writing an app that generates static files before serving them, and I could use some input! Here's a step-by-step example of how the app is setup: - the url mapping pulls a database entry - using the data entry, static files are created from the data (for example, a *.

Django Middleware vs. DRF Permission Classes for Validations

2019-10-17 Thread Dinesh Dass Subramanian
I am going to develop a web application with front-end being angular and backend being Django REST Framework. There is a need to do several validations from HTTP request including access token and api key validations. The key point is that some validations will be applicable for all APIs and so

Overriding change_list_results template per ModelAdmin

2019-10-17 Thread Luka Jančin
I have a model which is registered to two different admin sites with two ModelAdmins. I would like to override the template for change_list_results for each ModelAdmin independently. Currently it's not possible the same way you can do it for add_form_template, change_form_template etc. by overr

Re: Working with static files

2019-10-17 Thread Gaddafi adamu
Go an add {% load static %} Then use {% static “link.css” %} in your static urls Sent from my iPhone > On 17 Oct 2019, at 12:25 PM, ISAAC NELSON S.B. KARGBO > wrote: > >  > Hello everyone, i am new to Django and i am learning to develop a "todo_list > app", but i have a problem with my cs

Re: Working with static files

2019-10-17 Thread N'BE SORO
Hello use this tutorial https://docs.djangoproject.com/fr/2.2/howto/static-files/ Le jeu. 17 oct. 2019 à 09:25, ISAAC NELSON S.B. KARGBO < insbkar...@njala.edu.sl> a écrit : > Hello everyone, i am new to Django and i am learning to develop a > "todo_list app", but i have a problem with my css sta

Re: Django server not working on my windows pc

2019-10-17 Thread Integr@te System
Try to check PATH/enviroment variable and permission of project folders -- 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

Working with static files

2019-10-17 Thread ISAAC NELSON S.B. KARGBO
Hello everyone, i am new to Django and i am learning to develop a "todo_list app", but i have a problem with my css static files. Please help me on how to do about it. Thanks! -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from