Remove several references to "buefy" name
class methods, template filenames, etc. also made various edits per newer conventions
This commit is contained in:
parent
96ba039299
commit
c036932ce4
50 changed files with 373 additions and 361 deletions
|
@ -33,10 +33,9 @@ from collections import OrderedDict
|
|||
import sqlalchemy as sa
|
||||
from sqlalchemy import orm
|
||||
from sqlalchemy.ext.associationproxy import AssociationProxy, ASSOCIATION_PROXY
|
||||
from wuttjamaican.util import UNSPECIFIED
|
||||
|
||||
from rattail.time import localtime
|
||||
from rattail.util import prettify, pretty_boolean, pretty_quantity
|
||||
from rattail.core import UNSPECIFIED
|
||||
from rattail.util import prettify, pretty_boolean
|
||||
from rattail.db.util import get_fieldnames
|
||||
|
||||
import colander
|
||||
|
@ -50,10 +49,10 @@ from webhelpers2.html import tags, HTML
|
|||
|
||||
from tailbone.db import Session
|
||||
from tailbone.util import raw_datetime, get_form_data, render_markdown
|
||||
from . import types
|
||||
from .widgets import (ReadonlyWidget, PlainDateWidget,
|
||||
JQueryDateWidget, JQueryTimeWidget,
|
||||
MultiFileUploadWidget)
|
||||
from tailbone.forms import types
|
||||
from tailbone.forms.widgets import (ReadonlyWidget, PlainDateWidget,
|
||||
JQueryDateWidget, JQueryTimeWidget,
|
||||
MultiFileUploadWidget)
|
||||
from tailbone.exceptions import TailboneJSONFieldError
|
||||
|
||||
|
||||
|
@ -225,7 +224,7 @@ class CustomSchemaNode(SQLAlchemySchemaNode):
|
|||
if excludes:
|
||||
overrides['excludes'] = excludes
|
||||
|
||||
return super(CustomSchemaNode, self).get_schema_from_relationship(prop, overrides)
|
||||
return super().get_schema_from_relationship(prop, overrides)
|
||||
|
||||
def dictify(self, obj):
|
||||
""" Return a dictified version of `obj` using schema information.
|
||||
|
@ -234,7 +233,7 @@ class CustomSchemaNode(SQLAlchemySchemaNode):
|
|||
This method was copied from upstream and modified to add automatic
|
||||
handling of "association proxy" fields.
|
||||
"""
|
||||
dict_ = super(CustomSchemaNode, self).dictify(obj)
|
||||
dict_ = super().dictify(obj)
|
||||
for node in self:
|
||||
|
||||
name = node.name
|
||||
|
@ -967,7 +966,7 @@ class Form(object):
|
|||
kwargs.setdefault(':configure-fields-help', 'configureFieldsHelp')
|
||||
return HTML.tag(self.component, **kwargs)
|
||||
|
||||
def render_buefy_field(self, fieldname, bfield_attrs={}):
|
||||
def render_field_complete(self, fieldname, bfield_attrs={}):
|
||||
"""
|
||||
Render the given field in a Buefy-compatible way. Note that
|
||||
this is meant to render *editable* fields, i.e. showing a
|
||||
|
@ -1131,7 +1130,8 @@ class Form(object):
|
|||
value = self.obtain_value(record, field_name)
|
||||
if value is None:
|
||||
return ""
|
||||
value = localtime(self.request.rattail_config, value)
|
||||
app = self.get_rattail_app()
|
||||
value = app.localtime(value)
|
||||
return raw_datetime(self.request.rattail_config, value)
|
||||
|
||||
def render_duration(self, record, field_name):
|
||||
|
@ -1160,7 +1160,8 @@ class Form(object):
|
|||
value = self.obtain_value(obj, field)
|
||||
if value is None:
|
||||
return ""
|
||||
return pretty_quantity(value)
|
||||
app = self.get_rattail_app()
|
||||
return app.render_quantity(value)
|
||||
|
||||
def render_percent(self, obj, field):
|
||||
app = self.request.rattail_config.get_app()
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
################################################################################
|
||||
#
|
||||
# Rattail -- Retail Software Framework
|
||||
# Copyright © 2010-2023 Lance Edgar
|
||||
# Copyright © 2010-2024 Lance Edgar
|
||||
#
|
||||
# This file is part of Rattail.
|
||||
#
|
||||
|
@ -153,6 +153,7 @@ class DynamicCheckboxWidget(dfwidget.CheckboxWidget):
|
|||
template = 'checkbox_dynamic'
|
||||
|
||||
|
||||
# TODO: deprecate / remove this
|
||||
class PlainSelectWidget(dfwidget.SelectWidget):
|
||||
template = 'select_plain'
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue