Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
fix: Fix passing enums into the class file
Browse files Browse the repository at this point in the history
  • Loading branch information
rsavoye committed Feb 23, 2024
1 parent 43c7b59 commit 89543bb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tm_admin/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ def __init__(self,
log.warning(f"GEOMETRY: {datatype}")
elif k1[:7] == 'public.':
# FIXME: It's in the SQL types
# log.warning(f"SQL ENUM {k1}!")
datatype = f"tm_admin.types_tm.{k1[7:].capitalize()}"
# log.warning(f"SQL ENUM {k1}! {datatype}")
elif k1 in self.yaml2py:
datatype = self.yaml2py[k1]
else:
Expand All @@ -261,9 +261,10 @@ def __init__(self,
elif k1 == 'timestamp':
out += f"{k}: datetime = '{datetime.now()}', "
elif k1[:7] == 'public.':
# defined = f"tm_admin.types_tm.{k1[7:].capitalize()}()"
# out += f"{k}: {defined} = 1, "
out += f"{k}: int = 1, "
defined = f"tm_admin.types_tm.{k1[7:].capitalize()}"
# log.warning(f"SQL ENUM {k1}!")
out += f"{k}: {defined} = 1, "
# out += f"{k}: int = 1, "
else:
out += f"{k}: {datatype} = None, "
# print(k)
Expand Down

0 comments on commit 89543bb

Please sign in to comment.