[
{
"project": 1,
"date": "2023-05-22",
"count": 1
},
{
"project": 1,
"date": "2023-05-27",
"count": 1
}
]
throws this response. i want gr
project']
>> else:
>> queryset = RegistrationDatesSlots.objects.all().values(
>> 'project', 'date')
>>
>> serialized_data = []
>> for item in queryset:
>> serialized_item = {
>>
7;date': item['date'],
> 'project': item['project']
> }
> serialized_data.append(serialized_item)
> return Response(serialized_data)
>
>
> this is my views i want to group by "project" bu
ryset:
serialized_item = {
'date': item['date'],
'project': item['project']
}
serialized_data.append(serialized_item)
return Response(serialized_data)
this is my views i want to group by &
I have some records in the database and I need to group them by the year,
the problem is: if the day or month changes then django isn't grouping them.
This is my queryset:
classifications =
ClassificationDocument.objects.filter(Q(area=request_area) and
Q(classification__is_active=True)) \
Hi Issuer,
Bc of you use ORDER BY with .date field so it must include in GROUP BY
claude.
On Sat, Oct 19, 2019, 09:09 thinkwell wrote:
> Thanks for your reply James. I wasn't able to get it to work.
>
> I posted on the new Django forum
> <https://forum.djangoproject.com/
Thanks for your reply James. I wasn't able to get it to work.
I posted on the new Django forum
<https://forum.djangoproject.com/t/arbitrary-group-by-fields-for-partitioned-table/369>
because it's easier to format code examples over there. Hopefully that
clarifies things
gt; to partition tables
> on Django 2.2 & Postgres 11. It's working great as far as that goes, except
> that I bumped hard into annotated queries. Since PG can't guarantee PK
> uniqueness across partitioned tables, it requires including all fields in
> the GROUP BY that
*From:* django-users@googlegroups.com [mailto:
> django-users@googlegroups.com] *On Behalf Of *b...@tanners.org
> *Sent:* Monday, May 6, 2019 12:44 PM
> *To:* Django users
> *Subject:* Re: ORM help with INNER JOIN and GROUP BY
>
>
>
> Just want to make sure I understand. ForeighKeys need
;
> *From:* django...@googlegroups.com [mailto:
> django...@googlegroups.com ] *On Behalf Of *b...@tanners.org
>
> *Sent:* Monday, May 6, 2019 11:28 AM
> *To:* Django users
> *Subject:* ORM help with INNER JOIN and GROUP BY
>
>
>
> I've inherited an applicati
Maybe that was a typo?
The foreignkey relationship would look like this:
object = models.ForeignKey(FacePng'', max_length=128, blank=False,
null=False, unique=True)
On Mon, May 6, 2019 at 12:44 PM wrote:
> Just want to make sure I understand. ForeighKeys need to be integers?
>
> Only integers?
: Re: ORM help with INNER JOIN and GROUP BY
Just want to make sure I understand. ForeighKeys need to be integers?
Only integers?
You need a ForeignKey relationship between the two models, which is an integer
value, not a char. You’d have to do migrations to get this adjusted properly.
--
You
Just want to make sure I understand. ForeighKeys need to be integers?
Only integers?
You need a ForeignKey relationship between the two models, which is an
> integer value, not a char. You’d have to do migrations to get this adjusted
> properly.
>
--
You received this message because you a
ote:
>
> I've inherited an application written django 1.11. The old application uses
> raw() with INNER JOIN and GROUP BY.
> I cannot seem to figure out how to do inner join and group by properly the
> ORM way.
>
> The raw() query is below.
>
>
users
Subject: ORM help with INNER JOIN and GROUP BY
I've inherited an application written django 1.11. The old application uses
raw() with INNER JOIN and GROUP BY.
I cannot seem to figure out how to do inner join and group by properly the ORM
way.
The raw() query is below.
S
I've inherited an application written django 1.11. The old application uses
raw() with INNER JOIN and GROUP BY.
I cannot seem to figure out how to do inner join and group by properly the
ORM way.
The raw() query is below.
SELECT * FROM items_monolithic
INNER JOIN items_facep
nnotate(cnt=Count("product_specs"),
>> min_price=Min("product_specs__price")).filter(cnt__gt=0)
>> .order_by("min_price")[offset:offset + limit],
>> context={"request": request},
>> many=True)
>>
>> It says django.db.utils.Programmin
ice = models.FloatField("价格", default=0)
>> ...
>>
>> When exwcute
>> qs = Product.objects.filter(valid=1)
>> serializer = ProductSerializer(
>> qs.annotate(cnt=Count("product_specs"),
>> min_price=Min("product_specs__price")).fil
> When exwcute
> qs = Product.objects.filter(valid=1)
> serializer = ProductSerializer(
> qs.annotate(cnt=Count("product_specs"),
> min_price=Min("product_specs__price")).filter(cnt__gt=0)
> .order_by("min_price")[offset:offset + limit],
> context={"re
t;min_price")[offset:offset + limit],
context={"request": request},
many=True)
It says django.db.utils.ProgrammingError: column
"prome_product.product_name" must appear in the GROUP BY clause or be used
in an aggregate function
Can anyone help me?
--
You received th
Hello Friends,
I want to use the group by based on "*Itinerary ID*". I hope that *"Values"
keywords is using for the "Group By" but when I'm using the **"Values"
keywords for group by. then i'm getting the error for fields name.** Like
Thanks for your patience Matthew.I finally got it.
I'm still learning the ropes of Django, and I got caught up in multiple
errors (the order of lines in the query and picking out query values as
dict elements or object elements).
The running code with GROUP BY using annotated functions
users
Subject: Re: GROUP BY
@galan:
the __ is reference to a foreign key name for market, and __year is a function
extracting the year from the datefield.
Sorry for not posting the model, that would have helped avoiding this.
@matthew
Yes, that's right. That was one error down. The following
that it doesn't group by week.
contract_query = ( Project.objects
.values('market__market')
.filter(department=department_id)
.filter(datePipeline__year=year)
ct'))
So, trying to include the week number in my group by is
tirsdag den 14. august 2018 kl. 15.28.01 UTC+2 skrev Matthew Pava:
>
> Ah, the error has the answer. contract_row is a dictionary, so you need
> to access it as if it were a dictionary.
>
> contract_sum = contra
2018 11:51 PM
To: Django users
Subject: Re: GROUP BY
Thanks. But strange - exactly same error:
'dict' object has no attribute 'contracted'
contract_query = (Project.objects.all()
.filter(department=department_id)
Try not to use _ (underscore) character as prefix or postfix to any user
defined variable or db column. Its not recommended in django.
On Tue 14 Aug, 2018, 1:52 AM Mikkel Kromann,
wrote:
> I'm trying to sum the field "ownProduction", grouping it by the foreign
> key "market" (using the market's
“ownProduction” in your values list prior to the
> annotation.
>
>
>
>
>
> *From:* django...@googlegroups.com [mailto:
> django...@googlegroups.com ] *On Behalf Of *Mikkel Kromann
> *Sent:* Monday, August 13, 2018 3:22 PM
> *To:* Django users
> *Subject:
You need to include “ownProduction” in your values list prior to the annotation.
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Mikkel Kromann
Sent: Monday, August 13, 2018 3:22 PM
To: Django users
Subject: GROUP BY
I'm trying to sum the
I'm trying to sum the field "ownProduction", grouping it by the foreign key
"market" (using the market's human readable name, __name from the Market
table) and the week number (which is built-in function __year of the date
field "dateContract").
However, when I try to read the results of the que
Apologies. The code I posted is actually correct and well functioning.
The reason that the results looked wrong was that the data handled by the
code was faulty.
In my research, I found another way to do the trick:
contracts = (Project.objects.values('stage')
Dear Django users.
I'm trying to do the sums of the product of two columns ('contract_sum' and
'probability', decimal fields), grouping by a third column, 'stage' (a
choice variable).
I'm also reporting the grouped sums of one of the single columns
('contract_sum')
The single column works just
On vrijdag 27 juli 2018 04:25:56 CEST Charles Sartori wrote:
> I need to Sum() the values filtering it with
> 1 - sum(values) where date < first day of the month
> 2 - sum(values) where date < last day of the month
>
> Expected result(something like that):
> [
> {'year-month': '2018-01'}, {'sum_
27;integer field') but I am not able to get the results.
I haven't tried grouping yet in my project but will probably have to in
the near future. I think it is possible to group by week & month and
then get a sum of those groups. MariaDB has a function "MONTH" and "
t_month_day': *70*},
{'year-month': '2018-03'}, {'sum_before_month_day_one': *70*},
{'sum_before_last_month_day': *100*},
]
So far I manage to sum values and group by month:
In [12]: result = Sale.objects \
...: .annotate(date=TruncMonth
ht=True).annotate(day=TruncDay('booked_at')).values('day').annotate(c=Count('id')).order_by()
But I cannot figure out how to group by day and return ticket objects for
that day. Could you please help me solve this.
Thank you
--
You received this message because you ar
;
> In a 1.11 branch I had a complex raw sql snippet added to a query set via
> annotate.
>
> When I updated Django to 2.0, the query set behavior changed to include
> the raw sql in the GROUP BY which destroyed the performance.
>
> The same behavior occurred using annotate
In a 1.11 branch I had a complex raw sql snippet added to a query set via
annotate.
When I updated Django to 2.0, the query set behavior changed to include the
raw sql in the GROUP BY which destroyed the performance.
The same behavior occurred using annotate and extra.
I was able to hack
ME_LENGTH, blank=True)
>violation_time = models.DateTimeField()
>
>
>
>
> I have many rows in the database. So I want to group by the results for
> every two hours or for every four hours.
> I want the result something like
>
> name violation_date
>
database. So I want to group by the results for
every two hours or for every four hours.
I want the result something like
name violation_date
interval counts
abc 2017-07-01
On Wednesday, March 1, 2017 at 2:09:06 PM UTC+1, larry@gmail.com wrote:
>
>
> I had thought of using a view, but that would have been a lot of
> overhead on such a large table. I also considered adding a column and
> running a one time script to update the existing rows, and modifying
> th
On Wed, Mar 1, 2017 at 8:01 AM, wrote:
>
>>
>> As is so often the case, the requirements changed. Now what I had to
>> do, if I was doing it in SQL would have been:
>>
>> (CASE
>> WHEN TRIM(IFNULL(roiname, '')) IN ('', 'None') THEN CONCAT_WS('.',
>> CONVERT(roi_type_id, CHAR), roi_id)
>> WHEN C
>
> As is so often the case, the requirements changed. Now what I had to
> do, if I was doing it in SQL would have been:
>
> (CASE
> WHEN TRIM(IFNULL(roiname, '')) IN ('', 'None') THEN CONCAT_WS('.',
> CONVERT(roi_type_id, CHAR), roi_id)
> WHEN CONCAT_WS('.', CONVERT(roi_type_id, CHAR), ro
ou should be able to do grouping you need Just tell a ORM about aggregates
> you want to use, and it will automagically add group by.
>
> Let's try group by col1, col2:
>
>> from django.db.models import Count
>> from django.contrib.auth.models import User
>
>> print
ces for you. We have similar experience, I think.
With Django you may play with .aggregate() and .annotate() functions.
You should be able to do grouping you need Just tell a ORM about aggregates
you want to use, and it will automagically add group by.
Let's try group by col1, col2:
>
On Sun, Feb 26, 2017 at 5:05 PM, wrote:
>
>
> On Sunday, February 26, 2017 at 12:55:17 PM UTC+1, Daniel Roseman wrote:
>>
>>
>> You should explain what you want to achieve. Grouping is pointless on its
>> own. In any case, when working with an ORM like Django's it is generally not
>> helpful to t
On Sun, Feb 26, 2017 at 6:55 AM, Daniel Roseman wrote:
> On Sunday, 26 February 2017 11:11:39 UTC, larry@gmail.com wrote:
>>
>> Order by is not the same as group by. Group by does aggregation
>>
>
> You should explain what you want to achieve. Grouping is pointles
On Sunday, February 26, 2017 at 12:55:17 PM UTC+1, Daniel Roseman wrote:
>
>
> You should explain what you want to achieve. Grouping is pointless on its
> own. In any case, when working with an ORM like Django's it is generally
> not helpful to think in terms of SQL.
> --
> DR.
>
Also forget
On Sunday, 26 February 2017 11:11:39 UTC, larry@gmail.com wrote:
>
> Order by is not the same as group by. Group by does aggregation
>
>
You should explain what you want to achieve. Grouping is pointless on its
own. In any case, when working with an ORM like Django's it
Order by is not the same as group by. Group by does aggregation
On Sun, Feb 26, 2017 at 5:30 AM chris rose wrote:
> there is a model meta option called ordering. you can specify a list of
> fields to order by
>
> docs found at:
> https://docs.djangoproject.com/en/1.10/ref
there is a model meta option called ordering. you can specify a list of
fields to order by
docs found
at: https://docs.djangoproject.com/en/1.10/ref/models/options/#ordering
i have only used this in the admin
--
You received this message because you are subscribed to the Google Groups
"Djang
I have a query set and I need to do the SQL equivalent of
GROUP BY col1, col2, col3
I have read many SO posts about using aggregate and count but I have
not been able to get this to work using 3 columns. Anyone know how to
do this?
--
You received this message because you are subscribed to the
On Thursday 03 November 2016 03:15:31 Awadhesh Meshram wrote:
> How to GROUP BY using any identical field in database in Django?
https://www.google.com/search?q=django+group+by
Grouping is called "aggregation" in DBA lingo.
--
Melvyn Sopacua
--
You received this message be
Maybe this can help you:
https://docs.djangoproject.com/en/1.10/topics/db/aggregation/
On 3 November 2016 at 08:15, Awadhesh Meshram wrote:
> How to GROUP BY using any identical field in database in Django?
>
> --
> You received this message because you are subscribed to the G
lace during database query, I can't help you =/
> On 3 Nov 2016, at 13:15, Awadhesh Meshram wrote:
>
> How to GROUP BY using any identical field in database in Django?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users&qu
How to GROUP BY using any identical field in database in Django?
--
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...@googlegrou
Thanks! I don't see how the link you provided justifies your point. I
don't see anything in there saying that specifying an ordering will subsume
group by statements. How did you know this was expected?
But..in any case I'm happy to take your word for it. And thanks a
A.objects.values('b').annotate(most_recent=Max('created_at'))
>
> Produces this SQL:
> SELECT `core_a`.`b_id`, MAX(`core_a`.`created_at`) AS `most_recent` FROM
> `core_a` GROUP BY `core_a`.`id` ORDER BY `core_a`.`id` ASC
>
> which groups by an unexpected
ost_recent` FROM
`core_a` GROUP BY `core_a`.`id` ORDER BY `core_a`.`id` ASC
which groups by an unexpected field. I was expecting it to group by
`core_a`.`b_id` rather than `core_a`.`id`.
Here are my models:
from __future__ import unicode_literals
from django.db import models
from django.utils
ry handy, in contrast to writing raw
sql. I need to add GROUP BY clause only.
To be honest I'm waiting for official support for SQLAlchemy in Django,
because Django ORM is very limited.
But after a while I realized that I should verify performance differences
between DISTINCT and GROUP BY.
nct values within big dataset - some queries on some
> engines may be faster when using grouping.
> It was known technique years ago and I'm still using it.
As far as I know, reasonable SQL engines require that every selected
column is either in GROUP BY, or wrapped in an aggregatio
On Wednesday, March 2, 2016 at 6:11:32 PM UTC+1, Dan Tagg wrote:
>
> if your aren't counting or averaging then why are you grouping?
>
>
>
To fast find distinct values within big dataset - some queries on some
engines may be faster when using grouping.
It was known technique years ago and I'm s
if your aren't counting or averaging then why are you grouping?
D
On 2 March 2016 at 17:06, wrote:
> Hello,
>
> I would like to query database with Django ORM and add GROUP BY clause
> without including unnecessary counting, avg, etc.
> I can force/hack queryset by settti
Hello,
I would like to query database with Django ORM and add GROUP BY clause
without including unnecessary counting, avg, etc.
I can force/hack queryset by settting qs.query.group_by=['my_column'], but
this is unclean and risky.
Is possible something like:
MyModel.obje
ut now I like to
> group by when ever I will hide the column.
>
>
> *column1 column2 column3*
>
> AAACAD25
>
> AAAUSD12
>
> BBBCAD13
>
> BBBUSD16
>
> CCCCAD11
>
> CCCUSD18
>
l the
concepts that you need in order to build the table with the second column collapsed.
Best regards,
Carsten
Am 09.12.2015 um 16:07 schrieb Sid:
*Question:* I have a Data table displaying on django , but now I like to group
by when
ever I will hide the column.
*column1 column2 column3*
*Question:* I have a Data table displaying on django , but now I like to
group by when ever I will hide the column.
*column1 column2 column3*
AAACAD25
AAAUSD12
BBBCAD13
BBBUSD16
CCCCAD11
CCCUSD18
The above table
n from an older version django-e9d1f11 and I started seeing this
> error. Looks like the way group by is constructed has changed.
>
> Here is the model that I have.
>
> class everydaycost(models.Model):
> cost = models.DecimalField(max_digits=20, decimal_places=2)
>
Need some help on fixing the following error. I recently moved to 1.8alpha
version from an older version django-e9d1f11 and I started seeing this
error. Looks like the way group by is constructed has changed.
Here is the model that I have.
class everydaycost(models.Model):
cost
On Fri, Sep 20, 2013 at 7:34 AM, Nicolas Mendoza wrote:
> Actually what's the best way for do a group by using django ORM?
>
> I know workarounds like combinate "values" with "Anotate", etc. but I
> wil like know your favorite workaround without rawSQL and
Actually what's the best way for do a group by using django ORM?
I know workarounds like combinate "values" with "Anotate", etc. but I
wil like know your favorite workaround without rawSQL and not manager
based , only Django ORM ;-)
Example.objects.values('type
25 01:34:38 GMT ERROR: column "cms_pagemoderatorstate.id" must
appear in the GROUP BY clause or be used in an aggregate function at
character 8
2012-02-25 01:34:38 GMT STATEMENT: SELECT "cms_pagemoderatorstate"."id",
"cms_pagemoderatorstate"
Is there a way to select a list of group by columns?
The aggregation methods seem only apply to a single model but I want to use
fields from different models to group by.
select org.id as organization_id,
dep.id as department_id,
cat."catId",
max(cat.nam
ggregation using the Django ORM, and it is
> > producing a GROUP BY clause that includes the data field, which is
> > very large, and is slowing down the query by over 100-fold.
>
> > Here is a simplified version of the model:
>
> > class Document(models.Model):
On Tue, Nov 1, 2011 at 6:19 PM, christian.oudard wrote:
> I am doing a very simple aggregation using the Django ORM, and it is
> producing a GROUP BY clause that includes the data field, which is
> very large, and is slowing down the query by over 100-fold.
>
> Here is a simpli
I am doing a very simple aggregation using the Django ORM, and it is
producing a GROUP BY clause that includes the data field, which is
very large, and is slowing down the query by over 100-fold.
Here is a simplified version of the model:
class Document(models.Model):
data = models.TextField
t; Of course you can, using a subselect just like I showed. SQLite example:
>>
>> > .schema
>> CREATE TABLE a (name varchar, mod int);
>>
>> e> select * from a;
>> b1|1
>> b1|2
>> b1|3
>>
>> > select * from a group by name;
>
On 16 September 2011 22:57, dave bl wrote:
> On 16 September 2011 22:39, Jani Tiainen wrote:
>> 16.9.2011 15:27, dave bl kirjoitti:
>>>
>>> Hmm no I am not missing the point... I think the django devs are...
>>> sqlalchemy _has_ a group by.
>>>
>&g
ding
>> on the data you are dealing with, and your indexes.
>> Put simply - Django does have, nor need, a 'group by' method - and if you
>> believe otherwise, it's because you haven't got used to the "Django
>> methology" yet.
>
>
> doesn
On 16 September 2011 22:39, Jani Tiainen wrote:
> 16.9.2011 15:27, dave bl kirjoitti:
>>
>> Hmm no I am not missing the point... I think the django devs are...
>> sqlalchemy _has_ a group by.
>>
>> So I simply want to do this sql statement(using the django orm):
&
't perfect, and there are instances where you either
> need to use a raw SQL, or split the query up into multiple calls. In some
> cases, doing things the 'right' way is actually the 'wrong' way, depending
> on the data you are dealing with, and your indexes.
&
doing things the 'right' way is actually the 'wrong' way, depending
on the data you are dealing with, and your indexes.
Put simply - Django does have, nor need, a 'group by' method - and if you
believe otherwise, it's because you haven't got used to the "Dja
16.9.2011 15:27, dave bl kirjoitti:
Hmm no I am not missing the point... I think the django devs are...
sqlalchemy _has_ a group by.
So I simply want to do this sql statement(using the django orm):
select foo, count(foo), from bar group by foo;
I _could_ use a .extra method to do this(and get
> Yes, there is.
>
> Asking for a GROUP BY function in Django's ORM misses the point
> entirely of why an ORM exists. Django's ORM isn't SQL. Django's ORM
> provides an abstraction layer that is able to make an arbitrary data
> store appear like a col
Hmm no I am not missing the point... I think the django devs are...
sqlalchemy _has_ a group by.
So I simply want to do this sql statement(using the django orm):
select foo, count(foo), from bar group by foo;
I _could_ use a .extra method to do this(and get stuck on $databases)
... or a loop
On Fri, Sep 16, 2011 at 8:05 PM, dave bl wrote:
> When is the django orm going to get a "group by" function ? (this is
> srs buz ... Y NO HAZ?). I see that there have been various
> changes(getting closer! - with aggregates and annotate) ... and
> attempts in the past. Is
You mean that?
https://docs.djangoproject.com/en/1.2/topics/db/aggregation/#values
Martin
On Fri, 16 Sep 2011 14:05:13 +0200, dave bl wrote:
When is the django orm going to get a "group by" function ? (this is
srs buz ... Y NO HAZ?). I see that there have been various
chang
When is the django orm going to get a "group by" function ? (this is
srs buz ... Y NO HAZ?). I see that there have been various
changes(getting closer! - with aggregates and annotate) ... and
attempts in the past. Is there a "solid" reason for not supporting
"grou
a (name varchar, mod int);
e> select * from a;
b1|1
b1|2
b1|3
> select * from a group by name;
b1|3
> select * from (select * from a order by mod desc) group by name;
b1|1
Problem is that is not standard SQL.
In standard implemetation group by _requires_ aggregation function that
is
from a;
b1|1
b1|2
b1|3
> select * from a group by name;
b1|3
> select * from (select * from a order by mod desc) group by name;
b1|1
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django
На Wed, 14 Sep 2011 10:59:01 +0200
"Jonas H." написа:
> On 09/14/2011 04:35 AM, Peter of the Norse wrote:
> > What are you trying to do? The outer GROUP BY destroys the inner
> > ORDER BY. Try putting them on the same level and see what happens.
>
> Say I've
On 09/14/2011 04:35 AM, Peter of the Norse wrote:
What are you trying to do? The outer GROUP BY destroys the inner ORDER BY. Try
putting them on the same level and see what happens.
Say I've got an Event table and some records like this
name: foo, timestamp: 9 pm
name: foo, time
What are you trying to do? The outer GROUP BY destroys the inner ORDER BY. Try
putting them on the same level and see what happens.
On Sep 11, 2011, at 3:41 AM, Jonas H. wrote:
> Hi!
>
> How can I express this SQL query
>
> SELECT ... FROM (
>SELECT ... FROM ...
&g
Hi!
How can I express this SQL query
SELECT ... FROM (
SELECT ... FROM ...
)
in the ORM? Specifically, I want to express
SELECT ... FROM (
SELECT ... FROM app_model
ORDER BY field1
)
GROUP BY field2
Is it possible without writing SQL by hand?
Thanks,
Jonas
--
Django
Oh sorry, I knew that my sql query was naive, but my question was really
about how to use group by and retrieve data throug my template :/
I'm really sorry for waste your time with stupid sql.
Nevertheless a great thank you for your help.
I'm going to do like you say and in few tim
3 | vids3 | 2011-07-13 | 1 |
| 4 | vids4 | 2011-07-15 | 2 |
| 5 | vids5 | 2011-07-14 | 2 |
| 6 | vids6 | 2011-07-15 | 3 |
++---++-+
mysql> select * from video group by category_id;
++---++-
...)
> > category = models.ForeignKey('Category')
> >(...)
> >
> > class Category(models.Model):
> > name = models.CharField(max_length=250)
> >
> > I'm trying in a tags to make a group by on the category field and
> &g
odels.Model):
> name = models.CharField(max_length=250)
>
> I'm trying in a tags to make a group by on the category field and
> retrieve in the template the name of the first vid and its category
> name.
>
> Here it s my teamplate.py :
>
> @register.
concise reply : I would strongly suggest you to have a look at
django-taggit.
OTOH, use django-debug-toolbar to diagnose the sql that is being fired.
-V
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django
Hi dear django users :)
I m facing a stupid problem.
Here is my models.py :
class Video(models.Model):
(...)
category = models.ForeignKey('Category')
(...)
class Category(models.Model):
name = models.CharField(max_length=250)
I'm trying in a tags to make a
1 - 100 of 180 matches
Mail list logo