~jcsackett/charmworld/bac-tag-constraints

« back to all changes in this revision

Viewing changes to charmworld/models.py

[r=sinzui][bug=][author=benji] - Remove useless try/except accidentally left in store_bundles from last
  branch
- add migration 018 which removes all bundles from the DB and ES (they
  will be repopulated at the next ingestion)
- add an explicit construct_search_id so it is easier to see the
  semantics of ID creation when reading the code

Show diffs side-by-side

added added

removed removed

Lines of Context:
1337
1337
    def id(self):
1338
1338
        return self.construct_id(self.owner, self.basket, self.name)
1339
1339
 
 
1340
    @classmethod
 
1341
    def construct_search_id(cls, owner, basket_id, name):
 
1342
        return cls.construct_id(owner, basket_id, name, use_revision=False)
 
1343
 
1340
1344
    @property
1341
1345
    def search_id(self):
1342
1346
        """Return the (revisionless) ID used to index the bundle for searches.
1343
1347
        """
1344
 
        return self.construct_id(
1345
 
            self.owner, self.basket, self.name, use_revision=False)
 
1348
        return self.construct_search_id(self.owner, self.basket, self.name)
1346
1349
 
1347
1350
    @property
1348
1351
    def short_url(self):