|
| 1 | +#!/usr/bin/python3 |
| 2 | +# -*- coding:utf-8 -*- |
| 3 | +# __author__ = 'liao gao xiang' |
| 4 | + |
| 5 | +import xadmin |
| 6 | +from stock.models import StockInfo, HolderInfo, LiquidHolderInfo, MarketDay, MarketWeek, MarketMonth, MarketYear, \ |
| 7 | + Margin, MorphologicFactor, TechnicalFactor, FinancialFactor |
| 8 | + |
| 9 | + |
| 10 | +class StockInfoAdmin(object): |
| 11 | + list_display = ['code', 'name', 'is_st', 'industry', 'is_margin', 'is_hs300', 'is_sh', 'is_sz', 'is_sh50', 'is_500', |
| 12 | + 'is_sme', 'is_second', 'share_total', 'share_liqa', 'share_restrict', 'holder_num', 'holder_average_num', |
| 13 | + 'holder_average_change', 'updated_at'] |
| 14 | + search_fields = ['code', 'name', 'is_st', 'industry', 'is_margin', 'is_hs300', 'is_sh', 'is_sz', 'is_sh50', 'is_500', |
| 15 | + 'is_sme', 'is_second', 'share_total', 'share_liqa', 'share_restrict', 'holder_num', 'holder_average_num', |
| 16 | + 'holder_average_change', 'updated_at'] |
| 17 | + list_filter = ['code', 'name', 'is_st', 'industry', 'is_margin', 'is_hs300', 'is_sh', 'is_sz', 'is_sh50', 'is_500', |
| 18 | + 'is_sme', 'is_second', 'share_total', 'share_liqa', 'share_restrict', 'holder_num', 'holder_average_num', |
| 19 | + 'holder_average_change', 'updated_at'] |
| 20 | + import_excel = True |
| 21 | + |
| 22 | + |
| 23 | +class HolderInfoAdmin(object): |
| 24 | + list_display = ['code', 'name', 'quantity', 'pct', 'updated_at'] |
| 25 | + search_fields = ['code', 'name', 'quantity', 'pct', 'updated_at'] |
| 26 | + list_filter = ['code', 'name', 'quantity', 'pct', 'updated_at'] |
| 27 | + |
| 28 | + |
| 29 | +class LiquidHolderInfoAdmin(object): |
| 30 | + list_display = ['code', 'name', 'quantity', 'pct', 'updated_at'] |
| 31 | + search_fields = ['code', 'name', 'quantity', 'pct', 'updated_at'] |
| 32 | + list_filter = ['code', 'name', 'quantity', 'pct', 'updated_at'] |
| 33 | + |
| 34 | + |
| 35 | +class MarketDayAdmin(object): |
| 36 | + list_display = ['code', 'date', 'close', 'open', 'high', 'low', 'volume', 'pct_change', 'swing', 'avg_price', 'turn', 'amount', 'buy_amount', |
| 37 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'active_buy_volume', 'active_sell_volume', |
| 38 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 39 | + search_fields = ['code', 'date', 'close', 'open', 'high', 'low', 'volume', 'pct_change', 'swing', 'avg_price', 'turn', 'amount', 'buy_amount', |
| 40 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'active_buy_volume', 'active_sell_volume', |
| 41 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 42 | + list_filter = ['code', 'date', 'close', 'open', 'high', 'low', 'volume', 'pct_change', 'swing', 'avg_price', 'turn', 'amount', 'buy_amount', |
| 43 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'active_buy_volume', 'active_sell_volume', |
| 44 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 45 | + |
| 46 | + |
| 47 | +class MarketWeekAdmin(object): |
| 48 | + list_display = ['code', 'week', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 49 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 50 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 51 | + search_fields = ['code', 'week', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 52 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 53 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 54 | + list_filter = ['code', 'week', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 55 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 56 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 57 | + |
| 58 | + |
| 59 | +class MarketMonthAdmin(object): |
| 60 | + list_display = ['code', 'month', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 61 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 62 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 63 | + search_fields = ['code', 'month', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 64 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 65 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 66 | + list_filter = ['code', 'month', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 67 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 68 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 69 | + |
| 70 | + |
| 71 | +class MarketYearAdmin(object): |
| 72 | + list_display = ['code', 'year', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 73 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 74 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 75 | + search_fields = ['code', 'year', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 76 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 77 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 78 | + list_filter = ['code', 'year', 'close', 'open', 'high', 'low', 'pct_change', 'swing', 'avg_price', 'turn', 'volume', 'amount', 'buy_amount', |
| 79 | + 'sell_amount', 'buy_volume', 'sell_volume', 'net_buy_amount', 'net_buy_volume', 'net_sell_amount', 'net_sell_volume', |
| 80 | + 'buy_amount_active', 'sell_amount_active', 'updated_at'] |
| 81 | + |
| 82 | + |
| 83 | +class MarginAdmin(object): |
| 84 | + list_display = ['code', 'date', 'purchase_with_borrowed_money', 'repayment_to_broker', 'trading_balance', 'sales_of_borrowed_sec', |
| 85 | + 'repayment_of_borrowed_sec', 'sale_trading_amount', 'sec_lending_balance_volume', 'sec_lending_balance', |
| 86 | + 'trading_and_sec_lending_balance', 'updated_at'] |
| 87 | + search_fields = ['code', 'date', 'purchase_with_borrowed_money', 'repayment_to_broker', 'trading_balance', 'sales_of_borrowed_sec', |
| 88 | + 'repayment_of_borrowed_sec', 'sale_trading_amount', 'sec_lending_balance_volume', 'sec_lending_balance', |
| 89 | + 'trading_and_sec_lending_balance', 'updated_at'] |
| 90 | + list_filter = ['code', 'date', 'purchase_with_borrowed_money', 'repayment_to_broker', 'trading_balance', 'sales_of_borrowed_sec', |
| 91 | + 'repayment_of_borrowed_sec', 'sale_trading_amount', 'sec_lending_balance_volume', 'sec_lending_balance', |
| 92 | + 'trading_and_sec_lending_balance', 'updated_at'] |
| 93 | + |
| 94 | + |
| 95 | +class MorphologicFactorAdmin(object): |
| 96 | + list_display = ['code', 'date', 'red_three_soldiers', 'hammer', 'hammer_down', 'two_ravens', 'three_ravens', 'morning_star', 'evening_star', |
| 97 | + 'dark_cloud_cover', 'meteor_line', 'three_line_strike', 'southern_samsung', 'be_confronted_with_a_formidable_enemy', |
| 98 | + 'abandoned_infant', 'belt_line', 'cross_pregnancy_line', 'rickshaw_man', 'updated_at'] |
| 99 | + search_fields = ['code', 'date', 'red_three_soldiers', 'hammer', 'hammer_down', 'two_ravens', 'three_ravens', 'morning_star', 'evening_star', |
| 100 | + 'dark_cloud_cover', 'meteor_line', 'three_line_strike', 'southern_samsung', 'be_confronted_with_a_formidable_enemy', |
| 101 | + 'abandoned_infant', 'belt_line', 'cross_pregnancy_line', 'rickshaw_man', 'updated_at'] |
| 102 | + list_filter = ['code', 'date', 'red_three_soldiers', 'hammer', 'hammer_down', 'two_ravens', 'three_ravens', 'morning_star', 'evening_star', |
| 103 | + 'dark_cloud_cover', 'meteor_line', 'three_line_strike', 'southern_samsung', 'be_confronted_with_a_formidable_enemy', |
| 104 | + 'abandoned_infant', 'belt_line', 'cross_pregnancy_line', 'rickshaw_man', 'updated_at'] |
| 105 | + |
| 106 | + |
| 107 | +class TechnicalFactorAdmin(object): |
| 108 | + list_display = ['code', 'date', 'ma', 'macd', 'kdj', 'rsi', 'bias', 'bbi', 'cci', 'atr', 'trix', 'ema', 'dma', 'boll_up', 'boll_down', 'sar', |
| 109 | + 'si', 'wr', 'cr', 'std', 'vol_ratio', 'updated_at'] |
| 110 | + search_fields = ['code', 'date', 'ma', 'macd', 'kdj', 'rsi', 'bias', 'bbi', 'cci', 'atr', 'trix', 'ema', 'dma', 'boll_up', 'boll_down', 'sar', |
| 111 | + 'si', 'wr', 'cr', 'std', 'vol_ratio', 'updated_at'] |
| 112 | + list_filter = ['code', 'date', 'ma', 'macd', 'kdj', 'rsi', 'bias', 'bbi', 'cci', 'atr', 'trix', 'ema', 'dma', 'boll_up', 'boll_down', 'sar', |
| 113 | + 'si', 'wr', 'cr', 'std', 'vol_ratio', 'updated_at'] |
| 114 | + |
| 115 | + |
| 116 | +class FinancialFactorAdmin(object): |
| 117 | + list_display = ['code', 'year', 'time', 'eps', 'bps', 'gross_earnings_per_share', 'capital_stock_per_share', 'earnings_per_share', |
| 118 | + 'undistributed_profit_per_share', 'pre_tax_earnings_per_share', 'ebitda', 'pe', 'roe', 'roa', 'roic', 'gross_profit_margin', |
| 119 | + 'net_profit_margin', 'opt_oebt', 'debt_to_assets', 'long_debt_to_long_captial', 'short_debt_to_long_captial', |
| 120 | + 'assets_to_equity', 'fa_current', 'fa_quick', 'fa_cash_to_current_debt', 'fa_debt_to_equity', 'fa_invturn', 'fa_arturn', |
| 121 | + 'fa_assets_turn', 'updated_at'] |
| 122 | + search_fields = ['code', 'year', 'time', 'eps', 'bps', 'gross_earnings_per_share', 'capital_stock_per_share', 'earnings_per_share', |
| 123 | + 'undistributed_profit_per_share', 'pre_tax_earnings_per_share', 'ebitda', 'pe', 'roe', 'roa', 'roic', 'gross_profit_margin', |
| 124 | + 'net_profit_margin', 'opt_oebt', 'debt_to_assets', 'long_debt_to_long_captial', 'short_debt_to_long_captial', |
| 125 | + 'assets_to_equity', 'fa_current', 'fa_quick', 'fa_cash_to_current_debt', 'fa_debt_to_equity', 'fa_invturn', 'fa_arturn', |
| 126 | + 'fa_assets_turn', 'updated_at'] |
| 127 | + list_filter = ['code', 'year', 'time', 'eps', 'bps', 'gross_earnings_per_share', 'capital_stock_per_share', 'earnings_per_share', |
| 128 | + 'undistributed_profit_per_share', 'pre_tax_earnings_per_share', 'ebitda', 'pe', 'roe', 'roa', 'roic', 'gross_profit_margin', |
| 129 | + 'net_profit_margin', 'opt_oebt', 'debt_to_assets', 'long_debt_to_long_captial', 'short_debt_to_long_captial', |
| 130 | + 'assets_to_equity', 'fa_current', 'fa_quick', 'fa_cash_to_current_debt', 'fa_debt_to_equity', 'fa_invturn', 'fa_arturn', |
| 131 | + 'fa_assets_turn', 'updated_at'] |
| 132 | + |
| 133 | + |
| 134 | +xadmin.site.register(StockInfo, StockInfoAdmin) |
| 135 | +xadmin.site.register(HolderInfo, HolderInfoAdmin) |
| 136 | +xadmin.site.register(LiquidHolderInfo, LiquidHolderInfoAdmin) |
| 137 | +xadmin.site.register(MarketDay, MarketDayAdmin) |
| 138 | +xadmin.site.register(MarketWeek, MarketWeekAdmin) |
| 139 | +xadmin.site.register(MarketMonth, MarketMonthAdmin) |
| 140 | +xadmin.site.register(MarketYear, MarketYearAdmin) |
| 141 | +xadmin.site.register(Margin, MarginAdmin) |
| 142 | +xadmin.site.register(MorphologicFactor, MorphologicFactorAdmin) |
| 143 | +xadmin.site.register(TechnicalFactor, TechnicalFactorAdmin) |
| 144 | +xadmin.site.register(FinancialFactor, FinancialFactorAdmin) |
0 commit comments