func FindFirst(format string, args ...interface{}) (*Post, error) {
	result, err := Query().Where(format, args...).FirstResult()
	if err != nil {
		return nil, err
	}
	return NewWithColumns(result), nil
}
FindFirst fetches a single post record from the database using
a where query with the format and args provided.
package posts
import (
	"time"
	"github.com/fragmenta/query"
	"github.com/fragmenta/fragmenta-cms/src/lib/resource"
	"github.com/fragmenta/fragmenta-cms/src/lib/status"
)
const (
	TableName = "posts"
	KeyName = "id"
	Order = "name asc, id desc"
)
func AllowedParams() []string {
	return []string{"status", "author_id", "keywords", "name", "status", "summary", "template", "text"}
}
func NewWithColumns(cols map[string]interface{}) *Post {
	post := New()
	post.ID = resource.ValidateInt(cols["id"])
	post.CreatedAt = resource.ValidateTime(cols["created_at"])
	post.UpdatedAt = resource.ValidateTime(cols["updated_at"])
	post.Status = resource.ValidateInt(cols["status"])
	post.AuthorID = resource.ValidateInt(cols["author_id"])
	post.Keywords = resource.ValidateString(cols["keywords"])
	post.Name = resource.ValidateString(cols["name"])
	post.Status = resource.ValidateInt(cols["status"])
	post.Summary = resource.ValidateString(cols["summary"])
	post.Template = resource.ValidateString(cols["template"])
	post.Text = resource.ValidateString(cols["text"])
	return post
}
func New() *Post {
	post := &Post{}
	post.CreatedAt = time.Now()
	post.UpdatedAt = time.Now()
	post.TableName = TableName
	post.KeyName = KeyName
	post.Status = status.Draft
	post.Template = "posts/views/templates/default.html.got"
	return post
}