Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
6b86de35
Commit
6b86de35
authored
Feb 14, 2018
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using more traditional day type for json in sql
parent
29bebe91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
models.py
alphamind/data/dbmodel/models.py
+6
-7
No files found.
alphamind/data/dbmodel/models.py
View file @
6b86de35
...
...
@@ -5,8 +5,7 @@ Created on 2017-6-29
@author: cheng.li
"""
from
sqlalchemy
import
BigInteger
,
Column
,
DateTime
,
Float
,
Index
,
Integer
,
String
,
Text
,
Boolean
,
text
from
sqlalchemy.dialects.postgresql
import
JSONB
from
sqlalchemy
import
BigInteger
,
Column
,
DateTime
,
Float
,
Index
,
Integer
,
String
,
Text
,
Boolean
,
text
,
JSON
from
sqlalchemy.ext.declarative
import
declarative_base
Base
=
declarative_base
()
...
...
@@ -635,7 +634,7 @@ class DailyPortfolios(Base):
industry
=
Column
(
String
(
50
),
nullable
=
False
)
benchmark_weight
=
Column
(
Float
(
53
),
nullable
=
False
)
is_tradable
=
Column
(
Boolean
,
nullable
=
False
)
factor
=
Column
(
JSON
B
)
factor
=
Column
(
JSON
)
class
DailyPortfoliosSchedule
(
Base
):
...
...
@@ -857,8 +856,8 @@ class Models(Base):
model_type
=
Column
(
String
(
30
),
nullable
=
False
)
model_version
=
Column
(
BigInteger
,
nullable
=
False
)
update_time
=
Column
(
DateTime
,
nullable
=
False
)
model_desc
=
Column
(
JSON
B
,
nullable
=
False
)
data_meta
=
Column
(
JSON
B
,
nullable
=
True
)
model_desc
=
Column
(
JSON
,
nullable
=
False
)
data_meta
=
Column
(
JSON
,
nullable
=
True
)
is_primary
=
Column
(
Boolean
)
model_id
=
Column
(
Integer
,
primary_key
=
True
,
autoincrement
=
True
)
...
...
@@ -916,7 +915,7 @@ class Positions(Base):
trade_date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
portfolio
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
type
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
weight
=
Column
(
JSON
B
)
weight
=
Column
(
JSON
)
class
QuantileAnalysis
(
Base
):
...
...
@@ -1866,7 +1865,7 @@ class Formulas(Base):
__tablename__
=
'formulas'
formula
=
Column
(
String
(
50
),
primary_key
=
True
)
formula_desc
=
Column
(
JSON
B
,
nullable
=
False
)
formula_desc
=
Column
(
JSON
,
nullable
=
False
)
comment
=
Column
(
Text
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment