I have two tables, `image` and `restaurant`. I've set up a many-to-many relationship between them.

Here are the relevant parts of the table definitions:

```
images_assoc = Table('restaurant_image_assoc', Base.metadata,
        Column('restaurant', Integer(unsigned=True),
            ForeignKey('restaurant.id')),
        Column('image', Integer(unsigned=True),
            ForeignKey('image.id')))

class Image(Base):
    __tablename__ = 'image'
    id = Column(Integer(unsigned=True), primary_key=True)
    reports = Column(TinyInt, nullable=False, default=0)
    created_at = Column(DateTime, default=datetime.now)

class Restaurant(Base):
    __tablename__ = 'restaurant'
    id = Column(Integer(unsigned=True), primary_key=True)
    images = relationship(Image, secondary=images_assoc)

```

I need to delete a row in `image`, but of course I need to delete all the rows in `restaurant_image_assoc` that point to it first. How do I do this?

I tried this:

```
request.db.query(images_assoc)\
        .filter(images_assoc.c.image==image.id).delete()
request.db.delete(image)
request.db.commit()

```

Where `image` is the row I want to delete, but I get this error:

```
AttributeError: 'Table' object has no attribute 'class_'

```