Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

example peewee_simple.py won't run (AttributeError: 'Metadata' object has no attribute 'rel') #179

@maxbellec

Description

@maxbellec

by running the example peewee_simple.py as is, I get

$ python peewee_simple.py
Traceback (most recent call last):
  File "peewee_simple.py", line 42, in <module>
    api.add_resource(BookResource)
  File "/home/m/.local/share/virtualenvs/pano-vehicle-version-config-api-JCsed19j/lib/python3.6/site-packages/flask_potion/__init__.py", line 215, in add_resource
    resource.manager = self.default_manager(resource, resource.meta.get('model'))
  File "/home/m/.local/share/virtualenvs/pano-vehicle-version-config-api-JCsed19j/lib/python3.6/site-packages/flask_potion/contrib/peewee/manager.py", line 26, in __init__
    super(PeeweeManager, self).__init__(resource, model)
  File "/home/m/.local/share/virtualenvs/pano-vehicle-version-config-api-JCsed19j/lib/python3.6/site-packages/flask_potion/manager.py", line 27, in __init__
    self._init_model(resource, model, resource.meta)
  File "/home/m/.local/share/virtualenvs/pano-vehicle-version-config-api-JCsed19j/lib/python3.6/site-packages/flask_potion/contrib/peewee/manager.py", line 63, in _init_model
    if column.primary_key or name in model._meta.rel:
AttributeError: 'Metadata' object has no attribute 'rel'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions