Konova Codelist enhancements
* adds proper boolean mapping to update_codelist * differs between id and atom_id for KonovaCode since atomIds are not unique (could change in the future) * adds is_selectable and is_archived to KonovaCode * scales width of DAL form fields to 100% width * adds table-responsive wrapping container for table forms to prevent unwanted rendering artifacts in case of table resizing due to long content * adds autocomplete routes for law, registration offices and conservation offices
This commit is contained in:
@@ -10,7 +10,12 @@ class KonovaCode(models.Model):
|
||||
"""
|
||||
id = models.IntegerField(
|
||||
primary_key=True,
|
||||
help_text="AtomId; Identifies this code uniquely over all NatIT projects"
|
||||
help_text="Regular Id"
|
||||
)
|
||||
atom_id = models.IntegerField(
|
||||
help_text="AtomId; Identifies this code uniquely over all NatIT projects; Duplicates possible",
|
||||
null=True,
|
||||
blank=True,
|
||||
)
|
||||
parent = models.ForeignKey(
|
||||
"KonovaCode",
|
||||
@@ -30,20 +35,27 @@ class KonovaCode(models.Model):
|
||||
blank=True,
|
||||
help_text="",
|
||||
)
|
||||
is_selectable = models.BooleanField(
|
||||
default=False,
|
||||
help_text="Whether this code shall be used for any select actions or not"
|
||||
)
|
||||
is_leaf = models.BooleanField(
|
||||
default=False,
|
||||
help_text="Whether this code has children or not"
|
||||
)
|
||||
is_active = models.BooleanField(
|
||||
is_archived = models.BooleanField(
|
||||
default=False,
|
||||
help_text="Whether this code is archived or not"
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
ret_val = ""
|
||||
if self.parent:
|
||||
ret_val += self.parent.long_name + " > "
|
||||
ret_val += self.long_name
|
||||
if self.short_name:
|
||||
return "{} ({})".format(self.long_name, self.short_name)
|
||||
else:
|
||||
return self.long_name
|
||||
ret_val += " ({})".format(self.short_name)
|
||||
return ret_val
|
||||
|
||||
|
||||
class KonovaCodeList(models.Model):
|
||||
|
||||
Reference in New Issue
Block a user