Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Portal
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
Container Registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fachschaft
Portal
Commits
b820a149
Unverified
Commit
b820a149
authored
6 months ago
by
karp
Browse files
Options
Downloads
Patches
Plain Diff
Fix SQLAlchemy-related type errors
parent
2576afc0
No related branches found
No related tags found
1 merge request
!24
Update pipeline to check types and formatting
Pipeline
#6685
passed
6 months ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
portal/__init__.py
+1
-1
1 addition, 1 deletion
portal/__init__.py
portal/model/FlaskConfigEntry.py
+4
-1
4 additions, 1 deletion
portal/model/FlaskConfigEntry.py
portal/model/Retrievable.py
+6
-2
6 additions, 2 deletions
portal/model/Retrievable.py
with
11 additions
and
4 deletions
portal/__init__.py
+
1
−
1
View file @
b820a149
...
...
@@ -9,7 +9,7 @@ from flask_sqlalchemy import SQLAlchemy
from
.db_config
import
get_database_uri
,
get_uri_for_sqlite
db
=
SQLAlchemy
()
db
:
SQLAlchemy
=
SQLAlchemy
()
from
.model
import
*
...
...
This diff is collapsed.
Click to expand it.
portal/model/FlaskConfigEntry.py
+
4
−
1
View file @
b820a149
from
flask
import
Flask
from
flask_sqlalchemy
import
DefaultMeta
from
portal
import
db
BaseModel
:
DefaultMeta
=
db
.
Model
class
FlaskConfigEntry
(
db
.
Model
):
class
FlaskConfigEntry
(
BaseModel
):
"""
A configuration entry for Flask (a key-value pair) as persisted in a database
"""
...
...
This diff is collapsed.
Click to expand it.
portal/model/Retrievable.py
+
6
−
2
View file @
b820a149
from
abc
import
abstractmethod
from
typing
import
Any
,
List
,
Optional
,
Self
from
flask_sqlalchemy
import
DefaultMeta
from
sqlalchemy
import
Column
from
flask
import
g
from
portal
import
db
BaseModel
:
DefaultMeta
=
db
.
Model
class
Retrievable
(
db
.
Model
):
class
Retrievable
(
BaseModel
):
"""
A type whose instances can be retrieved from the database.
...
...
@@ -17,7 +21,7 @@ class Retrievable(db.Model):
__abstract__
=
True
@classmethod
def
get_canonical_order_column
(
cls
)
->
Optional
[
db
.
Column
]:
def
get_canonical_order_column
(
cls
)
->
Optional
[
Column
]:
"""
Return the colum by which instances of this type should be canonically ordered
when retrieving them all from the database.
...
...
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