def validate(self, form):

        T = current.T

        formvars = form.vars
        errors = form.errors

        # Must not update from status "paid"
        if str(formvars.current_status) == "2":
            errors.current_status = T("Bulk update from this status not allowed")

        # Must not update to status "paid"
        if str(formvars.new_status) == "2":
            errors.new_status = T("Bulk update to this status not allowed")

        # To-date must be after from-date
        from_date = formvars.from_date
        to_date = formvars.to_date
        if from_date and to_date and from_date > to_date:
            errors.to_date = T("Date until must be after date from")

# =============================================================================
Returns a new HostsContainer instance, containing only the hosts
dataset/ETHPy150Open sahana/eden/modules/s3db/dvr.py/DVRManageAllowance.validate--crossover with--dataset/ETHPy150Open jonathanslenders/python-deployer/deployer/host_container.py/HostsContainer.filter