Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
5d55ca19
Commit
5d55ca19
authored
Oct 11, 2013
by
slene
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
orm add Exist func
parent
3f91dfbc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
orm_queryset.go
orm/orm_queryset.go
+5
-0
types.go
orm/types.go
+1
-0
No files found.
orm/orm_queryset.go
View file @
5d55ca19
...
...
@@ -114,6 +114,11 @@ func (o *querySet) Count() (int64, error) {
return
o
.
orm
.
alias
.
DbBaser
.
Count
(
o
.
orm
.
db
,
o
,
o
.
mi
,
o
.
cond
,
o
.
orm
.
alias
.
TZ
)
}
func
(
o
*
querySet
)
Exist
()
bool
{
cnt
,
_
:=
o
.
orm
.
alias
.
DbBaser
.
Count
(
o
.
orm
.
db
,
o
,
o
.
mi
,
o
.
cond
,
o
.
orm
.
alias
.
TZ
)
return
cnt
>
0
}
func
(
o
*
querySet
)
Update
(
values
Params
)
(
int64
,
error
)
{
return
o
.
orm
.
alias
.
DbBaser
.
UpdateBatch
(
o
.
orm
.
db
,
o
,
o
.
mi
,
o
.
cond
,
values
,
o
.
orm
.
alias
.
TZ
)
}
...
...
orm/types.go
View file @
5d55ca19
...
...
@@ -50,6 +50,7 @@ type QuerySeter interface {
OrderBy
(
...
string
)
QuerySeter
RelatedSel
(
...
interface
{})
QuerySeter
Count
()
(
int64
,
error
)
Exist
()
bool
Update
(
Params
)
(
int64
,
error
)
Delete
()
(
int64
,
error
)
PrepareInsert
()
(
Inserter
,
error
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment