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
-
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
routes
item details allrouteFares
belonging to this route as a table with ability to add/modify routeFare records?Many2Many did not help me because
routeFares
has 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
routeCityStops
in:cities
(id, name)routes
(id, name)routeCityStops
(id, routeId, cityId, address, departureTime)routeFares
(routeId, cityFromId, cityToId, priceValue)Requirements List
Basically I want:
route
item details page to see allrouteFares
related to this route with cityFrom, cityTo and price valuesrouteFares
record is added fromroutes
item details page thenrouteFares
should getrouteId
automatically set (as we are on that route details page already).routeFares
record from either from withinroutes
item details page of fromrouteFares
list page we should be able to select only those fromCityId and toCityId which were assigned as available stops throughrouteCityStops
collection.Alternatives
Maybe there is already some easy way how to configure it.
Beta Was this translation helpful? Give feedback.
All reactions