Giter Club home page Giter Club logo

Comments (2)

tsauerwein avatar tsauerwein commented on August 17, 2024

_get_fields_with_property only return top level excludes which is good because sub level excludes should be mixed with overrides parameters

So you are ok with the current behavior?

I see three solutions on how to deal with this problem that the admin_only property is only taken into account for fields on the main model:

  1. It's not a bug, it's a feature. If the user wants to exclude fields for child models, he/she has to set 'overrides'. Which is confusing in my opinion.
  2. Check for the admin_only recursively and and set the excludes with the overrides property for child models when creating the schema. The problem is that the user might provide a custom overridesobject, so we would have to merge the user overrides with our overrides. This might be tricky but doable.
  3. Remove the admin_only property. The user would have to specify the includes or excludes via the overrides property. This also allows to hide fields in the user views.

Opinions welcome!

from c2cgeoform.

tsauerwein avatar tsauerwein commented on August 17, 2024

We agreed to go for option 3, because it should be possible to use the same model with different schemas. And because this is also the way you would do it when directly using ColanderAlchemy.

from c2cgeoform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.