{{response.title=base_title + ' Management: ' + T('Set prices')}} {{response.files.append(URL('static', 'OZSite/SET_PRICES.css'))}} {{extend 'layout.html'}} {{from OZfunc import fmt_pounds}}

Set the prices from the pre-calculated popularities

{{=form.custom.begin}} {{if pop_min is not None and pop_max is not None:}} Popularity ranges from {{=int(round(pop_min,0))}} to {{=int(round(pop_max,0))}}. As a guide, here are the popularities of a few species: {{pass}}

previous pricing structure was:

{{for r in previous_prices:}} {{pass}} {{for r in previous_prices:}} {{pass}} {{for r in previous_prices:}} {{pass}}
{{=fmt_pounds(pence=r.price)}} cutoff
upper popularity quantile cutoff{{=r.quantile}}
number of species{{=("{:,}" if r.n_leaves else "{}").format(r.n_leaves)}}

set cutoffs:

{{for i, field in enumerate(other_fields):}} {{pass}} {{for b, price in bands.items():}} {{ if b == max_band:}} {{elif price is None:}} {{ else:}} {{ pass}} {{ for i, field in enumerate(other_fields):}} {{ pass}} {{pass}}
BandSet upper
popularity
quantile (%)
{{=field.name}}
{{=b}} (currently {{=fmt_pounds(pence=price)}})remainder{{=b}} (currently {{=fmt_pounds(pence=price)}}){{=price}}{{=b}} (currently {{=fmt_pounds(pence=price)}}){{=form.custom.widget['_'.join(['quantile', b])]}}{{=form.custom.widget["_".join([field.name, b])]}}
Click here to set all the prices in the database (may take some time): {{=form.custom.submit}} {{=form.custom.end}}
{{if request.vars:}}
Click to see submitted variables {{=BEAUTIFY(request.vars)}} {{pass}}