Re: Need to search through several tables using one model

2014-12-16 Thread Collin Anderson
Hi, The new link isn't working either. Collin On Monday, December 15, 2014 8:45:10 AM UTC-5, Damjan Dimitrioski wrote: > > Oh, sorry about that, it was se to an hour, here is an updated one: > https://dpaste.de/q9sq > > On Mon, Dec 15, 2014 at 2:13 PM, Vijay Khemlani >

Re: Need to search through several tables using one model

2014-12-15 Thread Damjan Dimitrioski
Oh, sorry about that, it was se to an hour, here is an updated one: https://dpaste.de/q9sq On Mon, Dec 15, 2014 at 2:13 PM, Vijay Khemlani wrote: > > The dpaste link is broken > > On Mon, Dec 15, 2014 at 9:48 AM, Damjan Dimitrioski < > damjandimitrio...@gmail.com> wrote: > >>

Re: Need to search through several tables using one model

2014-12-15 Thread Vijay Khemlani
The dpaste link is broken On Mon, Dec 15, 2014 at 9:48 AM, Damjan Dimitrioski < damjandimitrio...@gmail.com> wrote: > > I wrapped something like this: > https://dpaste.de/4WTq > > However, I'm not able to see any results in the changelist view, but the > get_query_set method prints the query

Re: Need to search through several tables using one model

2014-12-15 Thread Damjan Dimitrioski
I wrapped something like this: https://dpaste.de/4WTq However, I'm not able to see any results in the changelist view, but the get_query_set method prints the query results in the STDOUT, what I'm doing wrong ? On Sat, Dec 13, 2014 at 11:27 PM, Damjan Dimitrioski < damjandimitrio...@gmail.com>

Re: Need to search through several tables using one model

2014-12-13 Thread Damjan Dimitrioski
The search filter above the change list view template, there is a button named search I think, I think it's need to overriden in order to implement custom model or something. On Sat, Dec 13, 2014 at 11:06 PM, Vijay Khemlani wrote: > > What search button are you talking about?

Re: Need to search through several tables using one model

2014-12-13 Thread Vijay Khemlani
What search button are you talking about? On Sat, Dec 13, 2014 at 2:23 PM, Alon Nisser wrote: > > You could also create a model that foreign keys to all the relevant > models, and filter on that.. > Buy first you need to clarify (for your self..) The exact use case: is it >

Re: Need to search through several tables using one model

2014-12-13 Thread Alon Nisser
You could also create a model that foreign keys to all the relevant models, and filter on that.. Buy first you need to clarify (for your self..) The exact use case: is it search? if so better use haystack with some search backend (elasticsearch would be a great choice), Is it to choose

Re: Need to search through several tables using one model

2014-12-13 Thread Damjan Dimitrioski
Can I override the search button, so it will call the custom raw query ? And if yes, can you show me how to override it, please ? On Friday, December 12, 2014 5:41:08 PM UTC+1, Vijay Khemlani wrote: > > Just using the ORM I think not > > You could > > 1. Make a raw sql query using UNIONs for each

Re: Need to search through several tables using one model

2014-12-12 Thread Vijay Khemlani
Just using the ORM I think not You could 1. Make a raw sql query using UNIONs for each table 2. Make a common superclass for the models with th search field 3. Use an external search engine (elasticsearch, etc) and store the entries for the required models under the same index. Finally, you

Need to search through several tables using one model

2014-12-12 Thread Damjan Dimitrioski
Hi, Is there a way to make a model that links several db tables in one model, so that can be used in a change list view ? Most importantly, I need to be able to use the search field, can this be accomplished ? Regards. -- You received this message because you are subscribed to the Google