Skip to content

Feat/155 change of folder architecture#157

Open
DominikDab341 wants to merge 17 commits intomasterfrom
feat/155-change-of-folder-architecture
Open

Feat/155 change of folder architecture#157
DominikDab341 wants to merge 17 commits intomasterfrom
feat/155-change-of-folder-architecture

Conversation

@DominikDab341
Copy link
Contributor

@DominikDab341 DominikDab341 commented Feb 21, 2026

Zmieniłem architekturę folderów, dodałem parę testów i migrację, która powinna stworzyć root foldery dla istniejących już użytkowników. Zmergowałem również kod Wiktora, który implementuje endpointy library i model SharedFolder. Zrefactorowałem go tak, żeby była jedna klasa APIView zajmująca się tą logiką (dopiero po fakcie zobaczyłem, że sposób, którym zrobił był opisany przez Sarę więc jeżeli należy to zmienić to zmienię ).


Important

Refactor folder architecture by introducing Folder and SharedFolder models, renaming maintainer to creator, and updating views, serializers, and tests accordingly.

  • Folder Architecture:
    • Introduced Folder model in models.py with fields for name, owner, parent, created_at, and updated_at.
    • Added SharedFolder model for sharing folders with users or study groups.
    • Created migrations 0004_folder_quiz_folder.py, 0017_sharedfolder.py, and 0021_create_root_folders.py to set up folder structure and root folders for users.
  • Model Changes:
    • Renamed maintainer to creator in Quiz model and updated related fields and permissions.
    • Updated Quiz model to include a folder field, linking quizzes to folders.
  • View and Serializer Updates:
    • Updated QuizViewSet and FolderViewSet to handle folder-related operations and permissions.
    • Added LibraryView to handle library endpoints for accessing folders and quizzes.
    • Updated serializers to include folder information and handle new permissions.
  • Permissions:
    • Updated permissions to reflect folder ownership and sharing capabilities.
    • Added checks for folder and quiz edit permissions based on ownership and sharing.
  • Tests:
    • Added and updated tests in tests/ to cover new folder architecture, permissions, and library endpoints.
    • Ensured tests reflect changes in folder structure and quiz ownership logic.

This description was created by Ellipsis for ac52c07. You can customize this summary. It will automatically update as commits are pushed.

@DominikDab341 DominikDab341 linked an issue Feb 21, 2026 that may be closed by this pull request
@Antoni-Czaplicki Antoni-Czaplicki marked this pull request as draft February 23, 2026 18:10
@Antoni-Czaplicki
Copy link
Member

awaiting architecture discussion

@DominikDab341 DominikDab341 marked this pull request as ready for review March 3, 2026 15:18
Copy link
Collaborator

@MoonPrincess06 MoonPrincess06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poza tym jednym komentarzu, co zostawiłam, nie rzuca mi się nic takiego w oczy

Comment on lines 155 to 161
def get_queryset(self):
return (
Quiz.objects.filter(sessions__user=self.request.user, sessions__is_active=True)
.select_related("maintainer")
.order_by("-sessions__updated_at")
.distinct()
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tu wciąż szukamy maintainera. Trzeba to zmienić na ownera

Copy link
Collaborator

@MoonPrincess06 MoonPrincess06 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Zmiana architektury folderów

4 participants