src/snorlogue/constants

Source   Edit  

This module is the place to define any application-wide constants

Types

ActionProc[T] = proc (connection: DbConn; model: T): void
Type a proc must have in order to be performed as an action before or after a model is created, updated or deleted. Source   Edit  
SortDirection = enum
  ASC, DESC
Defines the possible ways to sort a list Source   Edit  

Lets

DEFAULT_MEDIA_ROOT =
  ## 
  ## Default MEDIA_ROOT directory. Is determined at runtime on startup to be
  ## a "/media" folder in the current working directory i.e. the directory from
  ## which the binary of the compiled program is run.
  block:
    var fmtRes_2231369758 = newStringOfCap(33)
    formatValue(fmtRes_2231369758, getCurrentDir(), "")
    add(fmtRes_2231369758, "/media")
    fmtRes_2231369758
Default MEDIA_ROOT directory. Is determined at runtime on startup to be a "/media" folder in the current working directory i.e. the directory from which the binary of the compiled program is run. Source   Edit  

Consts

DATETIME_LOCAL_FORMAT = "yyyy-MM-dd\'T\'HH:mm"
The expected DateTime Format of any string value representing a DateTime field of a model Source   Edit  
DEFAULT_PAGE_SIZE = 50
Default size for pagination Source   Edit  
ID_PARAM = "id"
Name of the url parameter for the value of a unique identifier for a model Source   Edit  
ID_PATTERN = "(?P<id>[\\d]+)"
Regular expression for use in routes, representing the ID url parameter Source   Edit  
MEDIA_ROOT_SETTING = "media-root"

The name of the prologue setting that is used to configure the root media directory. All files from fields of type FilePath are to be stored in that directory. Sub-directories within the root directory can be specified with the subdir pragma.

If no such setting is provided DEFAULT_MEDIA_ROOT is used.

Source   Edit  
PACKAGE_PATH = "/home/runner/work/Snorlogue/Snorlogue/src/snorlogue"
The filepath to root project folder being compiled. Source   Edit  
PAGE_PARAM = "page"
Name of the url parameter for a pagination index Source   Edit  
PAGE_PATTERN = "(?P<page>[\\d]+)"
Regular expression for use in routes, representing the PAGE url parameter Source   Edit