Generate querysets from dynamically generated rules

Asked

Viewed 121 times

0

I’d like to make a sort of filter using Django. Imagine the following case:

  • Model: user (Name, sex, age, dia_nasciemnto, mes_nascimento, etc)
  • Rule: Catch all users with Sex=M and Age>20

The intention would be to generate rules from an Application and these rules would be several And and OR chained. If anyone can give me a north or tell me how they solved a problem similar to this and would be very grateful.

  • Your question is too comprehensive, comprehensive and/or vague questions will get answers of the same kind, so I think @Gregory’s answer is enough. The ideal would be for you to present some code and show where the doubt is.

2 answers

3

2


  • Man, thank you so much. Great job helping the community ! You can send me your contact so we can exchange idea ?

  • @Gabriel can search me on facebook, in the community of Python Brasil, I am administrator there. =)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.