Documentation ¶
Index ¶
- Constants
- func GenDeveloperScript(rw io.ReadWriter, migration DeveloperScript) error
- func GenEntrypoint(rw io.ReadWriter, entrypoint Entrypoint, commit bool) error
- func GenModel(rw io.ReadWriter, model Model) error
- func GenSettings(rw io.ReadWriter, settings Settings) error
- type DeveloperScript
- type Entrypoint
- type Fields
- type Model
- type Package
- type Settings
- type TextFile
Constants ¶
View Source
const ( EntryFilename = "entry.py" FeatureFilename = "feature.py" )
View Source
const ( MySQLConnectorEngine = "mysql.connector.django" TimeZoneAsiaShanghai = "Asia/Shanghai" )
View Source
const BaseRequirements = `Django==3.2.4
mysql-connector-python==8.0.26
pytz==2021.1
sqlparse==0.4.1
`
View Source
const DeveloperScriptPattern = `` /* 314-byte string literal not displayed */
View Source
const EntrypointPattern = `` /* 848-byte string literal not displayed */
View Source
const EntrypointWithRollback = `` /* 623-byte string literal not displayed */
View Source
const ModelPattern = `` /* 225-byte string literal not displayed */
View Source
const RequirementsFilename = `requirements.txt`
View Source
const SettingsPattern = `` /* 573-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func GenDeveloperScript ¶
func GenDeveloperScript(rw io.ReadWriter, migration DeveloperScript) error
func GenEntrypoint ¶
func GenEntrypoint(rw io.ReadWriter, entrypoint Entrypoint, commit bool) error
GenEntrypoint generates python module entrypoint text and write it to rw
func GenSettings ¶
func GenSettings(rw io.ReadWriter, settings Settings) error
Types ¶
type DeveloperScript ¶
type DeveloperScript struct {
Models []string
}
type Entrypoint ¶
type Fields ¶
func ColToDjangoField ¶
ColToDjangoField https://docs.djangoproject.com/zh-hans/3.2/ref/models/fields/#model-field-types
type Model ¶
func CreateTableStmtToModel ¶
func CreateTableStmtToModel(stmt *ast.CreateTableStmt) (*Model, error)
type Package ¶
Click to show internal directories.
Click to hide internal directories.