~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/model/bugtask.py

  • Committer: Guilherme Salgado
  • Date: 2010-07-23 08:50:49 UTC
  • mfrom: (11206 launchpad)
  • mto: This revision was merged to the branch mainline in revision 11220.
  • Revision ID: salgado@canonical.com-20100723085049-4m2tmvujxsw2ns40
mergeĀ mainline

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from storm.expr import And, Alias, AutoTables, In, Join, LeftJoin, Or, SQL
31
31
from storm.sqlobject import SQLObjectResultSet
 
32
from storm.store import EmptyResultSet
32
33
from storm.zope.interfaces import IResultSet, ISQLObjectResultSet
33
34
 
34
35
import pytz
1462
1463
    def findSimilar(self, user, summary, product=None, distribution=None,
1463
1464
                    sourcepackagename=None):
1464
1465
        """See `IBugTaskSet`."""
 
1466
        if not summary:
 
1467
            return EmptyResultSet()
1465
1468
        # Avoid circular imports.
1466
1469
        from lp.bugs.model.bug import Bug
1467
1470
        search_params = BugTaskSearchParams(user)
1482
1485
        else:
1483
1486
            raise AssertionError('Need either a product or distribution.')
1484
1487
 
1485
 
        if not summary:
1486
 
            return BugTask.select('1 = 2')
1487
 
 
1488
1488
        search_params.fast_searchtext = nl_phrase_search(
1489
1489
            summary, Bug, ' AND '.join(constraint_clauses), ['BugTask'])
1490
1490
        return self.search(search_params)
2069
2069
            ', '.join(tables), ' AND '.join(clauses))
2070
2070
        return clause
2071
2071
 
2072
 
 
2073
2072
    def search(self, params, *args):
2074
2073
        """See `IBugTaskSet`."""
2075
2074
        store_selector = getUtility(IStoreSelector)