Re: passing data to template

2017-06-14 Thread sum abiut
Hi Mike, Thank heaps for direction. Appreciate your help. Cheers, On Thu, Jun 15, 2017 at 1:52 PM, Mike Dewhirst wrote: > On 15/06/2017 12:07 PM, sum abiut wrote: > >> I try to perform a division on the tuple but i am getting an error. I >> have added another column call Gl rate. i try to perfo

Re: passing data to template

2017-06-14 Thread Mike Dewhirst
On 15/06/2017 12:07 PM, sum abiut wrote: I try to perform a division on the tuple but i am getting an error. I have added another column call Gl rate. i try to perform the division lin {{a.1/a.0}}but im geting an error. not sure what i am doing wrong here. You are asking the template to perfor

Re: passing data to template

2017-06-14 Thread sum abiut
I try to perform a division on the tuple but i am getting an error. I have added another column call Gl rate. i try to perform the division lin {{a.1/a.0}} but im geting an error. not sure what i am doing wrong here. Net Balance Post Date GL rate {%for a in results%} {{a.0}}

Re: Failed building wheels for twisted

2017-06-14 Thread yingi keme
I have solved the problem. Thanks anyways..! Yingi Kem > On 14 Jun 2017, at 6:43 PM, yingi keme wrote: > > Hello > > I tried installing django channels on my virtual environment. But it has > failed. And it gives the following error 'failed building wheel for twisted'. > > What is this about

Re: passing data to template

2017-06-14 Thread sum abiut
Thanks heaps. appreciate your help, pointing me to right direction. On Thu, Jun 15, 2017 at 5:28 AM, ludovic coues wrote: > > > > Net Balance > Post Date > > > {%for a in results%} > > {{a.0}} > {{a.1}} > > {%endfor%} > > > `{{results|pprint}}` is pretty clear. You have a lis

'nested' GFK in admin or maybe a custom solution?

2017-06-14 Thread jaddison
Given the following, where a Product can be associated with multiple Images via a GFK: # models: class Image(models.Model): image = ImageField(...) class ImageAssociation(models.Model): image = models.ForeignKey(Image, related_name='associations') content_object = GenericForeignK

Re: passing data to template

2017-06-14 Thread ludovic coues
Net Balance Post Date {%for a in results%} {{a.0}} {{a.1}} {%endfor%} `{{results|pprint}}` is pretty clear. You have a list of tuple. Tuples have no named member so a.nat_balance return a None value. {{ a.0 }} in your django template is the equivalent of a[0] in python. If you w

Failed building wheels for twisted

2017-06-14 Thread yingi keme
Hello I tried installing django channels on my virtual environment. But it has failed. And it gives the following error 'failed building wheel for twisted'. What is this about.? And how can i handle this issue? -- You received this message because you are subscribed to the Google Groups "Djan

Re: Django m2m_changed pk_set is empty

2017-06-14 Thread Tim Graham
You can step through the relevant code here: https://github.com/django/django/blob/88b290470ab3436ef0bda6b0f3057fe133bda265/django/db/models/fields/related_descriptors.py#L870-L885 On Saturday, June 10, 2017 at 5:28:12 PM UTC-4, Jason Robinson wrote: > > Hi everyone, > > Django version 1.10.7, I h

Re: Need help in calling dispatch on custom mixin for authorization

2017-06-14 Thread Ajat Prabha
Can someone point out what is wrong in the code? -- 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

RE: ordering queries based on most upvotes

2017-06-14 Thread Matthew Pava
It is difficult to follow your formatting, so I updated it below. I would always avoid using GenericForeignKey(). That’s my own personal preference, but it doesn’t even seem like you need it in your situation. You could just have a ForeignKey or ManyToMany directly to Activity. Read more abou

ordering queries based on most upvotes

2017-06-14 Thread Arian Hedayati Far
I want to order my query based on the number of upvotes but I can't figure out how to do it. It seems way too complex! ( btw am I over-complicating things?) so here is my *models.py* class Activity(models.Model): FAVORITE = 'F' LIKE = 'L' UP_VOTE = 'U' DOWN_VOTE = 'D' FOLLOW = 'W' REPORT =

Re: Django + Django REST Framework SQL query response handling and serialization is very, very slow - yet not a “N+1” problem

2017-06-14 Thread Miika Huusko
Thanks for input @Melvyn Sopacua and @Alceu Rodriques de Freitas Junior! I know that it would be easy to just change architecture, but I wanted actually two things here. One was to "get stuff done" and the other was to "understand the problem". The first is easier. If nothing else would have wo

Re: Canonical way of handling multiple types of users? (Profiles vs subclassing django.contrib.auth.models.AbstractUser)

2017-06-14 Thread Victor Hooi
Resurrecting a slightly old thread =), but coming back to this project. Say I have multiple models that each have their own user profile. Let's assume that each type of user is mutually exclusive (i.e. a student cannot be a teacher etc.) > > class Student(models.Model): > user = models.One

Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-14 Thread qnub
On developers machines we use postgres (and BDR on production, but i have not performance issues on production anymore), redis (now on developers too, on production it was from the start) and elasticsearch. All this things executed in own docker containers (on developer machines and on producti

Re: Despite what django doc says, multiple inheritance with a common ancestor causes an error(models.E005). I found a tricky solution, but are there any better solutions?

2017-06-14 Thread Melvyn Sopacua
On Tuesday 13 June 2017 09:54:03 Hyunsoo Kim wrote: > This doc > eritance> says multiple inheritance with a common ancestor can do the > job. However, I've experienced an error while making migrations. > Here's the error messa

Re: Multilingual site with Django 1.11 and Google Cloud Platform

2017-06-14 Thread Antonis Christofides
It has been announced (by @djangoconeu on Twitter) that they will be uploaded on https://www.youtube.com/user/djangoconeurope. You could follow @djangoconeu, I'm confident they will announce it once the videos are uploaded. Regards, Antonis Antonis Christofides http://djangodeployment.com On 20

Re: Pyinotify and runserver performance with django channels in docker for mac

2017-06-14 Thread Andrew Godwin
10 seconds is still very slow, on my computer it takes around 300 milliseconds (0.3 seconds) for the worst case render. You must have something else installed/configured that is affecting it? Andrew On Wed, Jun 14, 2017 at 12:55 PM, qnub wrote: > Thank you, finally i've checked it and looks lik

Re: Multilingual site with Django 1.11 and Google Cloud Platform

2017-06-14 Thread Mihai Rusoaie
Thank you, Antonis! Do you know if the videos will be published on the conference website / youtube ? Mihai On Monday, 12 June 2017 23:04:06 UTC+3, Antonis Christofides wrote: > > Two months ago Raphael Michel made an interesting presentation about it at > the DjangoConEU. AFAIK the conference