Skip to content

[FR] Move attachments and images to a generic files model #5703

Closed
2 of 3 issues completed
Closed

Description

@matmair

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.

Files/Attachment related issues

Out of scope

Might also be interesting for #3101

Describe alternatives you've considered

Create an api-layer that simulates the same thing.

Examples of other systems

No response

Do you want to develop this?

  • I want to develop this.

Sub-issues

Sub-issues

2 of 3 Issues completed
Loading 3 sub-issues

Activity

  1. added
    enhancement
    triage:not-checked
    on Oct 16, 2023
  2. self-assigned this
    on Oct 16, 2023
  3. added
    part
    and removed
    triage:not-checked
    on Oct 16, 2023
  4. added this to the horizon milestone on Oct 16, 2023
  5. wolflu05 commented on Oct 16, 2023

    @wolflu05
    Member

    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.

  6. matmair commented on Oct 16, 2023

    @matmair
    MemberAuthor

    This is marked as horizon, I will probably only get this done by December or later.

  7. matmair commented on Oct 16, 2023

    @matmair
    MemberAuthor

    @wolflu05 that is part of the difficulty, there are some patterns around that behaviour that are core to how reports work (currently)

  8. SchrodingersGat commented on Oct 16, 2023

    @SchrodingersGat
    Member

    On board with this, needs to be handled very carefully but will be a great improvement in a number of areas

  9. modified the milestones: horizon, 0.15.0 on Feb 9, 2024
  10. matmair commented on Feb 9, 2024

    @matmair
    MemberAuthor

    Started work on this, targeting 0.15.0

  11. added
    Seeking Funding
    on Feb 9, 2024
  12. Petrox commented on Feb 9, 2024

    @Petrox
  13. 10 remaining items

  14. added this to the horizon milestone on Jul 5, 2024
  15. matmair commented on Aug 18, 2024

    @matmair
    MemberAuthor

    looking into this again @SchrodingersGat @wolflu05 what is your opinion on renaming attachments to files?

  16. wolflu05 commented on Aug 18, 2024

    @wolflu05
    Member

    Good idea, but then we need to first separate the concept of a link attachment and a file.

  17. matmair commented on Aug 18, 2024

    @matmair
    MemberAuthor

    How so? Linked files seem very helpful in general

  18. wolflu05 commented on Aug 18, 2024

    @wolflu05
    Member

    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.

  19. SchrodingersGat commented on Aug 18, 2024

    @SchrodingersGat
    Member

    @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.

  20. removed
    Seeking Funding
    on Mar 20, 2025
  21. changed the issue type fromtoon May 2, 2025
  22. added
    Seeking Funding
    on May 2, 2025
  23. matmair commented on May 2, 2025

    @matmair
    MemberAuthor

    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)

  24. Petrox commented on May 2, 2025

    @Petrox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Seeking Fundingenhancementpart

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions