将django模型转换为go结构。
django2go的Python项目详细描述
#对于gorm或其他orm操作,django 2型go-struct
>依赖于go代码:
>https://github.com/jizhu/gorm
安装
``bash ``bash
git clone/djang2go.git
cd djangonggo
>python setup.python安装程序。
````````````````````````
##用法:
settings.py
`` python
已安装的应用程序=[
…
'django2Go',
……
run cmd:
得分低于=models.integerfield()
fieldwithuppercase=models.integerfield()
fieldwithou case=models.integerfield()
``````
generated go struct:
```go
type model2 struct{
id int64`json:“id”gorm:“primary_key”`
field1 string`json:“field1”`
fieldwithunderline int64`json:“field\u under'u score”`
fieldwithuppercase int64`json:“fieldwithuppercase”`
field with case int64`json:“fieldwithuppercase”`
///tablename\tablename()字符串{
return table\u prefix+“model2”
}
```
>依赖于go代码:
>https://github.com/jizhu/gorm
安装
``bash ``bash
git clone/djang2go.git
cd djangonggo
>python setup.python安装程序。
````````````````````````
##用法:
settings.py
`` python
已安装的应用程序=[
…
'django2Go',
……
run cmd:
得分低于=models.integerfield()
fieldwithuppercase=models.integerfield()
fieldwithou case=models.integerfield()
``````
generated go struct:
```go
type model2 struct{
id int64`json:“id”gorm:“primary_key”`
field1 string`json:“field1”`
fieldwithunderline int64`json:“field\u under'u score”`
fieldwithuppercase int64`json:“fieldwithuppercase”`
field with case int64`json:“fieldwithuppercase”`
///tablename\tablename()字符串{
return table\u prefix+“model2”
}
```