Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
frozen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CSE6
frozen
Commits
61dc475e
Commit
61dc475e
authored
2 years ago
by
Arno Wunderlich
Browse files
Options
Downloads
Patches
Plain Diff
setup for testing of db
parent
bde0af60
No related branches found
No related tags found
1 merge request
!5
Db init
Pipeline
#13336
passed
2 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
dotenv
+1
-6
1 addition, 6 deletions
dotenv
src/tjts5901/models.py
+40
-0
40 additions, 0 deletions
src/tjts5901/models.py
with
42 additions
and
6 deletions
.gitignore
+
1
−
0
View file @
61dc475e
...
...
@@ -164,4 +164,5 @@ cython_debug/
_docs/
.env
dotenv
.DS_Store
This diff is collapsed.
Click to expand it.
dotenv
+
1
−
6
View file @
61dc475e
...
...
@@ -14,9 +14,4 @@
# developers or deployments, as you can simply share the .env file rather than hardcoding the
# values into the application itself.
FLASK_APP=tjts5901.app
FLASK_DEBUG=1
# Enable rich logging for more human readable log output. Requires installing
# `rich` and `flask-rich` packages.
#RICH_LOGGING=1
MONGO_URL = "mongodb://localhost:27017/
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/tjts5901/models.py
0 → 100644
+
40
−
0
View file @
61dc475e
from
datetime
import
datetime
from
.db
import
db
from
mongoengine
import
(
StringField
,
IntField
,
ReferenceField
,
DateTimeField
,
EmailField
,
)
class
User
(
db
.
Document
):
"""
Model representing a user of the auction site.
"""
email
=
EmailField
(
required
=
True
,
unique
=
True
)
password
=
StringField
(
required
=
True
)
created_at
=
DateTimeField
(
required
=
True
,
default
=
datetime
.
utcnow
)
class
Item
(
db
.
Document
):
"""
A model for items that are listed on the auction site.
"""
title
=
StringField
(
max_length
=
100
,
required
=
True
)
description
=
StringField
(
max_length
=
2000
,
required
=
True
)
starting_bid
=
IntField
(
required
=
True
,
min_value
=
0
)
seller
=
ReferenceField
(
User
,
required
=
True
)
created_at
=
DateTimeField
(
required
=
True
,
default
=
datetime
.
utcnow
)
closes_at
=
DateTimeField
()
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