Does somebody know how to define the app a custom field belongs to?
Problem is in my case, on export-fixtures, I export all existing custom fields to my custom app. I’d like to limit these to only the app specific custom fields.
If you don’t mind editing the Custom Field doctype, you could in principle set something like this up using the filter parameter on the export fixtures command.
In practice, though, that’s a lot of work (maintaining the fork, etc.). A more typical workflow would just use an app-specific development site, without non-app custom fields. Alternately, you could export the customizations from the Customize Form tool and then just manually edit out the fields you don’t want included.
Yea, you’re right.
But in this case the problem is that I want to collect all custom fields belonging to a particular app.
These can create fields in various standard/custom doctypes. So the doctype in this case gives no clue to which app the custom field or script belongs.
Actually I think this would be a very helpful extension for the Core function (similar to doctype module field).
Here an example:
App 1:
|__ custom_field “field_A” in “Purchase Order”
|__ custom_script to evaluate in Purchase Order
App 2:
|__ custom_field “field_B” in “Purchase Order”
When I now call "bench --site app1.site export-fixtures
All custom_fields (from App1 AND App2) will be exported to App1, because in the hooks.py I cannot distinguish which custom_field belongs to App1 or not. The doctype is the same.
When I deploy App1 on a production server, all custom_fields will be deployed there: field_A and fieldB. Even though field_B is not related to App1.