My previous version had a bug, the use of "min"
The following, using "Least()" instead of min() seems to have resolved that
clusters = nodes.values('cluster').annotate(
count_left=Least(F('cluster__volume_limit') - F(
'cluster__volume_count'),
Sum(F('volume_l
A further bit of clarification
clusters = nodes.values('cluster').annotate(count_left=min(F(
'cluster__volume_limit') - F('cluster__volume_count'),
Sum(F(
'volume_limit') - F('volume_count'))),
This seems to work
Node.objects.values('cluster').annotate(volume_left=min(F('cluster__volume_limit')-F('cluster__volume_count'),
Sum(F('volume_limit')-F('volume_count'
Do I have it right? Just wanted to confirm.
Thanks
On Saturday, July 1, 2017 at 5:41:20 PM UTC-7, sarvi wrote:
>
>
>
Django Verion: 1.11.1
My models
class Cluster(models.Model):
volume_limit = models.IntegerField('Cluster Volume Count Limit')
volume_count = models.IntegerField('Cluster Volume Count', default=0)
class Node(models.Model):
cluster = models.ForeignKey(Cluster, related
Thanks. I didn't think of this. That should be doable.
Will try that.
On Tuesday, June 27, 2017 at 12:07:45 PM UTC-7, Avraham Serour wrote:
>
> > how do I get the work process, which tries to access the data model, to
> talk to the "test" database
>
> The same way django has a settings.py file I
Details are available on the Django project weblog:
https://www.djangoproject.com/weblog/2017/jul/01/bugfix-release/
--
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
Hello,
Can you please print here a code snippet where you are using:
> logger = logging.getLogger(__name__)
Regards,
Constantine C.
On Thu, Jun 29, 2017 at 11:29 PM, Yp Xie wrote:
> Hi guys,
>
> I'm using the python built-in logging module in a django project. Using
> dictConfig, the configura
Hello Pablo,
+1 to your solution
Regards,
Constantine C.
On Fri, Jun 30, 2017 at 9:06 AM, Pablo Camino Bueno
wrote:
> Hello,
>
> I'm using Django Sites framework to hadle different sites, with the same
> users.
>
> I'd like to add a link to switch between my sites, but I don't want to get
> re
Hi Brian,
A quick overview of your requirements.
There should be a signup flow that adds user email to specific Google
Group. So basically you are trying to get just emails from user. And you
are not going to verify emails, activate/deactivate users, add secured
section to you site, except admin
Hi everyone,
a question for you all :
from my django application I need to select a folder and get its full path.
I did a template that offer the following :
I click on button « Parcourir » and I want to get a folder list in order to
choose one.
I did a test to check easygui.diropenbox and
Hi!
Maybe I did something wrong when trying to program with Django in my first
thread here. Maybe I did the relationship the wrong way, maybe the docs are
containing the wrong words because of my poor database knowledge. But now I
came quite far (and hopefully someone can use that code below as
11 matches
Mail list logo