On 10/20/06, DavidA <[EMAIL PROTECTED]> wrote:
> I'm curious how you would solve this problem using SQLAlchemy. I have
> _many_ needs for aggregation, subselects, and other things that are not
> easy or possible to do in Django's ORM, but I've never seen an ORM that
> does this (without just
Frankie Robertson wrote:
> Yes, dropping down is a good thing. You'll never be able to do
> everything with django's simple ORM. Raw SQL is a 'good thing',
> honest. Once we get SQLAlchemy we can drop to that some of the time
> but until then SQL is the way forward.
Slightly OT, but...
I'm
thank you all! I will do it with raw SQL . thanks for the code.
I hope SQLAlchemy will be implemented soon in django. thank you!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this
On 20/10/06, DavidA <[EMAIL PROTECTED]> wrote:
>
>
> Russell Keith-Magee wrote:
> > On 10/19/06, zenx <[EMAIL PROTECTED]> wrote:
> > >
> > > I want to get the maximum and the minimum values of various numbers. Is
> > > the following method the best way to do it?
> >
> > The most efficient way
Russell Keith-Magee wrote:
> On 10/19/06, zenx <[EMAIL PROTECTED]> wrote:
> >
> > I want to get the maximum and the minimum values of various numbers. Is
> > the following method the best way to do it?
>
> The most efficient way would be to use SQL; this way, the min and max
> would fall out as
On 10/19/06, zenx <[EMAIL PROTECTED]> wrote:
>
> I want to get the maximum and the minimum values of various numbers. Is
> the following method the best way to do it?
The most efficient way would be to use SQL; this way, the min and max
would fall out as the result of a single query.
zenx wrote:
> hi,
>
> just tried this but doesn't work:
>
> q = ArtistaTag.objects.all()
> nums=['']
> for tag in q:
> num = tag.artista_set.count()
> nums.append(num)
>
> max_art = max(nums)
> min_art = min(nums)
>
> i get a TypeError unsupported operand type(s) for -:
On Oct 19, 2006, at 3:21 PM, zenx wrote:
>
> hi,
>
> just tried this but doesn't work:
>
> q = ArtistaTag.objects.all()
> nums=['']
> for tag in q:
> num = tag.artista_set.count()
> nums.append(num)
>
> max_art = max(nums)
> min_art = min(nums)
>
> i get a TypeError
hi,
just tried this but doesn't work:
q = ArtistaTag.objects.all()
nums=['']
for tag in q:
num = tag.artista_set.count()
nums.append(num)
max_art = max(nums)
min_art = min(nums)
i get a TypeError unsupported operand type(s) for -: 'str' and 'long' :(
On Oct 19, 2006, at 5:03 AM, zenx wrote:
>
> I want to get the maximum and the minimum values of various
> numbers. Is
> the following method the best way to do it?
Python already has min and max functions available. Just feed as many
values in a tuple and it will return the min or max
I want to get the maximum and the minimum values of various numbers. Is
the following method the best way to do it?
for tag in q:
num = tag.artista_set.count()
if num_ant:
if num < num_ant:
min_art = num
else:
11 matches
Mail list logo