Documentation
¶
Index ¶
Constants ¶
View Source
const ( GenerateDefinerTemplate = "attrs_definer.tmpl" GenerateModelsTemplate = "models_interface.tmpl" GenerateAdminTemplate = "admin_setup.tmpl" )
Variables ¶
View Source
var ( Prefixes = map[string]string{ GenerateDefinerTemplate: "godjango_definer", GenerateModelsTemplate: "godjango_models", GenerateAdminTemplate: "godjango_admin", } )
Functions ¶
This section is empty.
Types ¶
type CodeGenerator ¶
type CodeGenerator struct {
// contains filtered or unexported fields
}
func New ¶
func New(req *plugin.GenerateRequest, opts *CodeGeneratorOptions) (*CodeGenerator, error)
func (*CodeGenerator) BuildTemplateObject ¶
func (c *CodeGenerator) BuildTemplateObject(schema *plugin.Schema) *TemplateObject
func (*CodeGenerator) Render ¶
func (c *CodeGenerator) Render(w io.Writer, name string, obj *TemplateObject) error
type CodeGeneratorOptions ¶
type CodeGeneratorOptions struct { Initialisms []string `json:"initialisms"` Rename map[string]string `json:"rename"` PackageName string `json:"package"` InflectionExclusions []string `json:"inflection_exclusions"` OutFile string `json:"out"` GenerateAdminSetup bool `json:"generate_admin_setup"` GenerateModelsMethods bool `json:"generate_models_methods"` // contains filtered or unexported fields }
func (*CodeGeneratorOptions) GoName ¶
func (c *CodeGeneratorOptions) GoName(name string) string
func (*CodeGeneratorOptions) InflectSingular ¶
func (s *CodeGeneratorOptions) InflectSingular(name string) string
Click to show internal directories.
Click to hide internal directories.