Re: File Upload fails

2011-03-17 Thread Matias Aguirre
You are missing the enctype form attribute needed for files input fields. Your form definition should be: Check http://www.w3.org/TR/html401/interact/forms.html#adef-enctype for details. Matías Excerpts from arapaho's message of Thu Mar 17 15:53:45 -0300 2011: > Hi, > > Rather new to Dja

Re: pyfacebook @facebook.require_login() not working

2011-03-15 Thread Matias Aguirre
I don't have the solution for your issue, didn't used pyfacebook, yet. But if you are looking to register users using Facebook OAuth, then django-social-auth may fit your needs: http://github.com/omab/django-social-auth/ Then you can use any other Facebook API around to access users content a

Re: acces to dict

2011-03-10 Thread Matias Aguirre
Hi The problem is that django template system tries __getkey__ first and as you are using a defaultdict get key call is creating a new entry with key "items" and empty list as value. Try passing dict(prod_pool) to your template. Regards, Matías Excerpts from Szabo, Patrick \(LNG-VIE\)'s message

Re: how can I filter related (foreign key) objects?

2011-02-16 Thread Matias Aguirre
Just refer to the field name, you don't need the class: prev = self.bbb_set.filter(date__lt=date) Take a look to field lookup rules: http://docs.djangoproject.com/en/dev/topics/db/queries/#field-lookups-intro Excerpts from serek's message of Wed Feb 16 20:51:05 -0200 2011: > Hi > > I have not i

Re: request.POST parsing without form

2011-01-28 Thread Matias Aguirre
Excerpts from taso's message of Fri Jan 28 17:05:21 -0200 2011: > Hi, Hi, > I am using django strictly as a backend for data processing. As such I > am not using any forms or templates, just database tables as models. > The page is js driven and POSTing data is causing me some issues. > > A user

Re: Invalidate cached copy when changes are made.

2011-01-27 Thread Matias Aguirre
You could use signals[1] to update cache on save event, but I think you are approaching the issue in the wrong way, why not paginate[2] the result? Regards, Matías [1]: http://docs.djangoproject.com/en/dev/topics/signals/ [2]: http://docs.djangoproject.com/en/dev/topics/pagination/ Excerpts from

Re: django facebook authentication

2011-01-25 Thread Matias Aguirre
Hi, Is your request.get_host() the same defined in Facebook app settings? (Web site section if I can recall correctly), facebook doesn't accept 127.0.0.1 as redirect url and might not accept localhost too. Check social_auth/backends/facebook.py on https://github.com/omab/django-social-auth for a

Re: Cant find out the "OR" in query

2011-01-24 Thread Matias Aguirre
Excerpts from nicolas lubkov's message of Mon Jan 24 04:18:18 -0200 2011: > hi all is pretty simple my question. > > when im making a query in django i use this > > result = person.objects.filter(name = "nick", lastname = "smith") > > this is like "select * from person where name = 'nick' and la

Re: django url question

2011-01-17 Thread Matias Aguirre
The '?' should be quoted as '%3F' (urllib.urlquote('?')) or it will be treated as a query parameter (check request.GET in your view ;)) Matías Excerpts from yanghq's message of Mon Jan 17 05:59:23 -0200 2011: > hi, > > In urls.py a pattern like this: > (r'^test/(?P\w{3,4})/(?P.*)$', 'djprj.test

Re: Too many items in my drowndown list

2011-01-14 Thread Matias Aguirre
Yes, it's possible, define them in in your inline class. Excerpts from mongoose's message of Fri Jan 14 08:53:18 -0200 2011: > Ok so I've tried it but can't get it to work properly. I am using > inlines. Is it possible to use raw_id_fields with inlines? > > On Jan 4, 9:25 am, mongoose wrote: > >

Re: Need HELP urgently

2011-01-13 Thread Matias Aguirre
Don't see the need to use an ajax solution when a simple raw field makes the work properly. Don't get me wrong, it's good to have several options, just that I don't see the need. Regards, Matías Excerpts from felix's message of Thu Jan 13 22:14:43 -0200 2011: > django ajax select will work (jQuer

Re: Help optimising database calls

2011-01-12 Thread Matias Aguirre
Try to reduce the queries on your view, select_related won't help a lot if using Thread model, try to collect Pun values on your view first and group them by thread, itertools.groupby could be handy in this case. Try something like: threads = Thread.objects.select_related('user').filter(...) threa

Re: Need HELP urgently

2011-01-12 Thread Matias Aguirre
The given answers are correct, that's your issue without doubt, create an admin class for your Priority model and setup a raw_id_field[1]: class PriorityOptions(admin.ModelAdmin): raw_id_fields = ('entry',) register(Priority, PriorityOptions) Regards, Matías [1]: http://docs.djangoproject.c

Re: Follow relations on three tables

2011-01-11 Thread Matias Aguirre
So, basically you want this: C.objects.filter(Bref__Dref__id=D_id).values_list('Aref') Matías Excerpts from gia...@gmail.com's message of Tue Jan 11 07:58:05 -0200 2011: > Let's say I have a model like: > > class A: > > class B: > Dref = ForeignKey('D') > > class C: > Aref = ForeignKey('A'