django template string and int comparison behavior

2013-09-17 Thread J Y
I am building a search form that provides a drop down list, and then on the search results, I am redisplaying the search form, but with the search parameters already pre-selected, so this is what I attempted to do: {% for item in object_list %} {{ item.name }}

Re: django template string and int comparison behavior

2013-09-20 Thread J Y
re > item.id to that, rather than something you dug out of request.GET. > > Bill > > > On Tue, Sep 17, 2013 at 2:50 PM, J Y >wrote: > >> I am building a search form that provides a drop down list, and then on >> the search results, I am redisplaying the search

Restrict access to user-uploaded files to authorized users

2013-09-24 Thread J Y
I am buliding a tool that needs to have the ability to allow user to upload a file, and the file should only be accessible by the user who uploaded it. It seems that the MEDIA_ROOT directory must be placed in the public www directory for front end web servers Apache to serve the file, which cu

Re: Loading data in migrations

2014-05-06 Thread J Y
I would like to know this also. Can anyone provide an example of how to do this in 1.7? The doc leaves a lot to the imagination. I'd be willing to help update the docs if there's guidance on what the official "sanctioned" approach is to replicate the same functionality, that behaves like the

Using IN clause with parameterized raw queries

2014-05-29 Thread J Y
Let say I have this query I would like to execute: SELECT username FROM users WHERE username NOT IN ('user_a', 'user_b', 'user_c') How do you run this using raw()? I've tried the following: cursor = connections["db"].cursor() cursor.execute("SELECT username FROM users WHERE username NOT IN (%s

Re: Using IN clause with parameterized raw queries

2014-05-29 Thread J Y
quot;, ['user_a', 'user_b', 'user_c']) > > Le jeudi 29 mai 2014 18:10:04 UTC-4, J Y a écrit : >> >> Let say I have this query I would like to execute: >> >> SELECT username FROM users WHERE username NOT IN ('user_a', 'u