Mutable.associate_with does not return anything (just fix the docs)

Issue #2118 resolved
Former user created an issue

sqlalchemy.ext.mutable:Mutable.associate_with(...) is supposed to return an sqltype according to:

http://hg.sqlalchemy.org/sqlalchemy/file/eb4a843318b4fa76d238c43a293d64af64ca1148/lib/sqlalchemy/ext/mutable.py#l114

But it doesn't return anything:

http://hg.sqlalchemy.org/sqlalchemy/file/eb4a843318b4fa76d238c43a293d64af64ca1148/lib/sqlalchemy/ext/mutable.py#l426

In its current state, the example yields this error:

      ...
      File "/Users/shazow/projects/myproject/myproject/model/objects.py", line 546, in Annotation
        data = Column(mytypes.MutationDict.associate_with(mytypes.JSONEncodedDict))
      File "/Users/shazow/env/myproject/lib/python2.7/site-packages/sqlalchemy/schema.py", line 777, in __init__
        raise exc.ArgumentError("'type' is required on Column objects "
    sqlalchemy.exc.ArgumentError: 'type' is required on Column objects which have no foreign keys.
  • shazow

Comments (4)

  1. Former user Account Deleted

    Or perhaps the example needs to be updated to use Mutable.as_mutable(...) instead?

  2. Log in to comment