Skip to content
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

Rename the Link class to File #147

Closed
14 tasks done
eoyilmaz opened this issue Jan 10, 2025 · 0 comments · Fixed by #148
Closed
14 tasks done

Rename the Link class to File #147

eoyilmaz opened this issue Jan 10, 2025 · 0 comments · Fixed by #148
Assignees
Labels
enhancement feature Feature request
Milestone

Comments

@eoyilmaz
Copy link
Owner

eoyilmaz commented Jan 10, 2025

User Story

As the developer of Stalker I want to rename the Link class to File as it is what the 99% of the time it is, the current naming is making it hard to think around the Links as a file and build stuff with it (i.e. the new representation logic in Anima Library).

Acceptance Criteria

  • Update the Link class:
    • Rename it to File.
    • Rename the stalker.models.link module to stalker.models.file.
    • Move Version.inputs to File.references (using the ReferenceMixin) this should track the individual references of that file which can be different for each File that are present in the Version.files attribute.
  • Update the Version class:
    • It should not derive from Link but Entity, so that the Version will not have a file path stored in the DB anymore.
    • add a files attribute that stores the related File instances.
    • Move the created_with attribute to the File class.
    • Move the inputs attribute to File class as the references attribute (with the ReferencesMixin).
    • Remove the outputs attribute. Version.files should be used instead.
    • Rename Version.update_paths() to generate_path() which generates a Path instance instead of setting the now deleted filename and path variables.
  • Update ReferenceMixin:
    • Secondary column should be called reference_id.
    • Add a primary_join and a seconday_join to the relationship so that it is possible to add references to File class, which at the end is going to reference itself.
@eoyilmaz eoyilmaz self-assigned this Jan 10, 2025
@eoyilmaz eoyilmaz added enhancement feature Feature request labels Jan 10, 2025
@eoyilmaz eoyilmaz added this to the 1.1 milestone Jan 10, 2025
eoyilmaz added a commit that referenced this issue Jan 13, 2025
eoyilmaz added a commit that referenced this issue Jan 13, 2025
eoyilmaz added a commit that referenced this issue Jan 14, 2025
….py` to reflect the change in class name.
eoyilmaz added a commit that referenced this issue Jan 14, 2025
…ng the `File.references` attribute.

* [#147] Moved the `created_with` attribute from `Version` to `File`.
* [#147] Removed the `Version.walk_inputs()` method.
* [#147] Added the `File.walk_references()` method.
* [#147] Updated `ReferenceMixin`:
  * [#147] Added the `primaryjoin` and `secondaryjoin` arguments on the relation, so that the `File` class can reference itself as it is also now deriving from `ReferenceMixin`.
  * [#147] Renamed the secondary column from `file_id` to `reference_id` which makes more sense and allows the `File` class to derive from `ReferenceMixin` too.
* [#147] Updated `Daily.versions` and `Daily.tasks` properties to query the `Version` instances over the new `Version.files` attribute instead of the removed `Version.output` attribute.
* [#147] Updated `Version` class:
  * [#147] It is now deriving from `Entity` instead of `File`, so it doesn't have any file related attributes anymore.
  * [#147] Removed the `inputs` and `outputs` attributes and introduced the `files` attribute to store `File` instances.
  * [#147] Renamed `Version.updated_paths()` to `Version.generate_path()` which now returns a `pathlib.Path` instance that is to be used with `File` instances, as the `Version` instance cannot store path values anymore.
  * [#147] The `absolute_full_path`, `absolute_path`, `full_path`, `path` and `filename` are now just properties returning data generated by the `Version.generate_path()` method. Which will be less useful as these properties are returning generated data and not stored ones.
eoyilmaz added a commit that referenced this issue Jan 14, 2025
@eoyilmaz eoyilmaz linked a pull request Jan 14, 2025 that will close this issue
eoyilmaz added a commit that referenced this issue Jan 17, 2025
eoyilmaz added a commit that referenced this issue Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feature Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant