Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CollectionItemFieldData object does not give access to custom keys / values #12

Open
barapa opened this issue Mar 6, 2024 · 1 comment

Comments

@barapa
Copy link

barapa commented Mar 6, 2024

Only name and slug are available.

class CollectionItemFieldData(pydantic.BaseModel):
    name: typing.Optional[str] = pydantic.Field(description="Name of the Item")
    slug: typing.Optional[str] = pydantic.Field(
        description="URL structure of the Item in your site. Note: Updates to an item slug will break all links referencing the old slug."
    )
@co-odw
Copy link

co-odw commented Jul 17, 2024

For anyone interested. Here is a temporary workaround..

# Monkey patch CollectionItemFieldData to support extra config (necessary to
# retrieve pydantic.Extra.allow reference from same pydantic reference used by
# webflow)
try:
    import pydantic.v1 as pydantic
except ImportError:
    import pydantic
from webflow import CollectionItemFieldData
CollectionItemFieldData.Config.extra = pydantic.Extra.allow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants