-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle relationships better #5
Comments
@simonhamp This would be really useful! |
Also at the moment the whole import crashes (returns a 404 on the JSON preview link) when using a resource with any BelongsTo relationships. |
@simonhamp thanks a lot for this great package. I understand that working with relationships is a bit more complex, so far I think that a workaround would be to create a temporary table where to import the data and after it is persistent in the DB we can create a command to handle it as we wish and create models with its relationships. The best way would be using events, although I've checked and when saving new data to this import table is not firing any saved event, how can it be added?, can it be done through the custom import class you mention in the docs or it would need some extra work? Thanks |
@simonhamp I'm getting a 404 for my Tree resource as many others are, probably becasue it belongs to Site, Species, and Supervisor. The species should be optional, but the other two are required, and as I'm not given any sort of Nova Action-esque way to prompt the user for those fields they cannot be provided. The functionality you described in this issue would be amazing, because that import CSV is coming from ArcGIS which has no clue what the IDs are. Can I throw some money your way to get this working? LMK what sort of sponsorship you need. |
@philsturgeon that would be super awesome What would be ideal from my POV so I can get cracking on this one with less setup is:
In terms of sponsorship, it's entirely up to you - I'd really appreciate some ongoing support (even a small amount) as this would allow me to continue improving the package 🙏 But if you prefer a one-off just to get this feature out, I will leave it up to you to determine the value. I suspect it will take me a couple of days to polish it off and maybe work through some testing with you |
Hi i have some POC. Idea is that on save dynamically i will get if attribute is relation and if it is i will search it's name and add it. P.S. maybe this is wrong place ?! class Importer
|
For BelongsTo relationships it would be great to be able to make the relationship where the name matches an existing related resource, even to have the option to create records that don't exist.
At the moment, you have to know the ID of the related resource and update your CSV before you upload it.
The text was updated successfully, but these errors were encountered: