4.2.1. fpiweb package

Subpackages

Submodules

fpiweb.admin module

Admin.py - Identify what can be managed by administrators.

class fpiweb.admin.ActivityAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'box_number', 'date_filled', 'date_consumed', 'adjustment_code')
list_filter = ('adjustment_code',)
property media
class fpiweb.admin.BoxAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('id', 'box_number', 'box_type', 'location', 'quantity', 'product')
list_filter = ('box_type',)
property media
class fpiweb.admin.BoxTypeAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('box_type_code', 'box_type_descr', 'box_type_qty')
property media
class fpiweb.admin.ConstraintsAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('constraint_name', 'constraint_type', 'constraint_min', 'constraint_max', 'constraint_list')
property media
class fpiweb.admin.LocBinAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('loc_bin', 'loc_bin_descr')
property media
class fpiweb.admin.LocRowAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('loc_row', 'loc_row_descr')
property media
class fpiweb.admin.LocTierAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('loc_tier', 'loc_tier_descr')
property media
class fpiweb.admin.Location(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('pk', 'loc_row', 'loc_bin', 'loc_tier')
list_filter = ('loc_row', 'loc_bin', 'loc_tier')
property media
class fpiweb.admin.PalletAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('pk', 'name')
property media
class fpiweb.admin.PalletBoxAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('box_number', 'pallet', 'box', 'product', 'exp_year', 'exp_month_start', 'exp_month_end')
property media
class fpiweb.admin.ProductAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('prod_name', 'prod_cat')
property media
class fpiweb.admin.ProfileAdmin(model, admin_site)[source]

Bases: django.contrib.admin.options.ModelAdmin

list_display = ('user', 'title', 'active_pallet_id')
property media

fpiweb.apps module

class fpiweb.apps.FpiwebConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = 'fpiweb'

fpiweb.code_reader module

exception fpiweb.code_reader.CodeReaderError[source]

Bases: RuntimeError

fpiweb.code_reader.delete_file(image_file_path)[source]
fpiweb.code_reader.get_scan_file_path()[source]
fpiweb.code_reader.read(scan_data)[source]
fpiweb.code_reader.read_box_number(scan_data)[source]

fpiweb.constants module

Global constants, constructs and exceptions for this project.

Constants and constructs that don’t have an obvious home elsewhere are defined here.

Non-Django-based exceptions are defined here.

class fpiweb.constants.AccessGroupsAndFlags(access_level: fpiweb.constants.AccessLevel)[source]

Bases: object

Unpacked attributes of an access level.

access_level: fpiweb.constants.AccessLevel = None
is_admin_group: bool = None
is_staff_flag: bool = None
is_staff_group: bool = None
is_superuser_flag: bool = None
is_volunteer_group: bool = None
name: str = None
value: int = None
class fpiweb.constants.AccessLevel(value)[source]

Bases: fpiweb.constants.OrderedEnum

Level of access for a user - lowest to highest.

Admin: int = 99
No_Access: int = 0
Staff: int = 50
Volunteer: int = 10
do_not_call_in_templates = True
fpiweb.constants.CURRENT_YEAR = 2021

The current year - used for validating expiration dates

fpiweb.constants.EnumForDjango(cls)[source]
exception fpiweb.constants.InternalError(message, code=None, params=None)[source]

Bases: fpiweb.constants.ProjectError

The error is raised when there is some interal logic problem.

exception fpiweb.constants.InvalidActionAttemptedError(message, code=None, params=None)[source]

Bases: fpiweb.constants.ProjectError

A requested action cannot be done at this time.

exception fpiweb.constants.InvalidValueError(message, code=None, params=None)[source]

Bases: fpiweb.constants.ProjectError

Used when an invalid value has been passed as a parameter.

class fpiweb.constants.OrderedEnum(value)[source]

Bases: enum.Enum

Enhanced Enum class that considers the members as ordered

exception fpiweb.constants.ProjectError(message, code=None, params=None)[source]

Bases: django.core.exceptions.ValidationError

All exceptions unique to this project wil be based on this class.

class fpiweb.constants.TargetUser(username: str = '', pswd_changed: bool = False, force_password: bool = False, first_name: str = '', last_name: str = '', email: str = '', title: str = '', access_level: fpiweb.constants.AccessLevel = <AccessLevel.No_Access: 0>, is_active: bool = True)[source]

Bases: tuple

User information to be added or updated.

access_level: fpiweb.constants.AccessLevel

Alias for field number 7

email: str

Alias for field number 5

first_name: str

Alias for field number 3

force_password: bool

Alias for field number 2

is_active: bool

Alias for field number 8

last_name: str

Alias for field number 4

pswd_changed: bool

Alias for field number 1

title: str

Alias for field number 6

username: str

Alias for field number 0

class fpiweb.constants.UserInfo(user: django.contrib.auth.models.User, profile: fpiweb.models.Profile, highest_access_level: fpiweb.constants.AccessLevel, is_active: bool, is_superuser: bool)[source]

Bases: tuple

Information about a specific user - abstracted from various tables.

get_sort_key() → str[source]

Return a usable sort key :return:

highest_access_level: fpiweb.constants.AccessLevel

Alias for field number 2

is_active: bool

Alias for field number 3

is_superuser: bool

Alias for field number 4

profile: fpiweb.models.Profile

Alias for field number 1

user: django.contrib.auth.models.User

Alias for field number 0

class fpiweb.constants.ValidOrErrorResponse(is_valid: bool = True, error_msg_list: List[str] = <factory>)[source]

Bases: object

A constructed response denoting either valid or has error messages.

add_error(msg: str)[source]

Set as invalid and add an error message.

Parameters

msg – error message to add

Returns

error_msg_list: List[str]
is_valid: bool = True
fpiweb.constants.load_access_dict() → Dict[source]

Load a multipurpose dictionary with all access level identifieres.

Returns

a dictionary with lots of keys

fpiweb.forms module

forms.py - provide validation of a forms.

class fpiweb.forms.BoxItemForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

Form for the Box as it appears as part of a formset on the Build Pallet page

base_fields = {'box_number': <fpiweb.forms.BoxNumberField object>, 'exp_month_end': <django.forms.fields.IntegerField object>, 'exp_month_start': <django.forms.fields.IntegerField object>, 'exp_year': <django.forms.fields.TypedChoiceField object>, 'product': <django.forms.models.ModelChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'box_number': <fpiweb.forms.BoxNumberField object>, 'exp_month_end': <django.forms.fields.IntegerField object>, 'exp_month_start': <django.forms.fields.IntegerField object>, 'exp_year': <django.forms.fields.TypedChoiceField object>, 'product': <django.forms.models.ModelChoiceField object>}
static get_initial_from_box(box)[source]
Parameters

box – Box or PalletBox record

Returns

property media

Return all media required to render the widgets on this form.

class fpiweb.forms.BoxNumberField(**kwargs)[source]

Bases: django.forms.fields.CharField

Accepts box number with or without BOX prefix. Returns BoxNumber with BOX prefix and leading zeros

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

class fpiweb.forms.BoxTypeForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

A form to use whenever a box type selection is needed.

base_fields = {'box_type': <django.forms.models.ModelChoiceField object>}
declared_fields = {'box_type': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.BoxTypeMaintenanceForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ['id', 'box_type_code', 'box_type_descr', 'box_type_qty']
model

alias of fpiweb.models.BoxType

base_fields = {'box_type_code': <django.forms.fields.CharField object>, 'box_type_descr': <django.forms.fields.CharField object>, 'box_type_qty': <django.forms.fields.IntegerField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'box_type_code': <django.forms.fields.CharField object>, 'box_type_descr': <django.forms.fields.CharField object>, 'box_type_qty': <django.forms.fields.IntegerField object>}
property media

Return all media required to render the widgets on this form.

static validate_box_type_fields(box_type_code: str, box_type_descr: str, box_type_qty: int)[source]
class fpiweb.forms.BuildPalletForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ('loc_row', 'loc_bin', 'loc_tier')
model

alias of fpiweb.models.Location

base_fields = {'loc_bin': <django.forms.models.ModelChoiceField object>, 'loc_row': <django.forms.models.ModelChoiceField object>, 'loc_tier': <django.forms.models.ModelChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ConfirmMergeForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

ACTION_CHANGE_LOCATION = 'C'
ACTION_CHOICES = (('C', 'Change To Location'), ('M', 'Merge Pallets'))
ACTION_MERGE_PALLETS = 'M'
base_fields = {'action': <django.forms.fields.ChoiceField object>, 'boxes_at_to_location': <django.forms.fields.IntegerField object>, 'from_location': <django.forms.models.ModelChoiceField object>, 'to_location': <django.forms.models.ModelChoiceField object>}
boxes_at_to_location_int()[source]
declared_fields = {'action': <django.forms.fields.ChoiceField object>, 'boxes_at_to_location': <django.forms.fields.IntegerField object>, 'from_location': <django.forms.models.ModelChoiceField object>, 'to_location': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

to_location_str()[source]
class fpiweb.forms.ConstraintsForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Manage Constraint details with a generic form.

class Meta[source]

Bases: object

Additional info to help Django provide intelligent defaults.

fields = ['id', 'constraint_name', 'constraint_descr', 'constraint_type', 'constraint_min', 'constraint_max', 'constraint_list']
model

alias of fpiweb.models.Constraints

base_fields = {'constraint_descr': <django.forms.fields.CharField object>, 'constraint_list': <django.forms.fields.CharField object>, 'constraint_max': <django.forms.fields.CharField object>, 'constraint_min': <django.forms.fields.CharField object>, 'constraint_name': <django.forms.fields.TypedChoiceField object>, 'constraint_type': <django.forms.fields.ChoiceField object>}
clean()[source]

Clean and validate the data given for the constraint record.

Returns

declared_fields = {'constraint_list': <django.forms.fields.CharField object>, 'constraint_max': <django.forms.fields.CharField object>, 'constraint_min': <django.forms.fields.CharField object>, 'constraint_type': <django.forms.fields.ChoiceField object>}
property media

Return all media required to render the widgets on this form.

static validate_constraint_fields(con_name: str, con_descr: str, con_type: Int-MM, Integer Min/Max, Char-MM, Character Min/Max, Int-List, Integer Valid List, Char-List, Character Valid List, con_min: Union[str, int], con_max: Union[str, int], con_list: str)[source]

Validate the various constraint record fields.

Parameters
  • con_name – name of constraint

  • con_descr – description of constraint

  • con_type – type of constraint

  • con_min – minimum value, if given

  • con_max – maximum value, if given

  • con_list – list of values, if given

Returns

class fpiweb.forms.EmptyBoxNumberField(**kwargs)[source]

Bases: fpiweb.forms.ExtantBoxNumberField

Checks whether there’s a Box with the specified box number in the database. If a matching Box is found, this Box is stored in the field’s box attribute

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

class fpiweb.forms.EmptyBoxNumberForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {'box_number': <fpiweb.forms.EmptyBoxNumberField object>}
declared_fields = {'box_number': <fpiweb.forms.EmptyBoxNumberField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ExistingBoxTypeForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: fpiweb.forms.BoxTypeForm

A form to validate that the box type exists.

base_fields = {'box_type': <django.forms.models.ModelChoiceField object>}
clean()[source]

Validate the box type.

declared_fields = {'box_type': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ExistingLocationForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: fpiweb.forms.LocationForm

base_fields = {'loc_bin': <django.forms.models.ModelChoiceField object>, 'loc_row': <django.forms.models.ModelChoiceField object>, 'loc_tier': <django.forms.models.ModelChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ExistingLocationWithBoxesForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: fpiweb.forms.ExistingLocationForm

base_fields = {'loc_bin': <django.forms.models.ModelChoiceField object>, 'loc_row': <django.forms.models.ModelChoiceField object>, 'loc_tier': <django.forms.models.ModelChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ExistingProductForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: fpiweb.forms.ProductForm

base_fields = {'product': <django.forms.models.ModelChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'product': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ExpMoEndForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

A form for use whenever you need to select an ending month.

base_fields = {'exp_month_end': <django.forms.fields.TypedChoiceField object>}
declared_fields = {'exp_month_end': <django.forms.fields.TypedChoiceField object>}
property media

Return all media required to render the widgets on this form.

valid_months = [(0, 'No Label'), ('1', 'Jan'), ('2', 'Feb'), ('3', 'Mar'), ('4', 'Apr'), ('5', 'May'), ('6', 'Jun'), ('7', 'Jul'), ('8', 'Aug'), ('9', 'Sep'), ('10', 'Oct'), ('11', 'Nov'), ('12', 'Dec')]
class fpiweb.forms.ExpMoStartForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

A form for use whenever you need to select a starting month.

base_fields = {'exp_month_start': <django.forms.fields.TypedChoiceField object>}
declared_fields = {'exp_month_start': <django.forms.fields.TypedChoiceField object>}
property media

Return all media required to render the widgets on this form.

valid_months = [(0, 'No Label'), ('1', 'Jan'), ('2', 'Feb'), ('3', 'Mar'), ('4', 'Apr'), ('5', 'May'), ('6', 'Jun'), ('7', 'Jul'), ('8', 'Aug'), ('9', 'Sep'), ('10', 'Oct'), ('11', 'Nov'), ('12', 'Dec')]
class fpiweb.forms.ExpYearForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

A form for use whenever you need to select a year.

base_fields = {'exp_year': <django.forms.fields.TypedChoiceField object>}
declared_fields = {'exp_year': <django.forms.fields.TypedChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ExtantBoxNumberField(**kwargs)[source]

Bases: fpiweb.forms.RelaxedBoxNumberField

Checks whether there’s a Box with the specified box number in the database. If a matching Box is found, this Box is stored in the field’s box attribute

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

class fpiweb.forms.ExtantBoxNumberForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {'box_number': <fpiweb.forms.ExtantBoxNumberField object>}
declared_fields = {'box_number': <fpiweb.forms.ExtantBoxNumberField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.FillBoxForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ['product', 'exp_year', 'exp_month_start', 'exp_month_end']
model

alias of fpiweb.models.Box

base_fields = {'exp_month_end': <django.forms.fields.TypedChoiceField object>, 'exp_month_start': <django.forms.fields.TypedChoiceField object>, 'exp_year': <django.forms.fields.TypedChoiceField object>, 'product': <django.forms.models.ModelChoiceField object>}
clean()[source]

Clean and validate the data in this box record.

Returns

declared_fields = {'exp_month_end': <django.forms.fields.TypedChoiceField object>, 'exp_month_start': <django.forms.fields.TypedChoiceField object>, 'exp_year': <django.forms.fields.TypedChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.FilledBoxNumberField(**kwargs)[source]

Bases: fpiweb.forms.ExtantBoxNumberField

Checks whether there’s a Box with the specified box number in the database. If a matching Box is found, this Box is stored in the field’s box attribute

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

class fpiweb.forms.FilledBoxNumberForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {'box_number': <fpiweb.forms.FilledBoxNumberField object>}
declared_fields = {'box_number': <fpiweb.forms.FilledBoxNumberField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.HiddenPalletForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {'pallet': <django.forms.models.ModelChoiceField object>}
declared_fields = {'pallet': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.Html5DateInput(attrs=None, format=None)[source]

Bases: django.forms.widgets.DateInput

input_type = 'date'
property media
class fpiweb.forms.LocBinForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Manage Location bin details with a generic form.

class Meta[source]

Bases: object

Additional info to help Django provide intelligent defaults.

fields = ['id', 'loc_bin', 'loc_bin_descr']
model

alias of fpiweb.models.LocBin

base_fields = {'loc_bin': <django.forms.fields.CharField object>, 'loc_bin_descr': <django.forms.fields.CharField object>}
clean()[source]

Clean and validate the data given for the bin record.

Returns

declared_fields = {'loc_bin': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

static validate_loc_bin_fields(loc_bin_name: str, loc_bin_descr: str)[source]

Validate the various location bin record fields.

Parameters
  • loc_bin_name – name of bin

  • loc_bin_descr – description of bin

Returns

True if valid

class fpiweb.forms.LocRowForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Manage Location row details with a generic form.

class Meta[source]

Bases: object

Additional info to help Django provide intelligent defaults.

fields = ['id', 'loc_row', 'loc_row_descr']
model

alias of fpiweb.models.LocRow

base_fields = {'loc_row': <django.forms.fields.CharField object>, 'loc_row_descr': <django.forms.fields.CharField object>}
clean()[source]

Clean and validate the data given for the constraint record.

Returns

declared_fields = {'loc_row': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

static validate_loc_row_fields(loc_row_name: str, loc_row_descr: str)[source]

Validate the various location row record fields.

Parameters
  • loc_row_name – name of row

  • loc_row_descr – description of row

Returns

True if valid

class fpiweb.forms.LocTierForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Manage Loction tier details with a generic form.

class Meta[source]

Bases: object

Additional info to help Django provide intelligent defaults.

fields = ['id', 'loc_tier', 'loc_tier_descr']
model

alias of fpiweb.models.LocTier

base_fields = {'loc_tier': <django.forms.fields.CharField object>, 'loc_tier_descr': <django.forms.fields.CharField object>}
clean()[source]

Clean and validate the data given for the tier record.

Returns

declared_fields = {'loc_tier': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

static validate_loc_tier_fields(loc_tier_name: str, loc_tier_descr: str)[source]

Validate the various location tier record fields.

Parameters
  • loc_tier_name – name of tier

  • loc_tier_descr – description of tier

Returns

True if valid

class fpiweb.forms.LocationForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

A form for use whenever you need to select row, bin, and tier

class Meta[source]

Bases: object

fields = ('loc_row', 'loc_bin', 'loc_tier')
model

alias of fpiweb.models.Location

base_fields = {'loc_bin': <django.forms.models.ModelChoiceField object>, 'loc_row': <django.forms.models.ModelChoiceField object>, 'loc_tier': <django.forms.models.ModelChoiceField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ManualLocTableForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ['loc_code', 'loc_descr', 'loc_in_warehouse', 'loc_bin', 'loc_row', 'loc_tier']
model

alias of fpiweb.models.Location

base_fields = {'loc_bin': <django.forms.models.ModelChoiceField object>, 'loc_code': <django.forms.fields.CharField object>, 'loc_descr': <django.forms.fields.CharField object>, 'loc_in_warehouse': <django.forms.fields.BooleanField object>, 'loc_row': <django.forms.models.ModelChoiceField object>, 'loc_tier': <django.forms.models.ModelChoiceField object>}
clean()[source]

Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.

declared_fields = {'loc_code': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

static validate_manual_loc_table_fields(loc_code: str, loc_descr: str, loc_in_warehouse: bool, loc_bin: int, loc_row: int, loc_tier: int)[source]

Validate the various Location record fields :param loc_code: Location Code :param loc_descr: Location Description :param loc_bin: Location Bin :param loc_row: Location Row :param loc_tier: Location Tier

class fpiweb.forms.MoveToLocationForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: fpiweb.forms.ExistingLocationForm

base_fields = {'from_location': <django.forms.models.ModelChoiceField object>, 'loc_bin': <django.forms.models.ModelChoiceField object>, 'loc_row': <django.forms.models.ModelChoiceField object>, 'loc_tier': <django.forms.models.ModelChoiceField object>}
declared_fields = {'from_location': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.NewBoxForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ['box_number', 'box_type']
model

alias of fpiweb.models.Box

base_fields = {'box_number': <django.forms.fields.CharField object>, 'box_type': <django.forms.models.ModelChoiceField object>}
declared_fields = {'box_number': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

save(commit=True)[source]

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

class fpiweb.forms.NewBoxNumberField(**kwargs)[source]

Bases: fpiweb.forms.RelaxedBoxNumberField

Add a new box number to the database.

Checks whether there’s a Box with the specified box number in the database. If a matching Box is not found, store the box number in the field’s box attribute

clean(value)[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

class fpiweb.forms.NewBoxNumberForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {'box_number': <fpiweb.forms.NewBoxNumberField object>}
declared_fields = {'box_number': <fpiweb.forms.NewBoxNumberField object>}
property media

Return all media required to render the widgets on this form.

fpiweb.forms.NormalizeEmail(email)[source]

Normalize an email address.

Django normalizes by lower-casing the domain portion of the address.

Parameters

email

Returns

class fpiweb.forms.PalletNameForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

class Meta[source]

Bases: object

fields = ('name',)
model

alias of fpiweb.models.Pallet

base_fields = {'name': <django.forms.fields.CharField object>}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.PalletSelectForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

base_fields = {'pallet': <django.forms.models.ModelChoiceField object>}
declared_fields = {'pallet': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ProductCategoryForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Manage Product Category details with a generic form.

class Meta[source]

Bases: object

Additional info to help Django provide intelligent defaults.

fields = ['id', 'prod_cat_name', 'prod_cat_descr']
model

alias of fpiweb.models.ProductCategory

base_fields = {'prod_cat_descr': <django.forms.fields.CharField object>, 'prod_cat_name': <django.forms.fields.CharField object>}
clean()[source]

Clean and validate the data given for the constraint record.

Returns

declared_fields = {'prod_cat_name': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

static validate_prod_cat_fields(prod_cat_name: str, prod_cat_descr: str)[source]

Validate the various product category record fields.

Parameters
  • prod_cat_name – name of product catagory

  • prod_cat_descr – description of product description

Returns

True if valid

class fpiweb.forms.ProductExampleForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Manage Loction row details with a generic form.

class Meta[source]

Bases: object

Additional info to help Django provide intelligent defaults.

fields = ['id', 'prod_example_name', 'product']
model

alias of fpiweb.models.ProductExample

base_fields = {'prod_example_name': <django.forms.fields.CharField object>, 'product': <django.forms.models.ModelChoiceField object>}
clean()[source]

Clean and validate the data given for the constraint record.

Returns

declared_fields = {'prod_example_name': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

static validate_product_example_fields(prod_example_name: str, product: int)[source]

Validate the Product Example Name and Foreigh Key Product ID

Parameters
  • product_example_name – name of product example

  • product – foreign key from products table

Returns

True if valid

class fpiweb.forms.ProductForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.forms.Form

A form for use whenever you need to select a product.

base_fields = {'product': <django.forms.models.ModelChoiceField object>}
declared_fields = {'product': <django.forms.models.ModelChoiceField object>}
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.ProductNameForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.models.ModelForm

Manage Product details with a generic form.

class Meta[source]

Bases: object

Additional info to help Django provide intelligent defaults.

fields = ['id', 'prod_name', 'prod_cat']
model

alias of fpiweb.models.Product

base_fields = {'prod_cat': <django.forms.models.ModelChoiceField object>, 'prod_name': <django.forms.fields.CharField object>}
clean()[source]

Clean and validate the data given for the constraint record.

Returns

declared_fields = {'prod_name': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

static validate_product_fields(prod_name: str, prod_cat: int)[source]

Validate the various product category record fields.

Parameters
  • prod_cat_name – name of product

  • prod_cat_id – foreign key from product category

Returns

True if valid

class fpiweb.forms.RelaxedBoxNumberField(**kwargs)[source]

Bases: django.forms.fields.CharField

Define box nummber field that allows all numberics.

Accepts box number with or without BOX prefix. Returns BoxNumber with BOX prefix and leading zeros

clean(value: str) → str[source]

Validate the given value and return its “cleaned” value as an appropriate Python object. Raise ValidationError for any errors.

class fpiweb.forms.UserInfoForm(*args, **kwargs)[source]

Bases: django.forms.forms.Form

Define all the fields and modes needed to add or edit a user

LEVEL_CHOICES = [('No_Access', 'No_Access'), ('Volunteer', 'Volunteer'), ('Staff', 'Staff'), ('Admin', 'Admin')]
class Meta[source]

Bases: object

fields = ['userid', 'username', 'force_password', 'first_name', 'last_name', 'email', 'title', 'access_level', 'is_active']
base_fields = {'access_level': <django.forms.fields.ChoiceField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'force_password': <django.forms.fields.BooleanField object>, 'is_active': <django.forms.fields.BooleanField object>, 'last_name': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}
clean()[source]

Validate the consistency across firlds.

Returns

clean_access_level()[source]
clean_email()[source]
clean_first_name()[source]
clean_force_password()[source]
clean_is_active()[source]
clean_last_name()[source]
clean_title()[source]
clean_username()[source]

ensure that the username does not contain screwball characters

declared_fields = {'access_level': <django.forms.fields.ChoiceField object>, 'email': <django.forms.fields.EmailField object>, 'first_name': <django.forms.fields.CharField object>, 'force_password': <django.forms.fields.BooleanField object>, 'is_active': <django.forms.fields.BooleanField object>, 'last_name': <django.forms.fields.CharField object>, 'title': <django.forms.fields.CharField object>, 'username': <django.forms.fields.CharField object>}
level = 99
level_entry = ('Admin', 'Admin')
property media

Return all media required to render the widgets on this form.

class fpiweb.forms.UserInfoModes(value)[source]

Bases: enum.Enum

Mode identifiers used in both UserInfoForm and in multiple views.

These modes are used throughout the user management processing in an attempt to minimize code duplication. They are defined here (rather than in the views) to eliminate circular references.

MODE_ADD_USER: str = 'add user'
MODE_CONFIRM: str = 'confirm action'
MODE_SHOW_USERS: str = 'show users'
MODE_UPDATE_USER: str = 'update user'
do_not_call_in_templates = True
fpiweb.forms.add_no_selection_choice(other_choices, dash_count=2)[source]
fpiweb.forms.bin_choices()[source]
fpiweb.forms.box_number_validator(value) → None[source]
fpiweb.forms.char_list_choices(constraint_name)[source]
fpiweb.forms.expire_year_choices()[source]
fpiweb.forms.min_max_choices(constraint_name)[source]
fpiweb.forms.month_choices()[source]
fpiweb.forms.none_or_int(text: str) → Optional[int][source]

Convert test to a valid integer or None.

Parameters

text

Returns

fpiweb.forms.none_or_list(text: str) → Optional[list][source]

Convert text to list or None.

Parameters

text

Returns

fpiweb.forms.none_or_str(text: str) → Optional[str][source]

Convert text to non-empty string or None.

Parameters

text

Returns

fpiweb.forms.row_choices()[source]
fpiweb.forms.tier_choices()[source]
fpiweb.forms.validate_exp_month_start_end(exp_month_start: Optional[int], exp_month_end: Optional[int]) → bool[source]

Validate the start and end month, if given.

Parameters
  • exp_month_start – number 1-12 (integer or string)

  • exp_month_end – number 1-12 (integer or string)

Returns

fpiweb.forms.validate_int_list(char_list: list) → bool[source]

Verify that all values in the list are integers.

Parameters

text

Returns

fpiweb.forms.validation_exp_months_bool(exp_month_start: Optional[int], exp_month_end: Optional[int])fpiweb.constants.ValidOrErrorResponse[source]

Validate the expiration months returning only a boolean.

Parameters
  • exp_month_start

  • exp_month_end

Returns

True if valid, False if not

fpiweb.models module

models.py - Define the database tables using ORM models.

class fpiweb.models.Activity(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Activity (history) from the past.

ADJUSTMENT_CODE_CHOICES: list = (('Fill Emptied', 'Fill emptied previous contents'), ('Move Added', 'Move added box'), ('Move Consumed', 'Move consumed the box'), ('Consume Added', 'Consume added box'), ('Consume Emptied', 'Consume emptied previous contents'))
CONSUME_ADDED: str = 'Consume Added'
CONSUME_EMPTIED: str = 'Consume Emptied'
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FILL_EMPTIED: str = 'Fill Emptied'
MOVE_ADDED: str = 'Move Added'
MOVE_CONSUMED: str = 'Move Consumed'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

adjustment_code

Coded reason if this entry was adjusted

adjustment_code_help_text = 'Coded reason if this entry was adjusted'
box_number

Box number on box at time of consumption.

box_number_help_text = 'Box number on box at time of consumption.'
box_type

Box type holding consumed product.

box_type_help_text = 'Box type holding consumed product.'
date_consumed

Date product was consumed.

date_consumed_help_text = 'Date product was consumed.'
date_filled

Approximate date product was put in the box.

date_filled_help_text = 'Approximate date product was put in the box.'
duration

Number of days between date box was filled and consumed.

duration_help_text = 'Number of days between date box was filled and consumed.'
exp_month_end

Optional ending month product would have expired.

exp_month_end_help_text = 'Optional ending month product would have expired.'
exp_month_start

Optional starting month product would have expired.

exp_month_start_help_text = 'Optional starting month product would have expired.'
exp_year

Year product would have expired.

exp_year_help_text = 'Year product would have expired.'
get_adjustment_code_display(*, field=<django.db.models.fields.CharField: adjustment_code>)
get_next_by_date_filled(*, field=<django.db.models.fields.DateField: date_filled>, is_next=True, **kwargs)
get_previous_by_date_filled(*, field=<django.db.models.fields.DateField: date_filled>, is_next=False, **kwargs)
id

Internal record identifier for an activity.

id_help_text = 'Internal record identifier for an activity.'
loc_bin

Bin box was in at the time product was consumed.

loc_bin_help_text = 'Bin box was in at the time product was consumed.'
loc_row

Row box was in at the time product was consumed.

loc_row_help_text = 'Row box was in at the time product was consumed.'
loc_tier

Tier box was in at the time product was consumed.

loc_tier_help_text = 'Tier box was in at the time product was consumed.'
objects = <django.db.models.manager.Manager object>
prod_cat_name

Category of product consumed.

prod_cat_name_help_text = 'Category of product consumed.'
prod_name

Product contained in box at time of consumption.

prod_name_help_text = 'Product contained in box at time of consumption.'
quantity

Approximate number of items in the box when it was filled.

quantity_help_text = 'Approximate number of items in the box when it was filled.'
class fpiweb.models.Box(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Box or container for product.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

box_number

Number printed in the label on the box.

box_number_help_text = 'Number printed in the label on the box.'
box_number_max_length = 8
box_number_min_length = 8
box_type

Type of box with this number.

static box_type_default()[source]
box_type_help_text = 'Type of box with this number.'
box_type_id
date_filled

Approximate date box was filled, if filled.

date_filled_help_text = 'Approximate date box was filled, if filled.'
exp_month_end

Optional emding month range of when the product expires, if filled.

exp_month_end_help_text = 'Optional ending month range of when the product expires, if filled.'
exp_month_start

Optional starting month range of when the product expires, if filled.

exp_month_start_help_text = 'Optional starting month range of when the product expires, if filled.'
exp_year

Year the product expires, if filled.

exp_year_help_text = 'Year the product expires, if filled.'
get_absolute_url()[source]
id

Internal record identifier for box.

id_help_text = 'Internal record identifier for box.'
is_filled()[source]
location

Location of box

location_help_text = 'Location of box'
location_id
objects = <django.db.models.manager.Manager object>
palletbox_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

product

Product contained in this box, if filled.

product_help_text = 'Product contained in this box, if filled.'
product_id
quantity

Approximate or default number of items in the box, if filled.

quantity_help_text = 'Approximate or default number of items in the box, if filled.'
static select_location(queryset)[source]

Since we’re probably going to have a lot of Box queries where we also want to pull in location data

exception fpiweb.models.BoxError[source]

Bases: RuntimeError

class fpiweb.models.BoxNumber[source]

Bases: object

box_number_regex = re.compile('^BOX\\d{5}$')
box_number_search_regex = re.compile('box\\d{5}', re.IGNORECASE)
static format_box_number(int_box_number: int) → str[source]

format an integer into a box number

static get_next_box_number() → str[source]

get the next unused box number

static validate(box_number: str) → bool[source]

validate that a string is of the form ‘BOXnnnnn’

class fpiweb.models.BoxType(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Type of box (Evan’s boxes, large boxes, etc.) and default quantity.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

box_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

box_type_code

Type of box (code or shorthand).

box_type_code_help_text = 'Type of box (code or shorthand).'
box_type_code_max_len = 10
box_type_descr

Type of box (description).

box_type_descr_help_text = 'Type of box (description).'
box_type_descr_max_len = 30
box_type_qty

Number of items (usually cans) that can typically fix in this box.

box_type_qty_help_text = 'Number of items (usually cans) that can typically fit in this box.'
id

Internal record identifier for box type.

id_help_text = 'Internal record identifier for box type.'
objects = <django.db.models.manager.Manager object>
class fpiweb.models.Constraints(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Constraints of valid values.

BIN: str = 'Bin'
CHAR_LIST = 'Char-List'
CHAR_RANGE = 'Char-MM'
CONSTRAINT_NAME_CHOICES = (('Row', 'Rows in the warehouse'), ('Bin', 'Bins in the Warehouse'), ('Tier', 'Tiers in the Warehouse'), ('Location Exclusions', 'Warehouse locations excluded from inventory'), ('Quantity Limit', 'Typical count of items in a box'), ('Future Expiration Year Limit', 'Maximum years of future expiration permitted'))
CONSTRAINT_TYPE_CHOICES = (('Int-MM', 'Integer Min/Max'), ('Char-MM', 'Character Min/Max'), ('Int-List', 'Integer Valid List'), ('Char-List', 'Character Valid List'))
exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FUTURE_EXP_YEAR_LIMIT = 'Future Expiration Year Limit'
INT_LIST = 'Int-List'
INT_RANGE = 'Int-MM'
LOCATION_EXCLUSIONS = 'Location Exclusions'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

QUANTITY_LIMIT: str = 'Quantity Limit'
ROW: str = 'Row'
TIER: str = 'Tier'
constraint_descr

Description of this constraint.

constraint_descr_help_text = 'Description of this constraint.'
constraint_list

If a list, what are the valid values?

constraint_list_help_text = 'If a list, what are the valid values?'
constraint_max

If a range, what is the maximum valid value?

constraint_max_help_text = 'If a range, what is the maximum valid value?'
constraint_min

If a range, what is the minimum valid value?

constraint_min_help_text = 'If a range, what is the minimum valid value?'
constraint_name

Coded name of a constraint.

constraint_name_help_text = 'Coded name of a constraint.'
constraint_type

Type of constraint (integer or character, list or range).

constraint_type_help_text = 'Type of constraint (integer or character, list or range).'
get_constraint_name_display(*, field=<django.db.models.fields.CharField: constraint_name>)
get_constraint_type_display(*, field=<django.db.models.fields.CharField: constraint_type>)
static get_values(constraint_name)[source]
id

Internal record identifier for a constraint.

id_help_text = 'Internal record identifier for a constraint.'
objects = <django.db.models.manager.Manager object>
class fpiweb.models.LocBin(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Location Bin in warehouse.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

Internal record identifier for the location bin.

id_help_text = 'Internal record id for location bin.'
loc_bin

Location Bin Designation

loc_bin_descr

Location Bin Description

loc_bin_descr_help_text = 'Location bin description'
loc_bin_descr_max_length = 20
loc_bin_help_text = 'Location bin designation'
loc_bin_max_length = 2
loc_bin_min_length = 2
location_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
class fpiweb.models.LocRow(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Location Row in warehouse.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

Internal record identifier for the location row.

id_help_text = 'Internal record id for location row.'
loc_row

Location Row Designation

loc_row_descr

Location Row Description

loc_row_descr_help_text = 'Location row description'
loc_row_descr_max_length = 20
loc_row_help_text = 'Location row designation'
loc_row_max_length = 2
loc_row_min_length = 2
location_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
class fpiweb.models.LocTier(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Location Tier in warehouse.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

Internal record identifier for the location tier.

id_help_text = 'Internal record id for location tier.'
loc_tier

Location Tier Designation

loc_tier_descr

Location Tier Description

loc_tier_descr_help_text = 'Location tier description'
loc_tier_descr_max_length = 20
loc_tier_help_text = 'Location tier designation'
loc_tier_max_length = 2
loc_tier_min_length = 2
location_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

objects = <django.db.models.manager.Manager object>
class fpiweb.models.Location(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Location for a filled box or other container.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

box_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

static get_location(loc_row: Union[fpiweb.models.LocRow, int, str], loc_bin: Union[fpiweb.models.LocBin, int, str], loc_tier: Union[fpiweb.models.LocTier, int, str])[source]

This method originated as convenient way to retrieve a Location from the database inside a test. :param loc_row: :param loc_bin: :param loc_tier: :return: Location or None

id

Internal record identifier for location.

id_help_text = 'Internal record identifier for location.'
loc_bin

Bin indicator of this location.

loc_bin_help_text = 'Loc bin'
loc_bin_id
loc_code

Coded Location.

loc_code_help_text = 'Location code'
loc_code_max_length = 12
loc_descr

Location description.

loc_descr_help_text = 'Location description'
loc_descr_max_length = 25
loc_in_warehouse

Is this location inside the warehouse?

loc_in_warehouse_help_text = 'In warehouse?'
loc_row

Row indicator of this location.

loc_row_help_text = 'Loc row'
loc_row_id
loc_tier

Tier indicator of this location.

loc_tier_help_text = 'Loc tier'
loc_tier_id
objects = <django.db.models.manager.Manager object>
pallet_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fpiweb.models.Pallet(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Temporary file to build up a list of boxes on a pallet.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

FILL: str = 'Fill'
MERGE: str = 'Merge'
MOVE: str = 'Move'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

PALLET_STATUS_CHOICES = (('Fill', 'Fill pallet for new location'), ('Merge', 'Merging boxes on pallet'), ('Move', 'Moving boxes to new location'))
boxes

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

get_pallet_status_display(*, field=<django.db.models.fields.CharField: pallet_status>)
id

Internal record identifier for a pallet.

id_help_text = 'Internal record identifier for a pallet.'
location

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

location_id
name

Name of pallet.

name_help_text = 'Name of pallet'
objects = <django.db.models.manager.Manager object>
pallet_status

Current status of pallet

pallet_status_help_text = 'Current status of pallet.'
profile_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fpiweb.models.PalletBox(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Temporary file to hold the individual boxes for a pallet. The goal of this is to ensure that either a Box record has product, expiration, and location or it has no product, no expiration, and no location.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

MOVE: str = 'Move'
exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

NEW: str = 'New'
ORIGINAL: str = 'Original'
PALLET_BOX_STATUS_CHOICES = (('New', 'New box added'), ('Original', 'Box already here'), ('Move', 'Box being moved'))
box

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

box_help_text = 'Internal record identifier for a box.'
box_id
box_number

Number printed in the label on the box.

box_status

Box on pallet status

box_status_help_text = 'Box on pallet status.'
exp_month_end

Optional emding month range of when the product expires, if filled.

exp_month_end_help_text = 'Optional ending month range of when the product expires, if filled.'
exp_month_start

Optional starting month range of when the product expires, if filled.

exp_month_start_help_text = 'Optional starting month range of when the product expires, if filled.'
exp_year

Year the product expires, if filled.

exp_year_help_text = 'Year the product expires, if filled.'
get_box_status_display(*, field=<django.db.models.fields.CharField: box_status>)
id

Internal record identifier for a pallet box.

id_help_text = 'Internal record identifier for a pallet box.'
objects = <django.db.models.manager.Manager object>
pallet

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

pallet_help_text = 'Internal record identifier for a pallet.'
pallet_id
product

Product contained in this box, if filled.

product_help_text = 'Product contained in this box, if filled.'
product_id
class fpiweb.models.Product(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Product name and attributes. Oranges, Pineapple, Mixed Fruit are products within the Fruits category

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

box_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

id

Internal record identifier for product.

id_help_text = 'Internal record identifier for product.'
objects = <django.db.models.manager.Manager object>
palletbox_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

prod_cat

Product category associated with this product.

prod_cat_help_text = 'Product category associated with this product.'
prod_cat_id
prod_name

Name of this product.

prod_name_help_text = 'Name of this product.'
prod_name_max_length = 30
productexample_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fpiweb.models.ProductCategory(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Category or group of product. i.e. Tomato Soup, Canned Pasta, Fruits

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

Internal record identifier for product category.

id_help_text = 'Internal record identifier for product category.'
objects = <django.db.models.manager.Manager object>
prod_cat_descr

Description of this product category.

prod_cat_descr_help_text = 'Description of this product category.'
prod_cat_name

Name of this product category.

prod_cat_name_help_text = 'Name of this product category.'
prod_cat_name_max_length = 30
product_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class fpiweb.models.ProductExample(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Examples of items that go into a labeled product.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

id

Internal reccord identifier for product example

id_help_text = 'Internal record identifier for product example'
objects = <django.db.models.manager.Manager object>
prod_example_name

Name of example product.

prod_example_name_help_text = 'Name of example product.'
prod_example_name_max_length = 30
product

Product with which this product example is associated.

product_help_text = 'Product with which this product name is associated.'
product_id
class fpiweb.models.Profile(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Track more information about the users of our system.

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

active_pallet

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

active_pallet_help_text = 'Active Pallet'
active_pallet_id
id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
title

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

title_help_text = 'Job title'
title_max_length = 30
user

Internal link to the default or custom Django User table.

user_id

fpiweb.password_validation module

class fpiweb.password_validation.CurrentMonthInPasswordValidator[source]

Bases: object

get_help_text()[source]
validate(password, user=None)[source]
class fpiweb.password_validation.ShortPasswordValidator(length_threshold=12)[source]

Bases: object

get_help_text()[source]
validate(password, user=None)[source]
class fpiweb.password_validation.WarmInPasswordValidator[source]

Bases: object

get_help_text()[source]
validate(password, user=None)[source]

fpiweb.qr_code_utilities module

qr_code_utilities.py - support code for scanning QR codes.

fpiweb.qr_code_utilities.get_qr_code_svg(data_string, include_xml_declaration=False)[source]

Manages svg images

Parameters

include_xml_declaration

Returns

fpiweb.urls module

Manage the urls for the F. P. I. application.

fpiweb.views module

views.py - establish the views (pages) for the F. P. I. web application.

class fpiweb.views.AboutView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

The About View for this application.

context_object_name = 'about_context'
get_context_data(**kwargs)[source]

Add Site Information to About page.

Parameters

kwargs

Returns

template_name = 'fpiweb/about.html'
class fpiweb.views.ActivityDownloadView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

class Echo[source]

Bases: object

An object that implements just the write method of the file-like interface.

static write(value)[source]

Write the value by returning it, instead of storing in a buffer.

Parameters

value

Returns

date_format = '%m/%d/%Y'
get(request, *args, **kwargs)[source]
permission_required = ('fpiweb.view_activity',)
write_rows()[source]
class fpiweb.views.BoxDetailsView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.detail.DetailView

context_object_name = 'box'
get_context_data(**kwargs)[source]

Insert the single object into the context dict.

model

alias of fpiweb.models.Box

permission_required = ('fpiweb.dummy_profile',)
template_name = 'fpiweb/box_detail.html'
class fpiweb.views.BoxEditView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

context_object_name = 'box'
form_class

alias of fpiweb.forms.NewBoxForm

model

alias of fpiweb.models.Box

permission_required = ('fpiweb.dummy_profile',)
success_url = '/fpiweb/index/'
template_name = 'fpiweb/box_edit.html'
class fpiweb.views.BoxEmptyMoveView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.TemplateView

get_context_data(**kwargs)[source]
permission_required = ('fpiweb.dummy_profile',)
template_name = 'fpiweb/box_empty_move.html'
class fpiweb.views.BoxEmptyView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

permission_required = ('fpiweb.dummy_profile',)
class fpiweb.views.BoxItemFormView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

static get_form(pallet_box, prefix=None)[source]
permission_required = ('fpiweb.add_box',)
post(request)[source]
template_name = 'fpiweb/box_form.html'
class fpiweb.views.BoxMoveView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.TemplateView

get_context_data(**kwargs)[source]
permission_required = ('fpiweb.dummy_profile',)
template_name = 'fpiweb/box_empty_move.html'
class fpiweb.views.BoxNewView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

get(request, *args, **kwargs)[source]

Prepare to present the new box view.

Parameters
  • request

  • args

  • kwargs

Returns

permission_required = ('fpiweb.dummy_profile',)
post(request, *args, **kwargs)[source]
template_name = 'fpiweb/box_new.html'
class fpiweb.views.BoxScannedView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

get(request, **kwargs)[source]
permission_required = ('fpiweb.dummy_profile',)
class fpiweb.views.BoxTypeMaintenanceCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.contrib.messages.views.SuccessMessageMixin, django.views.generic.edit.CreateView

context_object_name = 'box_type_maintenance'
form_class

alias of fpiweb.forms.BoxTypeMaintenanceForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.BoxType

permission_required = 'fpiweb.add_box_type_maintenance'
success_message = ' A new BoxType has been successfully added.'
success_url = '/fpiweb/box_type_maintenance/'
template_name = 'fpiweb/box_type_maintenance_edit.html'
class fpiweb.views.BoxTypeMaintenanceDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.DeleteView

context_object_name = 'box_type_maintenance'
delete(request, *args, **kwargs)[source]

Call the delete() method on the fetched object and then redirect to the success URL.

error_message = 'Unable to Delete this Box Type. Before deleting this Box Type it is necessary to Delete every Box that uses this Box Type. (Cascade Delete Protected) Click Cancel Button to return to Box Type List page.'
form_class

alias of fpiweb.forms.BoxTypeMaintenanceForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.BoxType

permission_required = 'fpiweb.delete_box_type_maintenance'
success_message = 'Box Type successfully deleted.'
success_url = '/fpiweb/box_type_maintenance/'
template_name = 'fpiweb/box_type_maintenance_delete.html'
class fpiweb.views.BoxTypeMaintenanceListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

context_object_name = 'box_type_maintenance_list_content'
get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.BoxType

permission_required = 'fpiweb.view_box_type'
template_name = 'fpiweb/box_type_maintenance_list.html'
class fpiweb.views.BoxTypeMaintenanceUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.contrib.messages.views.SuccessMessageMixin, django.views.generic.edit.UpdateView

context_object_name = 'box_type_maintenance'
form_class

alias of fpiweb.forms.BoxTypeMaintenanceForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.BoxType

permission_required = 'fpiweb.change_box_type_maintenance'
success_message = 'The Box Type has been successfully updated.'
success_url = '/fpiweb/box_type_maintenance/'
template_name = 'fpiweb/box_type_maintenance_edit.html'
exception fpiweb.views.BuildPalletError[source]

Bases: RuntimeError

class fpiweb.views.BuildPalletView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

Manage preparing a pallet of bxes of product to store in the warehouse.

BoxFormFactory

alias of django.forms.formsets.BoxItemFormFormSet

PALLET_NAME_FORM_NAME = 'pallet_name_form'
PALLET_SELECT_FORM_NAME = 'pallet_select_form'
build_pallet_form_prefix = 'build_pallet'
confirmation_template = 'fpiweb/build_pallet_confirmation.html'
form_template = 'fpiweb/build_pallet.html'
formset_prefix = 'box_forms'
get(request)[source]

Show page to select/add new pallet.

This page will POST back to this view.

Parameters

request – info from Django about this page to display

Returns

prepared web page

hidden_pallet_form_prefix = 'pallet'
page_title = 'Build Pallet'
permission_required = ('fpiweb.build_pallet',)
post(request)[source]
static prepare_pallet_and_pallet_boxes(pallet_form, build_pallet_form, box_forms)[source]
process_build_pallet_forms(request)[source]
show_forms_response(request, build_pallet_form, box_forms, pallet_form, status=<HTTPStatus.BAD_REQUEST: 400>)[source]

Display page with BuildPalletForm and BoxItemForms :param request: :param build_pallet_form: :param box_forms: :param pallet_form: :param status: :return:

static show_pallet_management_page(request, pallet_select_form=None, pallet_name_form=None, status_code=<HTTPStatus.OK: 200>)[source]

Prepare info to name or select a pallet.

Note that this is invoking show_page in a different class.

Parameters
  • request – Info from Django

  • pallet_select_form – Form to use to select an existing pallet

  • pallet_name_form – form to use to name a new pallet

  • status_code – status code to send to browser

Returns

prepated web page

class fpiweb.views.ConfirmPasswordChangeView(**kwargs)[source]

Bases: django.contrib.auth.mixins.LoginRequiredMixin, django.views.generic.base.View

Confirm the password was successfully changed.

get(request, *args, **kwargs)[source]

Add user info for the template.

Parameters
  • request

  • args

  • kwargs

Returns

success_url = '/fpiweb/index/'
template_name = 'fpiweb/confirm_password_change.html'
class fpiweb.views.ConstraintCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a constraint using a generic CreateView.

context_object_name = 'constraints'
fields = ['constraint_name', 'constraint_descr', 'constraint_type', 'constraint_min', 'constraint_max', 'constraint_list']
formClass

alias of fpiweb.forms.ConstraintsForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.Constraints

permission_required = ('fpiweb.add_constraints',)
success_url = '/fpiweb/constraints/'
template_name = 'fpiweb/constraint_edit.html'
class fpiweb.views.ConstraintDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.DeleteView

Delete a constraint using a generic DeleteView.

context_object_name = 'constraints'
form_class

alias of fpiweb.forms.ConstraintsForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.Constraints

permission_required = ('fpiweb.delete_constraints',)
success_url = '/fpiweb/constraints/'
template_name = 'fpiweb/constraint_delete.html'
class fpiweb.views.ConstraintUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

Update a constraint using a generic UpdateView.

context_object_name = 'constraints'
form_class

alias of fpiweb.forms.ConstraintsForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.Constraints

permission_required = ('fpiweb.change_constraints',)
success_url = '/fpiweb/constraints/'
template_name = 'fpiweb/constraint_edit.html'
class fpiweb.views.ConstraintsListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List of existing constraints.

context_object_name = 'constraints_list_content'
get_context_data(*, object_list=None, **kwargs)[source]

Add additional content to the context dictionary.

Parameters
  • object_list

  • kwargs

Returns

model

alias of fpiweb.models.Constraints

permission_required = ('fpiweb.view_constraints',)
template_name = 'fpiweb/constraints_list.html'
class fpiweb.views.IndexView(**kwargs)[source]

Bases: django.contrib.auth.mixins.LoginRequiredMixin, django.views.generic.base.TemplateView

Default web page (/index)

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

template_name = 'fpiweb/index.html'
class fpiweb.views.LocBinCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a bin using a generic CreateView.

context_object_name = 'loc_bin'
form_class

alias of fpiweb.forms.LocBinForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocBin

permission_required = ('fpiweb.add_locbin',)
success_url = '/fpiweb/loc_bin/'
template_name = 'fpiweb/loc_bin_edit.html'
class fpiweb.views.LocBinDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.DeleteView

Delete a bin using a generic DeleteView.

context_object_name = 'loc_bin'
form_class

alias of fpiweb.forms.LocBinForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocBin

permission_required = ('fpiweb.delete_locbin',)
success_url = '/fpiweb/loc_bin/'
template_name = 'fpiweb/loc_bin_delete.html'
class fpiweb.views.LocBinListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List of existing bins using a generic ListView.

context_object_name = 'loc_bin_list_content'
get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocBin

permission_required = ('fpiweb.view_locbin',)
template_name = 'fpiweb/loc_bin_list.html'
class fpiweb.views.LocBinUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

Update a bin using a generic UpdateView.

context_object_name = 'loc_bin'
form_class

alias of fpiweb.forms.LocBinForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocBin

permission_required = ('fpiweb.change_locbin',)
success_url = '/fpiweb/loc_bin/'
template_name = 'fpiweb/loc_bin_edit.html'
class fpiweb.views.LocRowCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a row using a generic CreateView.

context_object_name = 'loc_row'
form_class

alias of fpiweb.forms.LocRowForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocRow

permission_required = ('fpiweb.add_locrow',)
success_url = '/fpiweb/loc_row/'
template_name = 'fpiweb/loc_row_edit.html'
class fpiweb.views.LocRowDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.DeleteView

Delete a row using a generic DeleteView.

context_object_name = 'loc_row'
form_class

alias of fpiweb.forms.LocRowForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocRow

permission_required = ('fpiweb.delete_locrow',)
success_url = '/fpiweb/loc_row/'
template_name = 'fpiweb/loc_row_delete.html'
class fpiweb.views.LocRowListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List of existing rows using a generic ListView.

context_object_name = 'loc_row_list_content'
get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocRow

permission_required = ('fpiweb.view_locrow',)
template_name = 'fpiweb/loc_row_list.html'
class fpiweb.views.LocRowUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

Update a row using a generic UpdateView.

context_object_name = 'loc_row'
form_class

alias of fpiweb.forms.LocRowForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocRow

permission_required = ('fpiweb.change_locrow',)
success_url = '/fpiweb/loc_row/'
template_name = 'fpiweb/loc_row_edit.html'
class fpiweb.views.LocTierCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a tier using a generic CreateView.

context_object_name = 'loc_tier'
form_class

alias of fpiweb.forms.LocTierForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocTier

permission_required = ('fpiweb.add_loctier',)
success_url = '/fpiweb/loc_tier/'
template_name = 'fpiweb/loc_tier_edit.html'
class fpiweb.views.LocTierDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.DeleteView

Delete a tier using a generic DeleteView.

context_object_name = 'loc_tier'
form_class

alias of fpiweb.forms.LocTierForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocTier

permission_required = ('fpiweb.delete_loctier',)
success_url = '/fpiweb/loc_tier/'
template_name = 'fpiweb/loc_tier_delete.html'
class fpiweb.views.LocTierListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List of existing tiers using a generic ListView.

context_object_name = 'loc_tier_list_content'
get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocTier

permission_required = ('fpiweb.view_loctier',)
template_name = 'fpiweb/loc_tier_list.html'
class fpiweb.views.LocTierUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

Update a tier using a generic UpdateView.

context_object_name = 'loc_tier'
form_class

alias of fpiweb.forms.LocTierForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.LocTier

permission_required = ('fpiweb.change_loctier',)
success_url = '/fpiweb/loc_tier/'
template_name = 'fpiweb/loc_tier_edit.html'
class fpiweb.views.MANUAL_NOTICE_TYPE(value)[source]

Bases: enum.Enum

Manual generic notice type.

NOTICE: str = 'NOTICE'
QUESTION: str = 'QUESTION'
class fpiweb.views.MaintenanceView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.TemplateView

Default web page (/index)

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

permission_required = ('fpiweb.view_system_maintenance',)
template_name = 'fpiweb/system_maintenance.html'
class fpiweb.views.ManualBoxStatusView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

MODE_CONFIRMATION = 'confirmation'
MODE_ENTER_BOX_NUMBER = 'enter_box_number'
static build_context(*, mode, box_number_form=None, box=None, box_type=None, product_form=None, product=None, location_form=None, location=None, errors=None)[source]
get(request, *args, **kwargs)[source]

Prepare to display consume box number form for the first time.

Parameters
  • request

  • args

  • kwargs

Returns

permission_required = ('fpiweb.view_box',)
post(request, *args, **kwargs)[source]
post_box_number(request)[source]
template_name = 'fpiweb/manual_box_status.html'
class fpiweb.views.ManualCheckinBoxView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

Manually check a box into inventory.

MODE_CONFIRMATION = 'confirmation'
MODE_ENTER_BOX_INFO = 'enter_box_info'
static build_context(*, mode, box_number_form=None, box_number=None, box=None, product_form=None, product=None, location_form=None, location=None, exp_year_form=None, exp_year=None, exp_month_start_form=None, exp_month_start=None, exp_month_end_form=None, exp_month_end=None, errors: Optional[list] = None)[source]
get(request, *args, **kwargs)[source]
permission_required = ('fpiweb.check_in_box',)
post(request, *args, **kwargs)[source]
post_box_info(request)[source]

Validate the posted information.

Parameters

request – container of initial or latest post

Returns

template_name = 'fpiweb/manual_check_in_box.html'
class fpiweb.views.ManualConsumeBoxView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

MODE_CONFIRMATION = 'confirmation'
MODE_CONSUME_BOX = 'consume_box'
MODE_ENTER_BOX_NUMBER = 'enter_box_number'
static build_context(*, mode, box_number_form=None, box=None, box_type=None, product_form=None, product=None, location_form=None, location=None, errors: Optional[list] = None)[source]
get(request, *args, **kwargs)[source]

Prepare to display consume box number form for the first time.

Parameters
  • request

  • args

  • kwargs

Returns

permission_required = ('fpiweb.check_out_box',)
post(request, *args, **kwargs)[source]
post_box_number(request)[source]
post_consume_box(request)[source]
template_name = 'fpiweb/manual_check_out_box.html'
class fpiweb.views.ManualLocTableCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a new entry for Location Table using a generic CreateView.

Added by Mike Rehner

context_object_name = 'manual_loc_table'
form_class

alias of fpiweb.forms.ManualLocTableForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.Location

permission_required = ('fpiweb.add_manual_location_table',)
success_url = '/fpiweb/manual_loc_table/'
template_name = 'fpiweb/manual_loc_table_edit.html'
class fpiweb.views.ManualLocTableListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List the location table entries so they can be edited as needed.

Added by Mike Rehner

context_object_name = 'manual_loc_table'
get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.Location

permission_required = ('fpiweb.view_manual_loc_table',)
template_name = 'fpiweb/manual_loc_table_list.html'
class fpiweb.views.ManualLocTableUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

Update a Rebuild Location Table using a generic UpdateView.

context_object_name = 'manual_loc_table'
form_class

alias of fpiweb.forms.ManualLocTableForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.Location

permission_required = ('fpiweb.change_manual_loc_table',)
success_url = '/fpiweb/manual_loc_table/'
template_name = 'fpiweb/manual_loc_table_edit.html'
class fpiweb.views.ManualMoveBoxView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

MODE_CONFIRMATION = 'confirmation'
MODE_ENTER_BOX_NUMBER = 'enter_box_number'
MODE_ENTER_LOCATION = 'enter_location'
static build_context(*, mode, box_number_form=None, box=None, location_form=None, errors: Optional[list] = None)[source]
get(request, *args, **kwargs)[source]
permission_required = ('fpiweb.move_box',)
post(request, *args, **kwargs)[source]
post_box_number(request)[source]
post_location(request)[source]
template_name = 'fpiweb/manual_move_box.html'
class fpiweb.views.ManualNewBoxView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

MODE_CONFIRMATION = 'confirmation'
MODE_ENTER_BOX_NUMBER = 'enter_box_number'
static build_context(*, mode, box_number_form=None, box=None, box_type=None, box_type_form=None, errors: Optional[list] = None)[source]
get(request, *args, **kwargs)[source]

Prepare to display add new box number form for the first time.

Parameters
  • request

  • args

  • kwargs

Returns

permission_required = ('fpiweb.add_box',)
post(request, *args, **kwargs)[source]
post_box_number(request)[source]
template_name = 'fpiweb/manual_new_box.html'
class fpiweb.views.ManualPalletMoveView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

FORM_PREFIX_CONFIRM_MERGE = 'confirm_merge'
FORM_PREFIX_FROM_LOCATION = 'from'
FORM_PREFIX_TO_LOCATION = 'to'
MODE_COMPLETE = 'complete'
MODE_CONFIRM_MERGE = 'confirm merge'
MODE_ENTER_FROM_LOCATION = 'enter from location'
MODE_ENTER_TO_LOCATION = 'enter to location'
build_response(request, mode, from_location_form=None, to_location_form=None, confirm_merge_form=None, boxes_moved=0, to_location=None, errors=None, status=<HTTPStatus.OK: 200>)[source]
get(request)[source]
static get_next_temp_name()[source]
static get_pallet_and_box_count(from_location, to_location)[source]
move_boxes(request, from_location, to_location)[source]
permission_required = ('fpiweb.move_pallet',)
post(request)[source]
post_confirm_merge_form(request)[source]
post_from_location_form(request)[source]
post_to_location_form(request)[source]
show_to_location_form(request, from_location)[source]
template = 'fpiweb/manual_pallet_move.html'
class fpiweb.views.ManualPalletStatus(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

Show the status of a pallet.

context_object_name = 'manual_pallet_status'
get_(**kwargs)[source]

Add Site Information to About page.

Parameters

kwargs

Returns

model

alias of fpiweb.models.Pallet

permission_required = ('fpiweb.dummy_profile',)
success_url = '/fpiweb/index/'
template_name = 'fpiweb/manual_pallet_status.html'
class fpiweb.views.PalletManagementView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

Select current pallet, add new pallet, delete pallet

get(request)[source]
permission_required = ('fpiweb.dummy_profile',)
static show_page(request, page_title='Pallet Management', show_delete=True, prompt=None, pallet_select_form=None, pallet_name_form=None, status_code=<HTTPStatus.OK: 200>)[source]

Prepare web page from the info received.

Parameters
  • request – infor from Django

  • page_title – title to put in the browser tab

  • show_delete – should a delete option be displayee?

  • prompt – suggestion to the user about what to do

  • pallet_select_form – form to use to select an existing pallet

  • pallet_name_form – form to use to name a new pallet

  • status_code – status code to send to the browser

Returns

a fully rendered web page to send to the browser

template_name = 'fpiweb/pallet_management.html'
class fpiweb.views.PalletSelectView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.FormView

form_class

alias of fpiweb.forms.PalletSelectForm

form_valid(form)[source]

If the form is valid, redirect to the supplied URL.

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

permission_required = ('fpiweb.dummy_profile',)
success_url = '/fpiweb/index/'
template_name = 'fpiweb/pallet_select.html'
class fpiweb.views.ProductCategoryCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a Product Category using a generic CreateView.

context_object_name = 'product_category'
form_class

alias of fpiweb.forms.ProductCategoryForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.ProductCategory

permission_required = ('fpiweb.add_product_category',)
success_url = '/fpiweb/product_category/'
template_name = 'fpiweb/product_category_edit.html'
class fpiweb.views.ProductCategoryListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List of existing Product Categories using a generic ListView.

context_object_name = 'product_category_list_content'
get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.ProductCategory

permission_required = ('fpiweb.view_product_category',)
template_name = 'fpiweb/product_category_list.html'
class fpiweb.views.ProductCategoryUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

Update a Product Category using a generic UpdateView.

context_object_name = 'product_category'
form_class

alias of fpiweb.forms.ProductCategoryForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.ProductCategory

permission_required = ('fpiweb.change_product_category',)
success_url = '/fpiweb/product_category/'
template_name = 'fpiweb/product_category_edit.html'
class fpiweb.views.ProductExampleCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.contrib.messages.views.SuccessMessageMixin, django.views.generic.edit.CreateView

Create a Product Example using a generic CreateView.

context_object_name = 'product_example'
form_class

alias of fpiweb.forms.ProductExampleForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.ProductExample

permission_required = ('fpiweb.add_product_example',)
success_message = 'A new Product Example has been successfully added.'
success_url = '/fpiweb/product_example/'
template_name = 'fpiweb/product_example_edit.html'
class fpiweb.views.ProductExampleDeleteView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.DeleteView

Delete a Product Example using a generic DeleteView.

context_object_name = 'product_example'
delete(request, *args, **kwargs)[source]

Call the delete() method on the fetched object and then redirect to the success URL.

form_class

alias of fpiweb.forms.ProductExampleForm

get_context_data(**kwargs)[source]

Modify the context before rendering the template.

Parameters

kwargs

Returns

model

alias of fpiweb.models.ProductExample

permission_required = ('fpiweb.delete_product_example_name',)
success_message = 'The Product Example has been successfully deleted.'
success_url = '/fpiweb/product_example/'
template_name = 'fpiweb/product_example_delete.html'
class fpiweb.views.ProductExampleListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List of existing Product Examples using a generic ListView.

context_object_name = 'product_example_list_content'
get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.ProductExample

permission_required = ('fpiweb.view_product_example',)
template_name = 'fpiweb/product_example_list.html'
class fpiweb.views.ProductExampleUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.contrib.messages.views.SuccessMessageMixin, django.views.generic.edit.UpdateView

Update a Product Example using a generic UpdateView.

context_object_name = 'product_example'
form_class

alias of fpiweb.forms.ProductExampleForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.ProductExample

permission_required = ('fpiweb.change_product_example_name',)
success_message = 'The Product Example has been has been successfully updated.'
success_url = '/fpiweb/product_example/'
template_name = 'fpiweb/product_example_edit.html'
class fpiweb.views.ProductNameCreateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a Product using a generic CreateView.

context_object_name = 'product_name'
form_class

alias of fpiweb.forms.ProductNameForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.Product

permission_required = ('fpiweb.add_product_name',)
success_url = '/fpiweb/product_name/'
template_name = 'fpiweb/product_name_edit.html'
class fpiweb.views.ProductNameListView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.list.ListView

List of Products using a generic ListView.

context_object_name = 'product_name_list_content'
get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.Product

permission_required = ('fpiweb.view_product_name',)
template_name = 'fpiweb/product_name_list.html'
class fpiweb.views.ProductNameUpdateView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.UpdateView

Update a Product using a generic UpdateView.

context_object_name = 'product_name'
form_class

alias of fpiweb.forms.ProductNameForm

get_context_data(**kwargs)[source]

Add info needed for the navigation bar

Parameters

kwargs

Returns

model

alias of fpiweb.models.Product

permission_required = ('fpiweb.change_product_name',)
success_url = '/fpiweb/product_name/'
template_name = 'fpiweb/product_name_edit.html'
class fpiweb.views.RebuildLocTableFinishView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

build_exclusion_constraint_list()[source]
context_object_name = 'rebuild_loc_table'
get(request)[source]
model

alias of fpiweb.models.Location

permission_required = ('fpiweb.view_constraints', 'fpiweb.view_locationfpiweb.add_location')
rebuild_location_table() → int[source]
template_name = 'fpiweb/rebuild_loc_table_finish.html'
update_row_bin_tier_tables() → Tuple[int, int, int][source]
class fpiweb.views.RebuildLocTableProgressView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

get(request)[source]
permission_required = ('fpiweb.view_constraints', 'fpiweb.view_locationfpiweb.add_location')
class fpiweb.views.RebuildLocTableStartView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

context_object_name = 'rebuild_loc_table'
get(request)[source]
model

alias of fpiweb.models.Location

permission_required = ('fpiweb.view_constraints', 'fpiweb.view_locationfpiweb.add_location')
template_name = 'fpiweb/rebuild_loc_table_start.html'
class fpiweb.views.ScannerView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

static error_response(errors, status=<HTTPStatus.BAD_REQUEST: 400>)[source]
static get_box(scan_data=None, box_number=None)[source]
static get_box_data(scan_data=None, box_number=None)[source]
static get_keyed_in_box_number(box_number)[source]
Parameters

box_number – the box number (a string), may be None

Returns

permission_required = ('fpiweb.dummy_profile',)
post(request, *args, **kwargs)[source]
static response(success, data=None, errors=None, status=<HTTPStatus.OK: 200>)[source]
exception fpiweb.views.ScannerViewError[source]

Bases: RuntimeError

class fpiweb.views.TestScanView(**kwargs)[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.TemplateView

static get_box_scanned_url(box_number)[source]
static get_box_url_by_filters(**filters)[source]
get_context_data(**kwargs)[source]
permission_required = ('fpiweb.dummy_profile',)
template_name = 'fpiweb/test_scan.html'
class fpiweb.views.UserCreateview[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.edit.CreateView

Create a new user to this system.

static build_add_context(*, mode, key=None, this_user_info=None, target_user=None, target_user_form=None, errors=None)[source]
fields = ['username', 'userpswd', 'confirm_pwd', 'force_password', 'first_name', 'last_name', 'email', 'title', 'access_level', 'is_active', 'is_superuser']
form_class

alias of fpiweb.forms.UserInfoForm

get(request, *args, **kwargs)[source]

Prepare to display list of users to change.

Parameters
  • request

  • args

  • kwargs

Returns

model = 'auth.User'
permission_required = ('fpiweb.view_system_maintenance',)
post(request, *args, **kwargs)[source]

Validate the new user info.

Parameters
  • request

  • args

  • kwargs

Returns

success_url = '/fpiweb/user_mgmt/'
template_name = 'fpiweb/user_edit.html'
class fpiweb.views.UserManagementView[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

Allow staff and administrators to manage any users access

static build_context(*, mode, this_user_info=None, target_user_info=None, perm_level=None, user_info_list=None, user_list_count=None, errors=None)[source]
get(request, *args, **kwargs)[source]

Prepare to display list of users to change.

Parameters
  • request

  • args

  • kwargs

Returns

permission_required = ('fpiweb.view_system_maintenance',)
template_name = 'fpiweb/user_management.html'
class fpiweb.views.UserUpdateView[source]

Bases: django.contrib.auth.mixins.PermissionRequiredMixin, django.views.generic.base.View

Update a user by someone else.

static build_update_context(*, mode, key=None, this_user_info=None, target_user=None, target_user_form=None, errors=None)[source]
form_class

alias of fpiweb.forms.UserInfoForm

get(request, *args, **kwargs)[source]

Modify the context before rendering the template.

Parameters
  • request

  • args

  • kwargs

Returns

permission_required = ('fpiweb.view_system_maintenance',)
post(request, *args, **kwargs)[source]

Validate the new user info.

Parameters
  • request

  • args

  • kwargs

Returns

success_url = '/fpiweb/user_mgmt/'
template_name = 'fpiweb/user_edit.html'
fpiweb.views.add_navbar_vars(user: Optional, context: Dict) → Dict[source]

Add context variables needed by the navigation bar.

Parameters
  • user – user record (usually extracted from the request object

  • context – current context

Returns

modified context

fpiweb.views.error_page(request, message=None, message_list=(), status=<HTTPStatus.BAD_REQUEST: 400>)[source]
fpiweb.views.get_user_and_profile(request)[source]
fpiweb.views.manual_generic_notification(request, note_type: fpiweb.views.MANUAL_NOTICE_TYPE, title: Optional[str] = None, message_list: tuple = (), action_message: str = '', yes_url: str = 'fpiweb:about', no_url: str = 'fpiweb:about', return_url: str = 'fpiweb:about', status: int = <HTTPStatus.OK: 200>)[source]

Provide a generic notification screen for the manual box subsystem.

Parameters
  • request – request info from calling view

  • note_type – type of notice (error or note)

  • title – title to use for notification

  • message_list – List of lines to display in notification

  • action_message – final message or question

  • yes_url – if question, url for yes action

  • no_url – if question, url for no action

  • return_url – if notice, url to go to after notification

  • status – status code to flag notification if needed

Returns