Hi guys,
I have a question. I have a a code like this:
where model_object is an instance of an Model.
for field in model_object._meta.fields:
field_type = type(field)
if field_type is not AutoField and \
field.name != "created" and \
>> Depending on the checkbox selection it might produce a sql string
>> like:
>> SELECT user_id FROM Bio WHERE (race='A' OR race='W' OR race='H') AND
>> (eye_color='B' OR eye_color='G' OR eye_color='H') AND (hair_color='W'
>> OR hair_color='B')
Though my solution would be logically about the same
> class Bio(models.Model):
> HEIGHT_CHOICES = (
> ('A',"< 5' (< 152cm)")
[snip]
> ,('Z',"7' 0'' (213cm)")
> ,('*',"> 7'' (> 213cm)")
> )
> WEIGHT_CHOICES = (('A',"<100lbs (<45kg)"),('B',"100lbs (45kg)")
I'm developing my first Django website where the users should be able
to search other user profiles based on certain paramaters like race,
age, gender, height, weight, eye color, hair color, etc
This is how my model looks: (code have been shortened to only include
the pertinent sections)
cl
On Tue, 2007-04-03 at 09:32 +0200, Atilla wrote:
> On 03/04/07, Honza Král <[EMAIL PROTECTED]> wrote:
> > something like this works for me...
> >
> > q = Q( tag__name=first_tag )
> > for tag in other_tags:
> > q = q | Q( tag__name=tag )
>
> What kind of query does this build BTW? Is it smart en
On 03/04/07, Honza Král <[EMAIL PROTECTED]> wrote:
> something like this works for me...
>
> q = Q( tag__name=first_tag )
> for tag in other_tags:
> q = q | Q( tag__name=tag )
What kind of query does this build BTW? Is it smart enough to put them
all into a "WHERE name IN ( all-your-tags-here) ?
something like this works for me...
q = Q( tag__name=first_tag )
for tag in other_tags:
q = q | Q( tag__name=tag )
Model.objects.filter( q )
On 4/2/07, Christian Hoppner <[EMAIL PROTECTED]> wrote:
>
> Hi there!
>
> I've been thinking about including in my new app a kind of tag browser. The
> u
Hi there!
I've been thinking about including in my new app a kind of tag browser. The
url is meant to be in the form of tags/A+B+C.
Of course I know I can use OR queries for this kind of stuff... When the query
string is constructed manually (as a string), I could simply get the tags
from the
gracias Jorge
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
Hi there k1000,
On 12/21/06, k1000 <[EMAIL PROTECTED]> wrote:
Is there any way to create dynamically key ( 'thiskey_exact' ) in query
object. eg:
Object.objects.filter(thiskey_exact = 'something')
I'll paste here an example from one project I have here:
Actividad.objects.filter(nombre_
Is there any way to create dynamically key ( 'thiskey_exact' ) in query
object. eg:
Object.objects.filter(thiskey_exact = 'something')
Thanx.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django
users" group
11 matches
Mail list logo