wuttafarm.web.views.farmos.animal_types

View for farmOS animal types

class wuttafarm.web.views.farmos.animal_types.AnimalTypeView(request, context=None)[source]

Master view for Animal Types in farmOS.

get_xref_buttons(animal_type)[source]

Should return a list of “cross-reference” buttons to be shown when viewing the given object.

Default logic always returns empty list; subclass can override as needed.

If applicable, this method should do its own permission checks and only include the buttons current user should be allowed to see/use.

See also make_button() - example:

def get_xref_buttons(self, product):
    buttons = []
    if self.request.has_perm('external_products.view'):
        url = self.request.route_url('external_products.view',
                                     id=product.external_id)
        buttons.append(self.make_button("View External", url=url))
    return buttons