forked from zvtvz/zvt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1) move portfolio to contract schema
2) add fund entity
- Loading branch information
Showing
25 changed files
with
225 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- coding: utf-8 -*- | ||
from sqlalchemy import Column, String, Integer | ||
from sqlalchemy.ext.declarative import declarative_base | ||
|
||
from zvt.contract import EntityMixin, PortfolioStockHistory | ||
from zvt.contract.register import register_entity, register_schema | ||
|
||
FundMetaBase = declarative_base() | ||
|
||
|
||
# 个股 | ||
@register_entity(entity_type='fund') | ||
class Fund(FundMetaBase, EntityMixin): | ||
__tablename__ = 'fund' | ||
# 基金管理人 | ||
advisor = Column(String(length=100)) | ||
# 基金托管人 | ||
trustee = Column(String(length=100)) | ||
|
||
# 编码 基金运作方式 | ||
# 401001 开放式基金 | ||
# 401002 封闭式基金 | ||
# 401003 QDII | ||
# 401004 FOF | ||
# 401005 ETF | ||
# 401006 LOF | ||
# 基金运作方式编码 | ||
operate_mode_id = Column(Integer) | ||
# 基金运作方式 | ||
operate_mode = Column(String(length=32)) | ||
|
||
# 编码 基金类别 | ||
# 402001 股票型 | ||
# 402002 货币型 | ||
# 402003 债券型 | ||
# 402004 混合型 | ||
# 402005 基金型 | ||
# 402006 贵金属 | ||
# 402007 封闭式 | ||
# 投资标的类型编码 | ||
underlying_asset_type_id = Column(Integer) | ||
# 投资标的类型 | ||
underlying_asset_type = Column(String(length=32)) | ||
|
||
|
||
class FundStock(FundMetaBase, PortfolioStockHistory): | ||
__tablename__ = 'fund_stock' | ||
|
||
|
||
register_schema(providers=['joinquant'], db_name='fund_meta', schema_base=FundMetaBase) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.