Skip to content

Commit

Permalink
新增对应标签解析 目前仅支持img
Browse files Browse the repository at this point in the history
  • Loading branch information
23233 committed Aug 21, 2020
1 parent ccf6f1f commit 3a1e9f3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,26 @@ app.Listen(":8080")
* the best you do not use custom usermodel , admin isolation is good!

## model custom tags (sp) now support
```golang
example: sp("key:value") sp("key(value)") sp("key('value')")
```
* autogen -> mark columns is code auto generate not handle
```golang
sp("autogen")
```
* lineTo -> if custom action , default value use this define for select row
```golang
sp("lineTo(Id)")
```
* fk -> foreign key , support one to tone and many to one , if use multiple is many to one , *just only support id columns , must be have id field !!!*


```golang
sp("fk('ComplexModelC')")
sp("fk('ComplexModelC') multiple")
```
* tag -> front show whats ? now support custom tag , default show text , options: img
```golang
sp:"tag(img)"
```


## todo features
Expand Down
1 change: 1 addition & 0 deletions _examples/model/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,5 @@ type TestUserModel struct {
type TestStructComplexModel struct {
ModelBase `xorm:"extends"`
Names string `xorm:"notnull" json:"names"`
Img string `xorm:"varchar(255)" sp:"tag(img)"`
}
8 changes: 4 additions & 4 deletions bindata.go

Large diffs are not rendered by default.

0 comments on commit 3a1e9f3

Please sign in to comment.