You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FR] Move attachments and images to a generic files model #5703
Seeking FundingThis issue can be specifically funded for developmentenhancementThis is an suggested enhancement or new featurepartRelated to Part models
Please verify that this feature request has NOT been suggested before.
I checked and didn't find a similar feature request
Problem statement
Currently, files are handled by different attachment models and as "dumb" image attachments. This makes reusing and working with these files from code (core, plugins) difficult.
Suggested solution
Create a first-class citizen model for files with metadata and tags support. Migrate all attachments and images over.
Are these links always used for links to files? I actually never have used them for this case, as I always have downloaded the datasheet and uploaded it to inventree in case it gets removed from the internet, but this makes sense when thinking like this.
But if we rename it again, plugins that use attachments will break again. I think we should start treating such thinks like model names, function names, ... as stable things instead of renaming and moving them over and over.
@matmair can you help me understand where a more "generic" files model would be implemented? I had thought that the changes made already (bringing all attachments into a single table) was sufficient.
This would be a good target for 2.0; handling of files is implemented separately across different models. Unifying attachments was a great step but there are other files in the system.
Handling of files should also be exposed to plugins (like parsing them ie wireviz, displaying them ie. 3d model view. providing previews)
Seeking FundingThis issue can be specifically funded for developmentenhancementThis is an suggested enhancement or new featurepartRelated to Part models
Activity
wolflu05 commentedon Oct 16, 2023
I fully support this idea. This also enables us to use the Django files api with different backends rather than fiddling directly with the fs.
matmair commentedon Oct 16, 2023
This is marked as
horizon, I will probably only get this done by December or later.matmair commentedon Oct 16, 2023
@wolflu05 that is part of the difficulty, there are some patterns around that behaviour that are core to how reports work (currently)
SchrodingersGat commentedon Oct 16, 2023
On board with this, needs to be handled very carefully but will be a great improvement in a number of areas
matmair commentedon Feb 9, 2024
Started work on this, targeting 0.15.0
Petrox commentedon Feb 9, 2024
10 remaining items
matmair commentedon Aug 18, 2024
looking into this again @SchrodingersGat @wolflu05 what is your opinion on renaming
attachmentstofiles?wolflu05 commentedon Aug 18, 2024
Good idea, but then we need to first separate the concept of a link attachment and a file.
matmair commentedon Aug 18, 2024
How so? Linked files seem very helpful in general
wolflu05 commentedon Aug 18, 2024
Are these links always used for links to files? I actually never have used them for this case, as I always have downloaded the datasheet and uploaded it to inventree in case it gets removed from the internet, but this makes sense when thinking like this.
But if we rename it again, plugins that use attachments will break again. I think we should start treating such thinks like model names, function names, ... as stable things instead of renaming and moving them over and over.
SchrodingersGat commentedon Aug 18, 2024
@matmair can you help me understand where a more "generic" files model would be implemented? I had thought that the changes made already (bringing all attachments into a single table) was sufficient.
matmair commentedon May 2, 2025
This would be a good target for 2.0; handling of files is implemented separately across different models. Unifying attachments was a great step but there are other files in the system.
Handling of files should also be exposed to plugins (like parsing them ie wireviz, displaying them ie. 3d model view. providing previews)
Petrox commentedon May 2, 2025