~ltrager/maas/remove_tgt

« back to all changes in this revision

Viewing changes to src/maasserver/models/largefile.py

  • Committer: Lee Trager
  • Date: 2017-06-16 14:58:15 UTC
  • mfrom: (6086.1.1 rootfs_over_http)
  • Revision ID: lee.trager@canonical.com-20170616145815-yn4st7207mdzp0k8
Merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
        referencing this object.
150
150
        """
151
151
        links = [
152
 
            rel.get_accessor_name()
153
 
            for rel in self._meta.get_all_related_objects()
 
152
            f.get_accessor_name() for f in self._meta.get_fields()
 
153
            if ((f.one_to_many or f.one_to_one) and
 
154
                f.auto_created and not f.concrete)
154
155
        ]
155
156
        for link in links:
156
157
            if getattr(self, link).exists():