Made several admin commands handle multi-word global searching; defined a new search function on objects.model for global name searching.

/Griatch
This commit is contained in:
Griatch 2009-10-21 18:42:52 +00:00
parent d8787bfc70
commit 9b6bd7125f
3 changed files with 40 additions and 31 deletions

View file

@ -145,8 +145,9 @@ class ObjectManager(models.Manager):
o_query = self.filter(name__iexact=ostring)
else:
o_query = self.filter(name__icontains=ostring)
if limit_types:
o_query = o_query.include(type__in=limit_types)
if limit_types is not False:
for limiter in limit_types:
o_query.filter(type=limiter)
return o_query.exclude(type__in=[defines_global.OTYPE_GARBAGE,
defines_global.OTYPE_GOING])