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

Make @types endpoint include an 'omitted' attribute. #226

Closed
wants to merge 1 commit into from

Conversation

lukasgraf
Copy link
Member

@lukasgraf lukasgraf commented Mar 3, 2017

This will serialize Tagged Values from the omitted and no_omit plone.autoform directives in the @types endpoint.


One case that isn't handled yet is the ability to omit fields only for a particular type of form:

    form.omitted('edit_only')
    form.no_omit(IEditForm, 'edit_only')
    edit_only = schema.TextLine(
        title = u'Only included on edit forms',
        )

This is not specific to omitted fields though, this applies to other directives as well, mode() for example also allows for this.

@buchi
Copy link
Member

buchi commented Mar 3, 2017

Wouldn't it be better to just omit fields if they are tagged with the omitted directive? Same question applies to permissions (#227). This way we're exposing more information.

@lukasgraf PR needs rebase

@lukasgraf lukasgraf force-pushed the tgv-omitted-fields branch from 1addb82 to 31f0fa1 Compare March 4, 2017 08:53
@lukasgraf
Copy link
Member Author

@buchi good point.

My initial though was that the omitted flag is a form-level hint, and doesn't necessarily apply to the schema as a whole. Fields can still be present in the schema, but the hint suggests they should be omitted from a particular form. This way, the client would get the full information, and it's left up to the what exactly to do with that.

But yes, we do indeed expose more information that way then a regular Plone would.

I don't feel to strongly about this either way - @ebrehault @tisto thoughts?

@lukasgraf
Copy link
Member Author

Superseded by #237

@lukasgraf lukasgraf closed this Mar 4, 2017
@tisto tisto removed the in progress label Mar 4, 2017
@tisto tisto deleted the tgv-omitted-fields branch March 21, 2018 21:25
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

Successfully merging this pull request may close these issues.

3 participants