Many to Many field with a context field which is another relation? #22356
wiz256
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
I have collections:
cities(id, name)routes(id, name)routeCityStops(id, routeId, cityId, address, departureTime)routeFares(routeId, cityFromId, cityToId, priceValue)What is the best way to show in
routesitem details allrouteFaresbelonging to this route as a table with ability to add/modify routeFare records?Many2Many did not help me because
routeFareshas 3 relations (because of cityFromId, cityToId and routeId).How to properly configure such setup for model with Route and RouteFares?
Motivation
Need to support "tripple" relationship like for
routeCityStopsin:cities(id, name)routes(id, name)routeCityStops(id, routeId, cityId, address, departureTime)routeFares(routeId, cityFromId, cityToId, priceValue)Requirements List
Basically I want:
routeitem details page to see allrouteFaresrelated to this route with cityFrom, cityTo and price valuesrouteFaresrecord is added fromroutesitem details page thenrouteFaresshould getrouteIdautomatically set (as we are on that route details page already).routeFaresrecord from either from withinroutesitem details page of fromrouteFareslist page we should be able to select only those fromCityId and toCityId which were assigned as available stops throughrouteCityStopscollection.Alternatives
Maybe there is already some easy way how to configure it.
All reactions