Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chaos Parcel Service
backend
Commits
2c2e558b
Verified
Commit
2c2e558b
authored
1 year ago
by
hanfi
Browse files
Options
Downloads
Patches
Plain Diff
add item amount
parent
d8c869eb
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/models.py
+2
-1
2 additions, 1 deletion
backend/models.py
backend/schemas.py
+9
-12
9 additions, 12 deletions
backend/schemas.py
with
11 additions
and
13 deletions
backend/models.py
+
2
−
1
View file @
2c2e558b
...
...
@@ -3,6 +3,7 @@ from uuid import uuid4
from
sqlalchemy
import
Column
as
sql_Column
from
sqlalchemy
import
DateTime
as
sql_DateTime
from
sqlalchemy
import
ForeignKey
as
sql_ForeignKey
from
sqlalchemy
import
Integer
as
sql_Integer
from
sqlalchemy
import
LargeBinary
as
sql_LargeBinary
from
sqlalchemy
import
String
as
sql_String
from
sqlalchemy
import
Uuid
as
sql_Uuid
...
...
@@ -16,8 +17,8 @@ class Item(db_Base):
__tablename__
=
"
items
"
uuid
=
sql_Column
(
sql_Uuid
,
primary_key
=
True
,
default
=
uuid4
)
amount
=
sql_Column
(
sql_Integer
,
default
=
1
)
created_at
=
sql_Column
(
sql_DateTime
(
timezone
=
True
),
server_default
=
sql_now
())
received_at
=
sql_Column
(
sql_DateTime
(
timezone
=
True
),
nullable
=
True
,
default
=
None
)
addressee
=
sql_Column
(
sql_String
(
64
),
nullable
=
True
,
default
=
None
)
...
...
This diff is collapsed.
Click to expand it.
backend/schemas.py
+
9
−
12
View file @
2c2e558b
...
...
@@ -11,14 +11,6 @@ class Image(BaseModel):
orm_mode
=
True
class
Storage
(
BaseModel
):
name
:
str
items
:
"
List[Item]
"
class
Config
:
orm_mode
=
True
class
ItemCreatePrepareShipping
(
BaseModel
):
verification
:
bytes
addressee
:
Union
[
str
,
None
]
=
None
...
...
@@ -33,16 +25,15 @@ class ItemCreateByImageAtStorage(BaseModel):
class
ItemCheckin
(
BaseModel
):
item_uuid
:
str
storage_name
:
str
num
:
Union
[
int
,
None
]
=
1
amount
:
Union
[
int
,
None
]
=
1
class
Item
(
BaseModel
):
uuid
:
UUID4
amount
:
int
created_at
:
datetime
received_at
:
Union
[
datetime
,
None
]
=
None
verification
:
bytes
addressee
:
Union
[
str
,
None
]
=
None
team
:
Union
[
str
,
None
]
=
None
images
:
List
[
Image
]
=
[]
...
...
@@ -50,6 +41,7 @@ class Item(BaseModel):
deployed
:
Union
[
str
,
None
]
=
None
deployed_at
:
Union
[
datetime
,
None
]
=
None
verification
:
Union
[
bytes
,
None
]
=
None
tag
:
Union
[
str
,
None
]
=
None
storage
:
Union
[
str
,
None
]
=
None
...
...
@@ -58,4 +50,9 @@ class Item(BaseModel):
orm_mode
=
True
Storage
.
update_forward_refs
()
class
Storage
(
BaseModel
):
name
:
str
items
:
List
[
Item
]
class
Config
:
orm_mode
=
True
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment