Refactor all remaining usage of webhelpers; use webhelpers2 etc. instead
This commit is contained in:
parent
018702159d
commit
631665e208
5 changed files with 22 additions and 23 deletions
|
@ -38,7 +38,7 @@ from rattail.util import pretty_hours, hours_as_decimal
|
|||
|
||||
import formencode as fe
|
||||
from pyramid_simpleform import Form
|
||||
from webhelpers2.html import HTML
|
||||
from webhelpers2.html import tags, HTML
|
||||
|
||||
from tailbone import forms
|
||||
from tailbone.db import Session
|
||||
|
@ -244,17 +244,15 @@ class TimeSheetView(View):
|
|||
return Session.query(model.Store).order_by(model.Store.id).all()
|
||||
|
||||
def get_store_options(self, stores):
|
||||
options = [(s.uuid, "{} - {}".format(s.id, s.name)) for s in stores]
|
||||
options.insert(0, ('', "(all)"))
|
||||
return options
|
||||
options = [tags.Option("{} - {}".format(s.id, s.name), s.uuid) for s in stores]
|
||||
return tags.Options(options, prompt="(all)")
|
||||
|
||||
def get_departments(self):
|
||||
return Session.query(model.Department).order_by(model.Department.name).all()
|
||||
|
||||
def get_department_options(self, departments):
|
||||
options = [(d.uuid, d.name) for d in departments]
|
||||
options.insert(0, ('', "(all)"))
|
||||
return options
|
||||
options = [tags.Option(d.name, d.uuid) for d in departments]
|
||||
return tags.Options(options, prompt="(all)")
|
||||
|
||||
def render_full(self, date=None, employees=None, store=None, department=None, form=None, **kwargs):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue