-
Notifications
You must be signed in to change notification settings - Fork 1
Adding profcomff#10 and profcomff#6 #11
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
Merged
Merged
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
7274c3d
Adding #10
Wudext f2fbb3b
Adding #10
Wudext fb3d11d
Fixing
Wudext 9c687e4
Delete workspace.xml
Wudext 8788f75
Delete .idea directory
Wudext 47f3744
Update button.py
Wudext b7b06a1
Merge branch 'Adding-#10' of https://github.com/Wudext/services-api i…
Wudext 68a2e3c
Fixing
Wudext c3fe104
Fixing tests
Wudext e953dd1
Update .gitignore
Wudext 5309f9a
Update 670f4caac7dd_init.py
Wudext 97fe09a
Update 28d38f9e2e65_.py
Wudext 79ef359
Update conftest.py
Wudext ecc46ab
Update button.py
Wudext b52308e
Update category.py
Wudext e97c2dc
Tests
Wudext b57f513
Fixing
Wudext 714cada
migrations + drop db fix
parfenovma ec9f951
Adding tests
Wudext 7a3e37e
Merge branch 'Adding-#10' of https://github.com/Wudext/services-api i…
Wudext e0f525f
2-step-migrations
parfenovma da977ae
Tests release
Wudext 91d4070
Merge branch 'Adding-#10' of https://github.com/Wudext/services-api i…
Wudext d407505
Changing logics
Wudext 59f7247
Fixing
Wudext a72e1cc
Delete 4ea57f3ba3ed_.py
Wudext 2cce4d1
Tests initialisation
Wudext 5522c9c
Update category.py
Wudext 0ab58bc
Spaces (xd)
Wudext f55319d
REST routes
Wudext d03ce1b
Fixing tests
Wudext 08d0084
Update button.py
Wudext 832f3a3
Backend Initialisation
Wudext 50b9832
Update category.py
Wudext c744675
Delete .idea directory
Wudext 6b3d2ab
Update button.py
Wudext 5a5cffd
Fixing
Wudext bdff039
Merge branch 'Adding-#10' of https://github.com/Wudext/services-api i…
Wudext dca9171
Flake8 and Black
Wudext File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -126,4 +126,4 @@ venv.bak/ | |
| dmypy.json | ||
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
| .pyre/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| """order | ||
|
|
||
| Revision ID: 6a486347af93 | ||
| Revises: 670f4caac7dd | ||
| Create Date: 2023-02-11 10:18:11.179485 | ||
|
|
||
| """ | ||
| from alembic import op | ||
| import sqlalchemy as sa | ||
|
|
||
|
|
||
| # revision identifiers, used by Alembic. | ||
| revision = '6a486347af93' | ||
| down_revision = '670f4caac7dd' | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade(): | ||
| op.add_column('button', sa.Column('order', sa.Integer(), nullable=False)) | ||
| op.add_column('button', sa.Column('link', sa.String(), nullable=False)) | ||
| op.add_column('button', sa.Column('type', sa.String(), nullable=False)) | ||
| op.alter_column('button', 'name', existing_type=sa.VARCHAR(), nullable=False) | ||
| op.alter_column('button', 'category_id', existing_type=sa.INTEGER(), nullable=False) | ||
| op.alter_column('button', 'icon', existing_type=sa.VARCHAR(), nullable=False) | ||
| op.add_column('category', sa.Column('order', sa.Integer(), nullable=False)) | ||
| op.alter_column('category', 'name', existing_type=sa.VARCHAR(), nullable=False) | ||
| op.alter_column('category', 'type', existing_type=sa.VARCHAR(), nullable=False) | ||
|
|
||
|
|
||
| def downgrade(): | ||
| # ### commands auto generated by Alembic - please adjust! ### | ||
| op.alter_column('category', 'type', existing_type=sa.VARCHAR(), nullable=True) | ||
| op.alter_column('category', 'name', existing_type=sa.VARCHAR(), nullable=True) | ||
| op.drop_column('category', 'order') | ||
| op.alter_column('button', 'icon', existing_type=sa.VARCHAR(), nullable=True) | ||
| op.alter_column('button', 'category_id', existing_type=sa.INTEGER(), nullable=True) | ||
| op.alter_column('button', 'name', existing_type=sa.VARCHAR(), nullable=True) | ||
| op.drop_column('button', 'type') | ||
| op.drop_column('button', 'link') | ||
| op.drop_column('button', 'order') | ||
| # ### end Alembic commands ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,23 @@ | ||
| from sqlalchemy import Column, Integer, String, ForeignKey | ||
| from sqlalchemy.orm import relationship | ||
| from __future__ import annotations | ||
| from sqlalchemy import Integer, String, ForeignKey | ||
| from sqlalchemy.orm import relationship, Mapped, mapped_column | ||
| from .base import Base | ||
|
|
||
|
|
||
| class Category(Base): | ||
| id = Column(Integer, primary_key=True) | ||
| name = Column(String) | ||
| type = Column(String) | ||
| buttons = relationship("Button", back_populates="category", foreign_keys="Button.category_id") | ||
| id: Mapped[int] = mapped_column(Integer, primary_key=True) | ||
| order: Mapped[int] = mapped_column(Integer, default=1) | ||
| name: Mapped[str] = mapped_column(String) | ||
| type: Mapped[str] = mapped_column(String) | ||
| buttons: Mapped[list[Button]] = relationship("Button", back_populates="category", foreign_keys="Button.category_id") | ||
|
|
||
|
|
||
| class Button(Base): | ||
| id = Column(Integer, primary_key=True) | ||
| name = Column(String) | ||
| category_id = Column(Integer, ForeignKey(Category.id)) | ||
| category = relationship("Category", back_populates="buttons", foreign_keys=[category_id]) | ||
| icon = Column(String) | ||
| id: Mapped[int] = mapped_column(Integer, primary_key=True) | ||
| name: Mapped[str] = mapped_column(String) | ||
| order: Mapped[int] = mapped_column(Integer, default=1) | ||
| category_id: Mapped[int] = mapped_column(Integer, ForeignKey(Category.id)) | ||
| category: Mapped[Category] = relationship("Category", back_populates="buttons", foreign_keys=[category_id]) | ||
| icon: Mapped[str] = mapped_column(String) | ||
| link: Mapped[str] = mapped_column(String) | ||
| type: Mapped[str] = mapped_column(String) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.