2007/10/4, RajeshD <[EMAIL PROTECTED]>:
> Remember that whenever you filter an existing queryset in order to
> progressively develop a query, you get a new queryset. So, you need to
> assign it back to a variable otherwise it's lost in the ether :)
Ops :)
--
Alessandro Ronchi
Skype: aronchi
ht
Hi Alessandro,
Replace: items.filter(provincia__iexact=provincia) with
items = items.filter(provincia__iexact=provincia)
Similarly, replace items.filter(tipo__iexact=tipo) with
items = items.filter(tipo__iexact=tipo)
Remember that whenever you filter an existing queryset in order to
progressiv
2007/10/2, Tomas Kopecek <[EMAIL PROTECTED]>:
> Maybe it is worth a ticket in trac.
I tried, but it says:
500 Internal Server Error (Submission rejected as potential spam
(Maximum number of posts per hour for this IP exceeded, Akismet says
content is spam))
(I didn't send any other post)
Your
This works for me.
My model:
class BannerPosition(models.Model):
position = models.SmallIntegerField()
banner = models.ForeignKey(BannerItem)
class Meta:
ordering = ('position', 'banner')
def __str__(self):
return '%s - %s' % (self.ba
Alessandro Ronchi napsal(a):
> 2007/10/1, Tomas Kopecek <[EMAIL PROTECTED]>:
>
>> Now, I don't understand. What is the difference between these two cases?
>
> I don't know. If I put the random order before filter it works, if I
> put it after filter it doesn't.
>
>
Maybe it is worth a ticket i
2007/10/1, Tomas Kopecek <[EMAIL PROTECTED]>:
> Now, I don't understand. What is the difference between these two cases?
I don't know. If I put the random order before filter it works, if I
put it after filter it doesn't.
--
Alessandro Ronchi
Skype: aronchi
http://www.alessandroronchi.net - I
Alessandro Ronchi napsal(a):
> 2007/10/1, Tomas Kopecek <[EMAIL PROTECTED]>:
>
>> items = shuffle(items)
>
>
> If I do that I get
>
> Exception Type: TypeError
> Exception Value:object doesn't support item assignment
>
Oh, sorry, I forget that it works in place. It means you have to d
2007/10/1, Tomas Kopecek <[EMAIL PROTECTED]>:
> items = shuffle(items)
If I do that I get
Exception Type: TypeError
Exception Value:object doesn't support item assignment
The '?' works If I put it on objects.all.order_by('?') instead objects.all
--
Alessandro Ronchi
Skype: aronchi
h
Alessandro Ronchi napsal(a):
> I tried to create a random view with the code on the bottom. It
> doesn't work, the order is always the same.
> What's wrong?
> items.order_by('?')
? Means, that order is undefined but not random with each call. If you
want to randmize order, use this
from ra
I tried to create a random view with the code on the bottom. It
doesn't work, the order is always the same.
What's wrong?
# Create your views here.
from adottami.adozioni.models import Scheda, Referente
from django.views.generic.list_detail import object_list
#from django.views.generic.list_deta
10 matches
Mail list logo