documents

package
v1.7.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: GPL-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminDocumentModelOptions

func AdminDocumentModelOptions(app *AppConfig) admin.ModelOptions

func NewAppConfig

func NewAppConfig(opts *Options) django.AppConfig

Types

type AppConfig

type AppConfig struct {
	*apps.DBRequiredAppConfig
	Options *Options
}

func (*AppConfig) AllowedFileExts

func (c *AppConfig) AllowedFileExts() []string

func (*AppConfig) AllowedMimeTypes

func (c *AppConfig) AllowedMimeTypes() []string

func (*AppConfig) MaxByteSize

func (c *AppConfig) MaxByteSize() uint

func (*AppConfig) MediaBackend

func (c *AppConfig) MediaBackend() mediafiles.Backend

func (*AppConfig) MediaDir

func (c *AppConfig) MediaDir() string

type Document

type Document struct {
	models.Model
	ID        uint32        `json:"id"`
	Title     string        `json:"title"`
	Path      string        `json:"path"`
	CreatedAt time.Time     `json:"created_at"`
	FileSize  sql.NullInt32 `json:"file_size"`
	FileHash  string        `json:"file_hash"`
	// contains filtered or unexported fields
}

readonly:id,created_at

func (*Document) BeforeCreate

func (o *Document) BeforeCreate(ctx context.Context) error

func (*Document) FieldDefs

func (o *Document) FieldDefs() attrs.Definitions

func (*Document) File

func (o *Document) File() (mediafiles.StoredObject, error)

func (*Document) String

func (o *Document) String() string

func (*Document) Validate

func (o *Document) Validate(ctx context.Context) error

type Options

type Options struct {
	MediaBackend          mediafiles.Backend
	MediaDir              string
	MaxByteSize           uint
	AllowedFileExts       []string
	AllowedMimeTypes      []string
	CheckServePermissions bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL