Re: Please fix my ugly code

2006-07-13 Thread Carlos Yoder
Jorge, muchas gracias! I have not got as close as a mile from manipulators yet, even though they look pretty cool. I'll certainly save your code around for later. Who would have thought my code was not that off-track as I thought! =) Anyway, a big thank you for the time you took to write this,

Re: Please fix my ugly code

2006-07-13 Thread Kenneth Gonsalves
On 13-Jul-06, at 11:06 PM, Jorge Gajon wrote: > But I'm totally wrong there. Your original code should be fine, > because you were chaining the filters. The 'extends' is not necessary > and in fact it is wrong. you scared me a bit there ;-) -- regards kg http://lawgon.livejournal.com http://

Re: Please fix my ugly code

2006-07-13 Thread Jorge Gajon
Hi again Carlos, I suggested this change in your code: > results = Vozilo.objects.all() > if selected_model_id != 0: > results = results.filter(model_id__exact=selected_model_id) > if selected_gorivo_id != 0: > results.extend(results.filter(gorivo_id__exact=selected_go

Re: Please fix my ugly code

2006-07-13 Thread Jorge Gajon
Hi Carlos, I think your code is going good so far. Of course I'm not a guru but I think your code is fine. Is there something that you don't feel comfortable with? With respect to adding the results of both filters, you need to extend the results of the first results (if any), like this: res

Re: Please fix my ugly code

2006-07-13 Thread Kenneth Gonsalves
On 13-Jul-06, at 8:02 PM, Carlos Yoder wrote: > There must be a better way of doing this, right? I'm a terrible newbie > both at Python and Django --and I'm not a kid anymore, so no more time > to spare hitting my head on walls :-) i have done more or less the same thing - yet to try it out tho

Please fix my ugly code

2006-07-13 Thread Carlos Yoder
Hello people, my ongoing adventures in firstdjangoappland continue thus: I'm putting together a simple search app for a car project. On entry, user sees a list of 5 random cars. He can use up to two comboboxes to filter the results (car model and fuel type). This is what I've come up with on my