'Given the name of an attribute (depends_on or needed_by), either yields
a list of migration objects representing it, or errors out.'

def _get_dependency_objects(self, attrname):

    for (app, name) in getattr(self.migration_class(), attrname, []):
        try:
            migrations = Migrations(app)
        except ImproperlyConfigured:
            raise exceptions.DependsOnUnmigratedApplication(self, app)
        migration = migrations.migration(name)
        try:
            migration.migration()
        except exceptions.UnknownMigration:
            raise exceptions.DependsOnUnknownMigration(self, migration)
        if (migration.is_before(self) == False):
            raise exceptions.DependsOnHigherMigration(self, migration)
        (yield migration)
