Skip to content

Instantly share code, notes, and snippets.

View gordol's full-sized avatar

Gordo Lowrey gordol

View GitHub Profile
@gordol
gordol / CaseClass.py
Created March 22, 2021 21:54 — forked from breeko/CaseClass.py
Scala's case class built out for Python
def CaseClass(case_class_name, **kwargs):
types = {}
for k, v in kwargs.items():
if type(v) is not type:
raise ValueError("{} is not a type".format(v))
types[k] = v
class CaseClassImpl():
initialized = False
ModelView
---------
# field1 (->Model1), field2 (->Model2) filtered by field1 values
column_filter_by = ('field2')
form_widget_args = {
'field2': {
'data-filter-by': 'field1',
}
}