beef package
beef.forms module
- class beef.forms.BaseFeedAdditiveDoseFormSet(data=None, files=None, auto_id='id_%s', prefix=None, queryset=None, *, initial=None, **kwargs)
Bases:
coolfarmtool.forms.BaseModelFormSet
- clean()
Hook for doing any extra formset-wide cleaning after Form.clean() has been called on every form. Any ValidationError raised by this method will not be associated with a particular form; it will be accessible via formset.non_form_errors()
- class beef.forms.BeefGeneralForm(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)
Bases:
coolfarmtool.forms.ConditionalModelForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.EnergyForm(*args, **kwargs)
Bases:
floppyforms.__future__.models.ModelForm
- property media
Return all media required to render the widgets on this form.
- save(commit=True, *args, **kwargs)
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 beef.forms.EnergyUsageForm(*args, **kwargs)
Bases:
farm.forms.EnergyUsageForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.FarmLivestockPropertiesForm(*args, **kwargs)
Bases:
floppyforms.__future__.models.ModelForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.FeedAdditiveDoseForm(*args, **kwargs)
Bases:
cattle.forms.BaseCattleFeedAdditiveDoseForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.FeedComponentForm1(*args, **kwargs)
Bases:
cattle.forms.BaseCattleFeedComponentForm1
- clean()
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__’.
- property media
Return all media required to render the widgets on this form.
- class beef.forms.FeedComponentForm2(*args, **kwargs)
Bases:
cattle.forms.BaseCattleFeedComponentForm2
- property media
Return all media required to render the widgets on this form.
- class beef.forms.FeedForm(*args, **kwargs)
Bases:
cattle.forms.BaseCattleFeedForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.FertiliserApplicationForm(*args, **kwargs)
Bases:
cattle.forms.BaseCattleFertiliserApplicationForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.GrazingForm(*args, **kwargs)
Bases:
floppyforms.__future__.models.ModelForm
- property media
Return all media required to render the widgets on this form.
- save(commit=True, *args, **kwargs)
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 beef.forms.GrazingSectionForm(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)
Bases:
floppyforms.__future__.models.ModelForm
- has_changed()
Ensure that forms with un-changed initial data are still saved
- property media
Return all media required to render the widgets on this form.
- class beef.forms.HerdForm(*args, **kwargs)
Bases:
floppyforms.__future__.models.ModelForm
- property media
Return all media required to render the widgets on this form.
- save(commit=True, *args, **kwargs)
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 beef.forms.HerdSectionForm(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)
Bases:
floppyforms.__future__.models.ModelForm
- clean()
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__’.
- has_changed()
Return True if data differs from initial.
- property media
Return all media required to render the widgets on this form.
- class beef.forms.HerdSectionFormSet(data=None, files=None, instance=None, save_as_new=False, prefix=None, queryset=None, **kwargs)
Bases:
django.forms.formsets.HerdSectionFormFormSet
- full_clean()
Clean all of self.data and populate self._errors and self._non_form_errors.
- class beef.forms.ManureForm(*args, **kwargs)
Bases:
cattle.forms.BaseCattleManureForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.ManureManagementForm(*args, **kwargs)
Bases:
cattle.forms.BaseCattleManureManagementForm
- property media
Return all media required to render the widgets on this form.
- class beef.forms.ProductionForm(*args, **kwargs)
Bases:
coolfarmtool.forms.ConditionalModelForm
- clean()
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__’.
- property media
Return all media required to render the widgets on this form.
- save(commit=True, *args, **kwargs)
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 beef.forms.TransportForm(*args, **kwargs)
Bases:
floppyforms.__future__.models.ModelForm
- property media
Return all media required to render the widgets on this form.
- save(commit=True, *args, **kwargs)
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.
beef.models module
- class beef.models.Bedding(id, type, amount_value, amount_unit, product)
Bases:
cattle.models.BaseCattleBedding
- exception DoesNotExist
- exception MultipleObjectsReturned
- class beef.models.BeefLifePhase(filter=(<object object>, ), item=<object object>, grouped=False)
Bases:
dj.choices.Choices
- class beef.models.BeefProduct(id, creation_date, last_updated, slug, farm, reporting_year, name, has_co_products, has_waste_water, oxygen_demand_type, water_treatment_type, comments, cost_data, result_output, is_closed, verification_status, product_dry_value, product_dry_unit, waste_water_production_value, waste_water_production_unit, oxygen_demand_value, oxygen_demand_unit, product_ptr, livestock_type, variety, livestock_progress, evaluation_method, livestockproduct_ptr, feed_approach, grazing_area_value, grazing_area_unit, date_start_time, date_start_month, date_end_time, date_end_month, date_end_year, progress, production_system, is_organic, age_first_calving, calving_interval, calving_rate, replacement_rate, time_to_slaughter)
Bases:
cattle.models.CattleProduct
- exception DoesNotExist
- exception MultipleObjectsReturned
- class ProductionSystem(filter=(<object object>, ), item=<object object>, grouped=False)
Bases:
dj.choices.Choices
- reference_period_days
- class beef.models.FarmLivestockProperties(id, farm, livestock_property, weight_gain_value, weight_gain_unit)
Bases:
django.db.models.base.Model
- exception DoesNotExist
- exception MultipleObjectsReturned
- weight_gain = <quantity.models.QuantityField: weight_gain>
weight gain, kg / animal / day
- class beef.models.FeedAdditiveDose(id, days, herd_section_percentage, ndf, crude_fat, dose_value, dose_unit, herd_section, feed_additive_type)
Bases:
cattle.models.BaseCattleFeedAdditiveDose
- exception DoesNotExist
- exception MultipleObjectsReturned
- class beef.models.FeedComponent(id, percentage, certified, calculated, item_customised, dry_matter_value, dry_matter_unit, custom_dry_matter_content_value, custom_dry_matter_content_unit, custom_de_cattle_value, custom_de_cattle_unit, custom_protein_content_value, custom_protein_content_unit, product, section, item, crop_product, region, days)
Bases:
cattle.models.BaseCattleFeedComponent
- exception DoesNotExist
- exception MultipleObjectsReturned
- feed_digestibility
Digestible energy for feed Component, %
- methane_conversion_factor
Methane convertion factor (Ym)
- class beef.models.FertiliserApplication(id, date, rate_measure, custom_ingredients, inhibition, rate_value, rate_unit, production, product, type)
Bases:
cattle.models.BaseCattleFertiliserApplication
- exception DoesNotExist
- exception MultipleObjectsReturned
- class beef.models.Grazing(id, days, hours, category, quality, section)
Bases:
cattle.models.BaseCattleGrazing
- exception DoesNotExist
- exception MultipleObjectsReturned
- class beef.models.HerdSection(id, animals, sold_animals, purchased_animals, live_weight_value, live_weight_unit, sold_weight_value, sold_weight_unit, purchased_weight_value, purchased_weight_unit, product, phase)
Bases:
cattle.models.BaseCattleHerdSection
- exception DoesNotExist
- exception MultipleObjectsReturned
- _e_enteric()
Enteric fermentation GHG emissions for the herd section, kg CO2e / year
- property _emissions_manure_ch4
CH4 emissions kg CH4 / head / day
- _energy_growth
MJ / head / day
- daily_weight_gain
kg / animal / day
- feed_digestibility
Average digestible energy for feed, %
- feed_dmi_total
Total dry matter intake, kg
- feed_protein
Average protein percentage of feed, kg
- gross_energy
Gross energy intake / requirement, MJ / head / day
- n_retention
kg N2O-N / head / day
- class beef.models.LivestockProperties(id, phase, c_f, c, c_pregnancy, weight_gain)
Bases:
django.db.models.base.Model
- exception DoesNotExist
- exception MultipleObjectsReturned
- weight_gain
weight gain, kg / animal / day
beef.views module
- class beef.views.BeefCloseView(**kwargs)
Bases:
farm.views.ProductCloseViewMixin
,beef.views.BeefMixin
,django.views.generic.detail.SingleObjectMixin
,django.views.generic.base.View
- get_success_url()
Return the URL to redirect to after closing the product.
- class beef.views.BeefDebugView(**kwargs)
Bases:
beef.views.BeefMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,farm.views.CSVResponseMixin
,django.views.generic.detail.DetailView
- class beef.views.BeefEnergyView(**kwargs)
Bases:
beef.views.CloseDairyMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.edit.UpdateView
- form_class
alias of
beef.forms.EnergyForm
- form_valid(form)
If the form is valid, save the associated model.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form(form_class=<class 'beef.forms.EnergyForm'>)
Return an instance of the form to be used in this view.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- class beef.views.BeefExportView(**kwargs)
- class beef.views.BeefFeedView(**kwargs)
Bases:
beef.views.CloseDairyMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.edit.UpdateView
- dispatch(request, *args, **kwargs)
Make request.is_ajax return True if “ajax” is given in GET
- form_class
alias of
beef.forms.FeedForm
- form_valid(form)
If the form is valid, save the associated model.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form(form_class=<class 'beef.forms.FeedForm'>)
Return an instance of the form to be used in this view.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- class beef.views.BeefGeneralView(**kwargs)
Bases:
beef.views.CloseDairyMixin
,django.views.generic.edit.FormMixin
,django.views.generic.detail.DetailView
- form_class
alias of
beef.forms.BeefGeneralForm
- get_object(queryset=None)
Return the object the view is displaying.
Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.
- class beef.views.BeefGrazingView(**kwargs)
Bases:
beef.views.CloseDairyMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.edit.UpdateView
- dispatch(request, *args, **kwargs)
Make request.is_ajax return True if “ajax” is given in GET
- form_class
alias of
beef.forms.GrazingForm
- form_valid(form)
If the form is valid, save the associated model.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form(form_class=<class 'beef.forms.GrazingForm'>)
Return an instance of the form to be used in this view.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- class beef.views.BeefHerdView(**kwargs)
Bases:
beef.views.CloseDairyMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.edit.UpdateView
- form_class
alias of
beef.forms.HerdForm
- form_valid(form)
If the form is valid, save the associated model.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form(form_class=<class 'beef.forms.HerdForm'>)
Return an instance of the form to be used in this view.
- get_object(queryset=None)
Return the object the view is displaying.
Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- class beef.views.BeefJsonExportView(**kwargs)
Bases:
beef.views.BeefMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.detail.DetailView
- model
alias of
beef.models.BeefProduct
- class beef.views.BeefLivestockPropertiesDetailsView(**kwargs)
Bases:
farm.views.FarmMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.detail.DetailView
- model
alias of
beef.models.LivestockProperties
- setup(request, *args, **kwargs)
Initialize attributes shared by all view methods.
- class beef.views.BeefManureView(**kwargs)
Bases:
beef.views.CloseDairyMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.edit.UpdateView
- form_class
alias of
beef.forms.ManureForm
- form_valid(form)
If the form is valid, save the associated model.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form(form_class=<class 'beef.forms.ManureForm'>)
Return an instance of the form to be used in this view.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- class beef.views.BeefMixin
Bases:
farm.views.FarmMixin
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- model
alias of
beef.models.BeefProduct
- class beef.views.BeefPartialResultsView(**kwargs)
Bases:
beef.views.BeefMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.detail.DetailView
- class beef.views.BeefProductResultsJsonExportView(**kwargs)
Bases:
beef.views.BeefMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.detail.DetailView
- model
alias of
beef.models.BeefProduct
- class beef.views.BeefProductionView(**kwargs)
Bases:
farm.views.ProductCreationMixin
,beef.views.CloseDairyMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.edit.CreateView
,django.views.generic.edit.UpdateView
- form_class
alias of
beef.forms.ProductionForm
- form_valid(form)
If the form is valid, save the associated model.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form_kwargs()
Return the keyword arguments for instantiating the form.
- get_object(queryset=None)
Return the object the view is displaying.
Require self.queryset and a pk or slug argument in the URLconf. Subclasses can override this to return any object.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- class beef.views.BeefSaveAsView(**kwargs)
Bases:
beef.views.BeefMixin
,farm.views.ProductSaveAsView
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- class beef.views.BeefSummaryCompare(**kwargs)
Bases:
beef.views.BeefSummaryMixin
,farm.views.SummaryCompareMixin
,django.views.generic.detail.DetailView
- class beef.views.BeefSummaryCosts(**kwargs)
Bases:
beef.views.BeefSummaryMixin
,farm.views.SummaryCostsMixin
,django.views.generic.detail.DetailView
- get_items_expenditure()
Return a list of (section_key, name, [items]). See “get_product_income”, above, for return full definition.
- class beef.views.BeefSummaryData(**kwargs)
Bases:
beef.views.BeefSummaryMixin
,django.views.generic.detail.DetailView
- class beef.views.BeefSummaryGHGs(**kwargs)
Bases:
beef.views.BeefSummaryMixin
,django.views.generic.detail.DetailView
- form_class
alias of
crop.forms.DatasetForm
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- class beef.views.BeefSummaryMixin
Bases:
beef.views.BeefMixin
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- class beef.views.BeefSummaryMore(**kwargs)
Bases:
beef.views.BeefSummaryMixin
,django.views.generic.detail.DetailView
- class beef.views.BeefSummaryPerformance(**kwargs)
Bases:
beef.views.BeefSummaryMixin
,django.views.generic.detail.DetailView
Bases:
beef.views.BeefSummaryMixin
,farm.views.SummaryShareMixin
,django.views.generic.detail.DetailView
- class beef.views.BeefTransportView(**kwargs)
Bases:
beef.views.CloseDairyMixin
,farm.views.AjaxResponseMixin
,braces.views._ajax.JSONResponseMixin
,django.views.generic.edit.UpdateView
- form_class
alias of
beef.forms.TransportForm
- form_valid(form)
If the form is valid, save the associated model.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form(form_class=<class 'beef.forms.TransportForm'>)
Return an instance of the form to be used in this view.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- class beef.views.CloseDairyMixin
Bases:
beef.views.BeefMixin
- class beef.views.FarmLivestockPropertiesView(**kwargs)
Bases:
farm.views.FarmMixin
,django.views.generic.edit.FormView
- form_valid(form)
If the form is valid, redirect to the supplied URL.
- get_context_data(**kwargs)
overidden get_context_data to inject a custom form onto certain page contexts in order to allow dynamic fields when using the save as feature e.g. dairy product and crop product would have different forms but this saves us having to create two forms just for the sake of one field
we only use this form on GET because the POST is managed by the ProductSaveAsView
- Returns
dictionary of keyword arguements
- get_form(form_class=None)
Return an instance of the form to be used in this view.
- get_success_url()
Return the URL to redirect to after processing a valid form.
- setup(request, *args, **kwargs)
Initialize attributes shared by all view methods.