Giter Site home page Giter Site logo

Comments (5)

inactivist avatar inactivist commented on June 25, 2024

This raises a related feature: Support for a list of objectid types validated against some collection (all objectid items in the list must exist in some collection.

Should this require writing a custom Validator? (Using a custom Validator may be the correct solution, but I don't know enough to decide.)

This case could be handled in the application using a callable validation function if that capability exists.

from eve.

nicolaiarocci avatar nicolaiarocci commented on June 25, 2024

Thanks, this is needed indeed. I'm going work on it in a few days, as soon as I'm done with the first documentation draft.

from eve.

cudevmaxwell avatar cudevmaxwell commented on June 25, 2024

Working on this now.

from eve.

nicolaiarocci avatar nicolaiarocci commented on June 25, 2024

How about somethig like this:

'owner': {
            'type': 'objectid',
            'required': True,
            'data_relation': {
                'resource': 'people',
                'field': '_id'
            }
        },

At the cost of a little complexity The data_relation keyword would allow to specify both the parent collection and the linked field, allowing for some flexibility (you can reference non-primary key fields).

from eve.

inactivist avatar inactivist commented on June 25, 2024

That looks like a simple and workable solution.

from eve.

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.