inheritance - Filtering a Class and Subclass in Django -


I have a project with an FAQ application I frequently asked questions in the app (written by site authors ) And the userfox (written by users - not just a clever name) I want to return all the entries, frequently asked questions or userfires which match the conditions, but I would like to exclude any userfixes What special Do not match Andndon. Ideally, something looks like:

  faqs = FAQ. Biesesfilter (question__icontains = search) .exclude (show_on_site = false)  

Where "Show_on_site" is such a property that is only userfive objects, it does not work because the filter exits on the original class, because this property is not found. What is the best way to do this? I came across, but I think that's what I want to do to feel like overkill.

In your situation, there are two tables absent, I have a common question model / host in which I_user_faq And show_on_site fields are included.

Sometimes it helps data to organize data for easy and fast access. Having some appeal to the model heritage, I have found that it is often easier to avoid using it.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -