Coder Social home page Coder Social logo

Comments (3)

sveneberth avatar sveneberth commented on June 5, 2024

Interesting feature/idea!
I think we have to implement this as a new parameter referencedBy (or something like that). Valid values could be a positive int to limit the references from this kind or -1 for infinity.
Maybe we need several severities for this:

  • Reference only n-times with the same using-skel-values
  • or only n-times in general, independently from the using-skel-values.

The validation could count the entities in the viur-relations kind with the actually src-kind and dest-relation - this should be straightforward, or not?

from viur-core.

tsteinruecken avatar tsteinruecken commented on June 5, 2024

Not sure what you actually trying to archive. You have Kind A and B, both with entities a and b. You add relations from Entity A-a to entities B-a and B-b. Do you want to prevent another entity like A-b to also reference any of B-a and B-b? Then use unique with SameValue. Or do you want to prevent A-a from referencing B-a twice within the same relation? Then just add an test to interBoneValidations.

from viur-core.

phorward avatar phorward commented on June 5, 2024

@tsteinruecken please provide an example for this. I just want a relationalBone, where only one relation can be created for each target entity. E.g. in a userBone(), I currently can select the same user twice. This should be avoided by this bone, which either accepts the entry when it's currently not linked, or either replaces or rejects it when it's already there.

from viur-core.

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.