# All data is presented to the db as a string, which could result
# in problems with type coercion.
-import attr
+import attrs
import logging
import markupsafe
import psycopg.errors
log = logging.getLogger(__name__)
-@attr.s
+@attrs.define
class UploadCoreInitialPost(UploadNullFileInitialPost):
'''Get values from settings for when there's not user-supplied
values in POST
'''
- component = attr.ib(default='pgwui_upload')
+ component = attrs.field(default='pgwui_upload')
def set_component(self, component):
self.component = component
self.param_execute(self.insert_stmt, udl)
-@attr.s
+@attrs.define
class BaseTableUploadHandler(TabularFileUploadHandler):
'''
Attributes:
ue Not available until self.factory(ue) is called
cur Not available until self.factory(ue) is called
'''
- ue = attr.ib(default=None)
- cur = attr.ib(default=None)
+ ue = attrs.field(default=None)
+ cur = attrs.field(default=None)
def get_data(self):
'''