Skip to content

Commit bb74b2d

Browse files
committed
Get forms working by fixing duplicate fields - prep for next DB
migration
1 parent e55447b commit bb74b2d

File tree

2 files changed

+7
-15
lines changed

2 files changed

+7
-15
lines changed

usaon_benefit_tool/forms.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
Link,
2020
Node,
2121
NodeSubtypeOther,
22-
# NodeSubtypeSocietalBenefitArea,
22+
NodeSubtypeSocietalBenefitArea,
2323
User,
2424
)
2525

@@ -113,10 +113,10 @@ def get_node_label(node: Node) -> str:
113113
NodeSubtypeOther,
114114
exclude=node_exclude,
115115
),
116-
# NodeSubtypeSocietalBenefitArea: model_form(
117-
# NodeSubtypeSocietalBenefitArea,
118-
# # exclude=node_exclude,
119-
# ),
116+
NodeSubtypeSocietalBenefitArea: model_form(
117+
NodeSubtypeSocietalBenefitArea,
118+
exclude=node_exclude,
119+
),
120120
User: model_form(
121121
User,
122122
only=['orcid', 'biography', 'affiliation', 'role'],

usaon_benefit_tool/models/tables.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class NodeSubtypeSocietalBenefitArea(Node):
245245
"""Fields that are specific to societal benefit area type nodes."""
246246

247247
__tablename__ = "node_subtype_societal_benefit_area"
248-
__table_args__ = (UniqueConstraint('societal_benefit_area_id'),)
248+
# __table_args__ = (UniqueConstraint('societal_benefit_area_id'),)
249249
__mapper_args__: ClassVar = {
250250
'polymorphic_identity': NodeTypeDiscriminator.SOCIETAL_BENEFIT_AREA.value,
251251
}
@@ -257,20 +257,12 @@ class NodeSubtypeSocietalBenefitArea(Node):
257257
nullable=False,
258258
)
259259

260-
societal_benefit_area_id = Column(
261-
String,
262-
ForeignKey('societal_benefit_area.id'),
263-
nullable=False,
264-
)
265-
name = Column(String(512), nullable=True)
266-
short_name = Column(String(256), nullable=True)
267-
description = Column(String, nullable=True)
268260
framework_name = Column(String(256), nullable=True)
269261
framework_url = Column(String(512), nullable=True)
270262

271263
# TODO: Relationship to societal benefit area table? How would we make a similar
272264
# relationship for the other node types?
273-
societal_benefit_area = relationship("SocietalBenefitArea")
265+
# societal_benefit_area = relationship("SocietalBenefitArea")
274266

275267

276268
class AssessmentNode(BaseModel):

0 commit comments

Comments
 (0)