Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flask-covid19
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Thomas Wöhlke
flask-covid19
Commits
4d8c1a45
Commit
4d8c1a45
authored
4 years ago
by
thomaswoehlke
Browse files
Options
Downloads
Patches
Plain Diff
work
parent
7075c723
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org/woehlke/covid19/who/who_model.py
+19
-0
19 additions, 0 deletions
org/woehlke/covid19/who/who_model.py
with
19 additions
and
0 deletions
org/woehlke/covid19/who/who_model.py
+
19
−
0
View file @
4d8c1a45
from
sqlalchemy
import
and_
,
func
from
sqlalchemy
import
and_
,
func
from
datetime
import
date
from
database
import
db
,
ITEMS_PER_PAGE
from
database
import
db
,
ITEMS_PER_PAGE
from
sqlalchemy.orm
import
joinedload
,
raiseload
from
sqlalchemy.orm
import
joinedload
,
raiseload
...
@@ -88,6 +89,24 @@ class WhoDateReported(db.Model):
...
@@ -88,6 +89,24 @@ class WhoDateReported(db.Model):
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
)
date_reported
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
,
unique
=
True
)
date_reported
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
,
unique
=
True
)
datum
=
db
.
Column
(
db
.
Date
,
nullable
=
False
,
unique
=
True
)
datum
=
db
.
Column
(
db
.
Date
,
nullable
=
False
,
unique
=
True
)
year
=
db
.
Column
(
db
.
Integer
,
nullable
=
False
)
month
=
db
.
Column
(
db
.
Integer
,
nullable
=
False
)
day_of_month
=
db
.
Column
(
db
.
Integer
,
nullable
=
False
)
@classmethod
def
create_new_object_factory
(
cls
,
my_date_rep
):
my_date_reported
=
my_date_rep
.
split
(
'
-
'
)
my_year
=
int
(
my_date_reported
[
0
])
my_month
=
int
(
my_date_reported
[
1
])
my_day_of_month
=
int
(
my_date_reported
[
2
])
my_datum
=
date
(
year
=
my_year
,
month
=
my_month
,
day
=
my_day_of_month
)
return
WhoDateReported
(
date_reported
=
my_date_rep
,
datum
=
my_datum
,
year
=
my_year
,
month
=
my_month
,
day_of_month
=
my_day_of_month
)
@classmethod
@classmethod
def
remove_all
(
cls
):
def
remove_all
(
cls
):
...
...
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