Re: Python Sqlalchemy filter by date range

2018-04-24 Thread sum abiut
Thanks heaps Larry On Tue, Apr 24, 2018 at 10:40 PM, Larry Martell wrote: > I think you are looking for the range function > > https://docs.djangoproject.com/en/dev/ref/models/querysets/#range > > > On Mon, Apr 23, 2018 at 11:54 PM sum abiut wrote: >

Re: displaying gregorian date in template

2018-04-24 Thread sum abiut
Current i have a for loop Date {% for a in results %} {{a.date_applied}} {%endfor%) currently the date is in julian date. i wan to convert the date to gregorian date. Is there a way to do that in the template. On Wed, Apr 25, 2018 at 1:50 PM, sum abiut wrote: > I have

Re: displaying gregorian date in template

2018-04-24 Thread sum abiut
i want to do something like datetime.date.fromordinal(int(date_applied)) to convert date from julian to gregorian date, just wondering it this can be done in template? On Wed, Apr 25, 2018 at 1:56 PM, sum abiut wrote: > Current i have a for loop > > > Date > > {% for a

Re: looking for the right way to work with JSONField - behavior inconsistent between strings and integers

2018-04-24 Thread Simon Charette
Hello Olivier, Since JSON objects can only have string keys[0] I'd suggest you always use strings as dict keys on the Python side to avoid having to deal with both cases. Another solution would to subclass JSONField to override the from_db_value method to turn keys into integer when retrieved

unexpected JSONField behavior clarification - key value pairs initially loaded integers, then saved down as strings into the database

2018-04-24 Thread Oliver Zhou
Using Django 1.11, Python 2.7, PostGres, and JSONField I'm getting behavior I don't expect. It seems when JSONField values are initially saved/accessed in memory, they're python "integers", but when saved to the database and then re-accessed, the values are now in string format. *What about

looking for the right way to work with JSONField - behavior inconsistent between strings and integers

2018-04-24 Thread Oliver Zhou
Using Django 1.11, Python 2.7, PostGres, and JSONField I'm getting behavior I don't expect. It seems when JSONField values are initially saved/accessed in memory, they're python "integers", but when saved to the database and then re-accessed, the values are now in string format. *What about

displaying gregorian date in template

2018-04-24 Thread sum abiut
I have a function that query the db and extract and display data on a template def bydate_display(request): if "selectdate" in request.POST and "selectdate1" in request.POST and "selectaccount" in request.POST: selected_date = request.POST["selectdate"] selected_date1 =

UpdateView Decimal Field Initial Value

2018-04-24 Thread tango ward
Hi, I am working on an UpdateView of a form. I am having hard time displaying the initial value of grades per subject. I can display the subjects fine in the template, however I can't display the grades using the

Re: Python Sqlalchemy filter by date range

2018-04-24 Thread Larry Martell
I think you are looking for the range function https://docs.djangoproject.com/en/dev/ref/models/querysets/#range On Mon, Apr 23, 2018 at 11:54 PM sum abiut wrote: > I have two date picker fields that i want the users to select from date to > end date. and i want to display

Re: tutorial01 is not working

2018-04-24 Thread lakshitha kumara
Look like url is missing. try to add this line to urls.py from django.urls import path from . import views urlpatterns = [ path('', views.index, name='index'),] On Tuesday, April 24, 2018 at 5:04:33 PM UTC+5:30, aljom...@live.com wrote: > > hi. i'm new to django dev. so i'm following the

tutorial01 is not working

2018-04-24 Thread aljomaihbev
hi. i'm new to django dev. so i'm following the tutorial at https://docs.djangoproject.com/en/2.0/intro/tutorial01/ i copied and pasted the code samples so as not to introduce typing mistakes. everything works fine until i reached the "polls" section. i get below errors: Page not found (404)

Django Setup Challenges

2018-04-24 Thread Nana Kwabena Kwarteng
Hi All, I'm new here and I'm having getting my django to run... Any help? -- 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

Best Way to Implement Breadcrumbs?

2018-04-24 Thread Alexander Joseph
Whats the best way to implement breadcrumbs in a django template? I'd like something that will track where the user came from and can offer putting the link back in something like an Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Django custom middlware routing

2018-04-24 Thread Prakash D
I have a Django project which uses django's contrib library for session management using cookies (for both Admin panel and User authentication). Now I'm migrating to JWT token based authentication system. I do not want to re-build an admin portal. My current settings.py looks like this

Recommender system

2018-04-24 Thread oganga chantal
Have any of you tried creating a recommendation system using the django framework -- 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

Porting from Cookie based authentication to JWT (except admin portal)

2018-04-24 Thread Prakash D
Hi I'm trying to port an existing application (which uses Django admin portal) to JWT authentication system so I can support native mobile clients. My proposed solution is having two manage.py files (will run on seaparate port numbers) and two settings.py files which will have different url

Re: Porting from Cookie based authentication to JWT (except admin portal)

2018-04-24 Thread Avraham Serour
I wouldn't use two settings to only achieve this, you can add multiple auth classes which django will try in a loop. You can add the JWT and a custom class which can baseclass the login/password auth and only allow superusers to login On Tue, Apr 24, 2018 at 6:18 PM, Prakash D

Re: Trying to understand two messages from `manage.py check --deploy`

2018-04-24 Thread James Farris
Hi, django.middleware.security.SecurityMiddleware is missing in your settings.py file in the middleware section. Read the Django docs for more details on what they each one of the security options do. https://docs.djangoproject.com/en/2.0/ref/middleware/ Sent from my mobile device > On

Re: tutorial01 is not working

2018-04-24 Thread 'Anthony Flury' via Django users
The debug suggest that it only tried to match the admin pattern but nothing else, that sugggests to me that you missed this bit in the mysite/urls.py from django.contrib import admin from django.urls import include, path urlpatterns = [     path('polls/', include('polls.urls')),

Re: Porting from Cookie based authentication to JWT (except admin portal)

2018-04-24 Thread Prakash D
If i don't remove contrib from middleware, Csrf header will be missing and that's a problem On Tue, Apr 24, 2018, 9:02 PM Avraham Serour wrote: > I wouldn't use two settings to only achieve this, you can add multiple > auth classes which django will try in a loop. > > You can