exdrf-dev 0.1.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) hide show
  1. exdrf_dev/__init__.py +0 -0
  2. exdrf_dev/__version__.py +24 -0
  3. exdrf_dev/app/__init__.py +0 -0
  4. exdrf_dev/app/__main__.py +109 -0
  5. exdrf_dev/app/main_window.py +50 -0
  6. exdrf_dev/app/main_window.ui +49 -0
  7. exdrf_dev/app/main_window_ui.py +69 -0
  8. exdrf_dev/attr_gen/db/__init__.py +7 -0
  9. exdrf_dev/attr_gen/db/api.py +7 -0
  10. exdrf_dev/attr_gen/db/children/__init__.py +7 -0
  11. exdrf_dev/attr_gen/db/children/api.py +7 -0
  12. exdrf_dev/attr_gen/db/children/child.py +31 -0
  13. exdrf_dev/attr_gen/db/children/child_ful.py +0 -0
  14. exdrf_dev/attr_gen/db/composite_key_models/__init__.py +7 -0
  15. exdrf_dev/attr_gen/db/composite_key_models/api.py +7 -0
  16. exdrf_dev/attr_gen/db/composite_key_models/composite_key_model.py +46 -0
  17. exdrf_dev/attr_gen/db/composite_key_models/composite_key_model_ful.py +0 -0
  18. exdrf_dev/attr_gen/db/parent_tag_associations/__init__.py +7 -0
  19. exdrf_dev/attr_gen/db/parent_tag_associations/api.py +7 -0
  20. exdrf_dev/attr_gen/db/parent_tag_associations/parent_tag_association.py +29 -0
  21. exdrf_dev/attr_gen/db/parent_tag_associations/parent_tag_association_ful.py +0 -0
  22. exdrf_dev/attr_gen/db/parents/__init__.py +7 -0
  23. exdrf_dev/attr_gen/db/parents/api.py +7 -0
  24. exdrf_dev/attr_gen/db/parents/parent.py +35 -0
  25. exdrf_dev/attr_gen/db/parents/parent_ful.py +0 -0
  26. exdrf_dev/attr_gen/db/profiles/__init__.py +7 -0
  27. exdrf_dev/attr_gen/db/profiles/api.py +7 -0
  28. exdrf_dev/attr_gen/db/profiles/profile.py +31 -0
  29. exdrf_dev/attr_gen/db/profiles/profile_ful.py +0 -0
  30. exdrf_dev/attr_gen/db/related_items/__init__.py +7 -0
  31. exdrf_dev/attr_gen/db/related_items/api.py +7 -0
  32. exdrf_dev/attr_gen/db/related_items/related_item.py +33 -0
  33. exdrf_dev/attr_gen/db/related_items/related_item_ful.py +0 -0
  34. exdrf_dev/attr_gen/db/tags/__init__.py +7 -0
  35. exdrf_dev/attr_gen/db/tags/api.py +7 -0
  36. exdrf_dev/attr_gen/db/tags/tag.py +30 -0
  37. exdrf_dev/attr_gen/db/tags/tag_ful.py +0 -0
  38. exdrf_dev/cli.py +89 -0
  39. exdrf_dev/db/__init__.py +0 -0
  40. exdrf_dev/db/api.py +10 -0
  41. exdrf_dev/db/models.py +504 -0
  42. exdrf_dev/db/populate.py +355 -0
  43. exdrf_dev/field_ed_show/__init__.py +0 -0
  44. exdrf_dev/field_ed_show/__main__.py +37 -0
  45. exdrf_dev/field_ed_show/main_window.py +35 -0
  46. exdrf_dev/field_ed_show/main_window.ui +229 -0
  47. exdrf_dev/field_ed_show/main_window_ui.py +206 -0
  48. exdrf_dev/migrations/6870ef2417bc_.py +138 -0
  49. exdrf_dev/py.typed +0 -0
  50. exdrf_dev/pytest_dirs.py +186 -0
  51. exdrf_dev/qt/__init__.py +0 -0
  52. exdrf_dev/qt/children/__init__.py +3 -0
  53. exdrf_dev/qt/children/api.py +8 -0
  54. exdrf_dev/qt/children/fields/__init__.py +3 -0
  55. exdrf_dev/qt/children/fields/data_field.py +32 -0
  56. exdrf_dev/qt/children/fields/id_field.py +29 -0
  57. exdrf_dev/qt/children/fields/parent_field.py +29 -0
  58. exdrf_dev/qt/children/fields/parent_id_field.py +28 -0
  59. exdrf_dev/qt/children/models/__init__.py +3 -0
  60. exdrf_dev/qt/children/models/children_full_model.py +48 -0
  61. exdrf_dev/qt/children/models/children_one_col_model.py +39 -0
  62. exdrf_dev/qt/children/widgets/__init__.py +3 -0
  63. exdrf_dev/qt/children/widgets/children_editor.py +40 -0
  64. exdrf_dev/qt/children/widgets/children_editor.ui +103 -0
  65. exdrf_dev/qt/children/widgets/children_editor_ui.py +124 -0
  66. exdrf_dev/qt/children/widgets/children_full_list.py +25 -0
  67. exdrf_dev/qt/children/widgets/children_name_list.py +3 -0
  68. exdrf_dev/qt/composite_key_models/__init__.py +3 -0
  69. exdrf_dev/qt/composite_key_models/api.py +16 -0
  70. exdrf_dev/qt/composite_key_models/fields/__init__.py +3 -0
  71. exdrf_dev/qt/composite_key_models/fields/description_field.py +30 -0
  72. exdrf_dev/qt/composite_key_models/fields/key_part1_field.py +34 -0
  73. exdrf_dev/qt/composite_key_models/fields/key_part2_field.py +31 -0
  74. exdrf_dev/qt/composite_key_models/fields/related_items_field.py +37 -0
  75. exdrf_dev/qt/composite_key_models/fields/some_binary_field.py +28 -0
  76. exdrf_dev/qt/composite_key_models/fields/some_date_field.py +32 -0
  77. exdrf_dev/qt/composite_key_models/fields/some_enum_field.py +28 -0
  78. exdrf_dev/qt/composite_key_models/fields/some_float_field.py +35 -0
  79. exdrf_dev/qt/composite_key_models/fields/some_json_field.py +28 -0
  80. exdrf_dev/qt/composite_key_models/fields/some_time_field.py +28 -0
  81. exdrf_dev/qt/composite_key_models/models/__init__.py +3 -0
  82. exdrf_dev/qt/composite_key_models/models/composite_key_models_full_model.py +79 -0
  83. exdrf_dev/qt/composite_key_models/models/composite_key_models_one_col_model.py +24 -0
  84. exdrf_dev/qt/composite_key_models/widgets/__init__.py +3 -0
  85. exdrf_dev/qt/composite_key_models/widgets/composite_key_models_editor.py +85 -0
  86. exdrf_dev/qt/composite_key_models/widgets/composite_key_models_editor.ui +165 -0
  87. exdrf_dev/qt/composite_key_models/widgets/composite_key_models_editor_ui.py +231 -0
  88. exdrf_dev/qt/composite_key_models/widgets/composite_key_models_full_list.py +29 -0
  89. exdrf_dev/qt/composite_key_models/widgets/composite_key_models_name_list.py +3 -0
  90. exdrf_dev/qt/menus.py +120 -0
  91. exdrf_dev/qt/parent_tag_associations/__init__.py +3 -0
  92. exdrf_dev/qt/parent_tag_associations/api.py +16 -0
  93. exdrf_dev/qt/parent_tag_associations/fields/__init__.py +3 -0
  94. exdrf_dev/qt/parent_tag_associations/fields/parent_id_field.py +29 -0
  95. exdrf_dev/qt/parent_tag_associations/fields/tag_id_field.py +29 -0
  96. exdrf_dev/qt/parent_tag_associations/models/__init__.py +3 -0
  97. exdrf_dev/qt/parent_tag_associations/models/parent_tag_associations_full_model.py +39 -0
  98. exdrf_dev/qt/parent_tag_associations/models/parent_tag_associations_one_col_model.py +26 -0
  99. exdrf_dev/qt/parent_tag_associations/widgets/__init__.py +3 -0
  100. exdrf_dev/qt/parent_tag_associations/widgets/parent_tag_associations_editor.py +73 -0
  101. exdrf_dev/qt/parent_tag_associations/widgets/parent_tag_associations_editor.ui +62 -0
  102. exdrf_dev/qt/parent_tag_associations/widgets/parent_tag_associations_editor_ui.py +79 -0
  103. exdrf_dev/qt/parent_tag_associations/widgets/parent_tag_associations_full_list.py +29 -0
  104. exdrf_dev/qt/parent_tag_associations/widgets/parent_tag_associations_name_list.py +3 -0
  105. exdrf_dev/qt/parents/__init__.py +3 -0
  106. exdrf_dev/qt/parents/api.py +8 -0
  107. exdrf_dev/qt/parents/fields/__init__.py +3 -0
  108. exdrf_dev/qt/parents/fields/children_field.py +38 -0
  109. exdrf_dev/qt/parents/fields/created_at_field.py +32 -0
  110. exdrf_dev/qt/parents/fields/id_field.py +29 -0
  111. exdrf_dev/qt/parents/fields/is_active_field.py +28 -0
  112. exdrf_dev/qt/parents/fields/name_field.py +32 -0
  113. exdrf_dev/qt/parents/fields/profile_field.py +29 -0
  114. exdrf_dev/qt/parents/fields/tags_field.py +29 -0
  115. exdrf_dev/qt/parents/models/__init__.py +3 -0
  116. exdrf_dev/qt/parents/models/parents_full_model.py +73 -0
  117. exdrf_dev/qt/parents/models/parents_ocm.py +53 -0
  118. exdrf_dev/qt/parents/widgets/__init__.py +3 -0
  119. exdrf_dev/qt/parents/widgets/parents_editor.py +47 -0
  120. exdrf_dev/qt/parents/widgets/parents_editor.ui +135 -0
  121. exdrf_dev/qt/parents/widgets/parents_editor_ui.py +162 -0
  122. exdrf_dev/qt/parents/widgets/parents_full_list.py +25 -0
  123. exdrf_dev/qt/parents/widgets/parents_name_list.py +3 -0
  124. exdrf_dev/qt/profiles/__init__.py +3 -0
  125. exdrf_dev/qt/profiles/api.py +8 -0
  126. exdrf_dev/qt/profiles/fields/__init__.py +3 -0
  127. exdrf_dev/qt/profiles/fields/bio_field.py +30 -0
  128. exdrf_dev/qt/profiles/fields/id_field.py +29 -0
  129. exdrf_dev/qt/profiles/fields/parent_field.py +29 -0
  130. exdrf_dev/qt/profiles/fields/parent_id_field.py +30 -0
  131. exdrf_dev/qt/profiles/models/__init__.py +3 -0
  132. exdrf_dev/qt/profiles/models/profiles_full_model.py +48 -0
  133. exdrf_dev/qt/profiles/models/profiles_one_col_model.py +24 -0
  134. exdrf_dev/qt/profiles/widgets/__init__.py +3 -0
  135. exdrf_dev/qt/profiles/widgets/profiles_editor.py +47 -0
  136. exdrf_dev/qt/profiles/widgets/profiles_editor.ui +102 -0
  137. exdrf_dev/qt/profiles/widgets/profiles_editor_ui.py +125 -0
  138. exdrf_dev/qt/profiles/widgets/profiles_full_list.py +29 -0
  139. exdrf_dev/qt/profiles/widgets/profiles_name_list.py +3 -0
  140. exdrf_dev/qt/related_items/__init__.py +3 -0
  141. exdrf_dev/qt/related_items/api.py +8 -0
  142. exdrf_dev/qt/related_items/fields/__init__.py +3 -0
  143. exdrf_dev/qt/related_items/fields/comp_key_owner_field.py +29 -0
  144. exdrf_dev/qt/related_items/fields/comp_key_part1_field.py +33 -0
  145. exdrf_dev/qt/related_items/fields/comp_key_part2_field.py +30 -0
  146. exdrf_dev/qt/related_items/fields/id_field.py +29 -0
  147. exdrf_dev/qt/related_items/fields/item_data_field.py +31 -0
  148. exdrf_dev/qt/related_items/fields/some_int_field.py +33 -0
  149. exdrf_dev/qt/related_items/models/__init__.py +3 -0
  150. exdrf_dev/qt/related_items/models/related_items_full_model.py +59 -0
  151. exdrf_dev/qt/related_items/models/related_items_one_col_model.py +24 -0
  152. exdrf_dev/qt/related_items/widgets/__init__.py +3 -0
  153. exdrf_dev/qt/related_items/widgets/related_items_editor.py +49 -0
  154. exdrf_dev/qt/related_items/widgets/related_items_editor.ui +124 -0
  155. exdrf_dev/qt/related_items/widgets/related_items_editor_ui.py +167 -0
  156. exdrf_dev/qt/related_items/widgets/related_items_full_list.py +29 -0
  157. exdrf_dev/qt/related_items/widgets/related_items_name_list.py +3 -0
  158. exdrf_dev/qt/tags/__init__.py +3 -0
  159. exdrf_dev/qt/tags/api.py +8 -0
  160. exdrf_dev/qt/tags/fields/__init__.py +3 -0
  161. exdrf_dev/qt/tags/fields/id_field.py +29 -0
  162. exdrf_dev/qt/tags/fields/name_field.py +31 -0
  163. exdrf_dev/qt/tags/fields/parents_field.py +29 -0
  164. exdrf_dev/qt/tags/models/__init__.py +3 -0
  165. exdrf_dev/qt/tags/models/tags_full_model.py +46 -0
  166. exdrf_dev/qt/tags/models/tags_one_col_model.py +24 -0
  167. exdrf_dev/qt/tags/widgets/__init__.py +3 -0
  168. exdrf_dev/qt/tags/widgets/tags_editor.py +47 -0
  169. exdrf_dev/qt/tags/widgets/tags_editor.ui +91 -0
  170. exdrf_dev/qt/tags/widgets/tags_editor_ui.py +112 -0
  171. exdrf_dev/qt/tags/widgets/tags_full_list.py +25 -0
  172. exdrf_dev/qt/tags/widgets/tags_name_list.py +3 -0
  173. exdrf_dev/qt_gen/db/__init__.py +7 -0
  174. exdrf_dev/qt_gen/db/api.py +16 -0
  175. exdrf_dev/qt_gen/db/children/__init__.py +7 -0
  176. exdrf_dev/qt_gen/db/children/api.py +29 -0
  177. exdrf_dev/qt_gen/db/children/fields/__init__.py +7 -0
  178. exdrf_dev/qt_gen/db/children/fields/fld_data.py +48 -0
  179. exdrf_dev/qt_gen/db/children/fields/fld_id.py +47 -0
  180. exdrf_dev/qt_gen/db/children/fields/fld_parent.py +95 -0
  181. exdrf_dev/qt_gen/db/children/fields/fld_parent_id.py +46 -0
  182. exdrf_dev/qt_gen/db/children/fields/single_f.py +67 -0
  183. exdrf_dev/qt_gen/db/children/models/__init__.py +7 -0
  184. exdrf_dev/qt_gen/db/children/models/child_ful.py +147 -0
  185. exdrf_dev/qt_gen/db/children/models/child_ocm.py +99 -0
  186. exdrf_dev/qt_gen/db/children/widgets/__init__.py +7 -0
  187. exdrf_dev/qt_gen/db/children/widgets/child_editor.py +90 -0
  188. exdrf_dev/qt_gen/db/children/widgets/child_editor.ui +139 -0
  189. exdrf_dev/qt_gen/db/children/widgets/child_editor_ui.py +115 -0
  190. exdrf_dev/qt_gen/db/children/widgets/child_list.py +83 -0
  191. exdrf_dev/qt_gen/db/children/widgets/child_selector.py +122 -0
  192. exdrf_dev/qt_gen/db/children/widgets/child_tv.html.j2 +19 -0
  193. exdrf_dev/qt_gen/db/children/widgets/child_tv.py +173 -0
  194. exdrf_dev/qt_gen/db/composite_key_models/__init__.py +7 -0
  195. exdrf_dev/qt_gen/db/composite_key_models/api.py +33 -0
  196. exdrf_dev/qt_gen/db/composite_key_models/fields/__init__.py +7 -0
  197. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_description.py +46 -0
  198. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_key_part1.py +50 -0
  199. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_key_part2.py +49 -0
  200. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_related_items.py +95 -0
  201. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_some_binary.py +45 -0
  202. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_some_date.py +47 -0
  203. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_some_enum.py +52 -0
  204. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_some_float.py +50 -0
  205. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_some_json.py +45 -0
  206. exdrf_dev/qt_gen/db/composite_key_models/fields/fld_some_time.py +44 -0
  207. exdrf_dev/qt_gen/db/composite_key_models/fields/single_f.py +63 -0
  208. exdrf_dev/qt_gen/db/composite_key_models/models/__init__.py +7 -0
  209. exdrf_dev/qt_gen/db/composite_key_models/models/composite_key_model_ful.py +188 -0
  210. exdrf_dev/qt_gen/db/composite_key_models/models/composite_key_model_ocm.py +126 -0
  211. exdrf_dev/qt_gen/db/composite_key_models/widgets/__init__.py +7 -0
  212. exdrf_dev/qt_gen/db/composite_key_models/widgets/composite_key_model_editor.py +99 -0
  213. exdrf_dev/qt_gen/db/composite_key_models/widgets/composite_key_model_editor.ui +349 -0
  214. exdrf_dev/qt_gen/db/composite_key_models/widgets/composite_key_model_editor_ui.py +282 -0
  215. exdrf_dev/qt_gen/db/composite_key_models/widgets/composite_key_model_list.py +85 -0
  216. exdrf_dev/qt_gen/db/composite_key_models/widgets/composite_key_model_selector.py +126 -0
  217. exdrf_dev/qt_gen/db/composite_key_models/widgets/composite_key_model_tv.html.j2 +35 -0
  218. exdrf_dev/qt_gen/db/composite_key_models/widgets/composite_key_model_tv.py +231 -0
  219. exdrf_dev/qt_gen/db/parent_tag_associations/__init__.py +7 -0
  220. exdrf_dev/qt_gen/db/parent_tag_associations/api.py +33 -0
  221. exdrf_dev/qt_gen/db/parent_tag_associations/fields/__init__.py +7 -0
  222. exdrf_dev/qt_gen/db/parent_tag_associations/fields/fld_parent_id.py +47 -0
  223. exdrf_dev/qt_gen/db/parent_tag_associations/fields/fld_tag_id.py +47 -0
  224. exdrf_dev/qt_gen/db/parent_tag_associations/fields/single_f.py +68 -0
  225. exdrf_dev/qt_gen/db/parent_tag_associations/models/__init__.py +7 -0
  226. exdrf_dev/qt_gen/db/parent_tag_associations/models/parent_tag_association_ful.py +147 -0
  227. exdrf_dev/qt_gen/db/parent_tag_associations/models/parent_tag_association_ocm.py +95 -0
  228. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/__init__.py +7 -0
  229. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/parent_tag_association_editor.py +106 -0
  230. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/parent_tag_association_editor.ui +90 -0
  231. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/parent_tag_association_editor_ui.py +90 -0
  232. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/parent_tag_association_list.py +91 -0
  233. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/parent_tag_association_selector.py +130 -0
  234. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/parent_tag_association_tv.html.j2 +11 -0
  235. exdrf_dev/qt_gen/db/parent_tag_associations/widgets/parent_tag_association_tv.py +177 -0
  236. exdrf_dev/qt_gen/db/parents/__init__.py +7 -0
  237. exdrf_dev/qt_gen/db/parents/api.py +29 -0
  238. exdrf_dev/qt_gen/db/parents/fields/__init__.py +7 -0
  239. exdrf_dev/qt_gen/db/parents/fields/fld_children.py +102 -0
  240. exdrf_dev/qt_gen/db/parents/fields/fld_created_at.py +48 -0
  241. exdrf_dev/qt_gen/db/parents/fields/fld_id.py +47 -0
  242. exdrf_dev/qt_gen/db/parents/fields/fld_is_active.py +47 -0
  243. exdrf_dev/qt_gen/db/parents/fields/fld_name.py +48 -0
  244. exdrf_dev/qt_gen/db/parents/fields/fld_profile.py +94 -0
  245. exdrf_dev/qt_gen/db/parents/fields/fld_tags.py +94 -0
  246. exdrf_dev/qt_gen/db/parents/fields/single_f.py +60 -0
  247. exdrf_dev/qt_gen/db/parents/models/__init__.py +7 -0
  248. exdrf_dev/qt_gen/db/parents/models/parent_ful.py +165 -0
  249. exdrf_dev/qt_gen/db/parents/models/parent_ocm.py +95 -0
  250. exdrf_dev/qt_gen/db/parents/widgets/__init__.py +7 -0
  251. exdrf_dev/qt_gen/db/parents/widgets/parent_editor.py +85 -0
  252. exdrf_dev/qt_gen/db/parents/widgets/parent_editor.ui +252 -0
  253. exdrf_dev/qt_gen/db/parents/widgets/parent_editor_ui.py +186 -0
  254. exdrf_dev/qt_gen/db/parents/widgets/parent_list.py +83 -0
  255. exdrf_dev/qt_gen/db/parents/widgets/parent_selector.py +122 -0
  256. exdrf_dev/qt_gen/db/parents/widgets/parent_tv.html.j2 +31 -0
  257. exdrf_dev/qt_gen/db/parents/widgets/parent_tv.py +204 -0
  258. exdrf_dev/qt_gen/db/profiles/__init__.py +7 -0
  259. exdrf_dev/qt_gen/db/profiles/api.py +29 -0
  260. exdrf_dev/qt_gen/db/profiles/fields/__init__.py +7 -0
  261. exdrf_dev/qt_gen/db/profiles/fields/fld_bio.py +45 -0
  262. exdrf_dev/qt_gen/db/profiles/fields/fld_id.py +47 -0
  263. exdrf_dev/qt_gen/db/profiles/fields/fld_parent.py +94 -0
  264. exdrf_dev/qt_gen/db/profiles/fields/fld_parent_id.py +48 -0
  265. exdrf_dev/qt_gen/db/profiles/fields/single_f.py +60 -0
  266. exdrf_dev/qt_gen/db/profiles/models/__init__.py +7 -0
  267. exdrf_dev/qt_gen/db/profiles/models/profile_ful.py +129 -0
  268. exdrf_dev/qt_gen/db/profiles/models/profile_ocm.py +89 -0
  269. exdrf_dev/qt_gen/db/profiles/widgets/__init__.py +7 -0
  270. exdrf_dev/qt_gen/db/profiles/widgets/db/__init__.py +1 -0
  271. exdrf_dev/qt_gen/db/profiles/widgets/db/profile.py +26 -0
  272. exdrf_dev/qt_gen/db/profiles/widgets/profile_editor.py +90 -0
  273. exdrf_dev/qt_gen/db/profiles/widgets/profile_editor.ui +139 -0
  274. exdrf_dev/qt_gen/db/profiles/widgets/profile_editor_ui.py +115 -0
  275. exdrf_dev/qt_gen/db/profiles/widgets/profile_list.py +83 -0
  276. exdrf_dev/qt_gen/db/profiles/widgets/profile_selector.py +126 -0
  277. exdrf_dev/qt_gen/db/profiles/widgets/profile_tv.html.j2 +19 -0
  278. exdrf_dev/qt_gen/db/profiles/widgets/profile_tv.py +179 -0
  279. exdrf_dev/qt_gen/db/related_items/__init__.py +7 -0
  280. exdrf_dev/qt_gen/db/related_items/api.py +33 -0
  281. exdrf_dev/qt_gen/db/related_items/fields/__init__.py +7 -0
  282. exdrf_dev/qt_gen/db/related_items/fields/fld_comp_key_owner.py +96 -0
  283. exdrf_dev/qt_gen/db/related_items/fields/fld_comp_key_part1.py +49 -0
  284. exdrf_dev/qt_gen/db/related_items/fields/fld_comp_key_part2.py +48 -0
  285. exdrf_dev/qt_gen/db/related_items/fields/fld_id.py +47 -0
  286. exdrf_dev/qt_gen/db/related_items/fields/fld_item_data.py +46 -0
  287. exdrf_dev/qt_gen/db/related_items/fields/fld_some_int.py +51 -0
  288. exdrf_dev/qt_gen/db/related_items/fields/single_f.py +57 -0
  289. exdrf_dev/qt_gen/db/related_items/models/__init__.py +7 -0
  290. exdrf_dev/qt_gen/db/related_items/models/related_item_ful.py +148 -0
  291. exdrf_dev/qt_gen/db/related_items/models/related_item_ocm.py +102 -0
  292. exdrf_dev/qt_gen/db/related_items/widgets/__init__.py +7 -0
  293. exdrf_dev/qt_gen/db/related_items/widgets/related_item_editor.py +88 -0
  294. exdrf_dev/qt_gen/db/related_items/widgets/related_item_editor.ui +209 -0
  295. exdrf_dev/qt_gen/db/related_items/widgets/related_item_editor_ui.py +183 -0
  296. exdrf_dev/qt_gen/db/related_items/widgets/related_item_list.py +86 -0
  297. exdrf_dev/qt_gen/db/related_items/widgets/related_item_selector.py +126 -0
  298. exdrf_dev/qt_gen/db/related_items/widgets/related_item_tv.html.j2 +27 -0
  299. exdrf_dev/qt_gen/db/related_items/widgets/related_item_tv.py +212 -0
  300. exdrf_dev/qt_gen/db/tags/__init__.py +7 -0
  301. exdrf_dev/qt_gen/db/tags/api.py +29 -0
  302. exdrf_dev/qt_gen/db/tags/fields/__init__.py +7 -0
  303. exdrf_dev/qt_gen/db/tags/fields/fld_id.py +47 -0
  304. exdrf_dev/qt_gen/db/tags/fields/fld_name.py +47 -0
  305. exdrf_dev/qt_gen/db/tags/fields/fld_parents.py +95 -0
  306. exdrf_dev/qt_gen/db/tags/fields/single_f.py +60 -0
  307. exdrf_dev/qt_gen/db/tags/models/__init__.py +7 -0
  308. exdrf_dev/qt_gen/db/tags/models/tag_ful.py +133 -0
  309. exdrf_dev/qt_gen/db/tags/models/tag_ocm.py +87 -0
  310. exdrf_dev/qt_gen/db/tags/widgets/__init__.py +7 -0
  311. exdrf_dev/qt_gen/db/tags/widgets/tag_editor.py +83 -0
  312. exdrf_dev/qt_gen/db/tags/widgets/tag_editor.ui +134 -0
  313. exdrf_dev/qt_gen/db/tags/widgets/tag_editor_ui.py +114 -0
  314. exdrf_dev/qt_gen/db/tags/widgets/tag_list.py +83 -0
  315. exdrf_dev/qt_gen/db/tags/widgets/tag_selector.py +122 -0
  316. exdrf_dev/qt_gen/db/tags/widgets/tag_tv.html.j2 +15 -0
  317. exdrf_dev/qt_gen/db/tags/widgets/tag_tv.py +168 -0
  318. exdrf_dev/qt_gen/menus.py +121 -0
  319. exdrf_dev/qt_gen/plugins.py +484 -0
  320. exdrf_dev/qt_gen/router.py +594 -0
  321. exdrf_dev/remove_empty_file_named_file.py +129 -0
  322. exdrf_dev/select_model_show/__init__.py +0 -0
  323. exdrf_dev/select_model_show/__main__.py +60 -0
  324. exdrf_dev/select_model_show/main_window.py +45 -0
  325. exdrf_dev-0.1.12.dist-info/METADATA +37 -0
  326. exdrf_dev-0.1.12.dist-info/RECORD +335 -0
  327. exdrf_dev-0.1.12.dist-info/WHEEL +5 -0
  328. exdrf_dev-0.1.12.dist-info/top_level.txt +3 -0
  329. exdrf_dev_tests/__init__.py +0 -0
  330. exdrf_dev_tests/qt_test/__init__.py +0 -0
  331. exdrf_dev_tests/qt_test/children_test/__init__.py +0 -0
  332. exdrf_dev_tests/qt_test/children_test/fields_test/__init__.py +0 -0
  333. exdrf_dev_tests/qt_test/children_test/models_test/__init__.py +0 -0
  334. exdrf_dev_tests/qt_test/children_test/models_test/children_full_test.py +362 -0
  335. exdrf_dev_tests/qt_test/children_test/models_test/children_ocm_test.py +0 -0
@@ -0,0 +1,7 @@
1
+ # This file was automatically generated using the exdrf_gen package.
2
+ # Source: exdrf_gen_al2at.creator -> c/api.py.j2
3
+ # Don't change it manually.
4
+
5
+ # exdrf-keep-start more_content ------------------------------------------------
6
+
7
+ # exdrf-keep-end more_content --------------------------------------------------
@@ -0,0 +1,30 @@
1
+ from typing import Optional
2
+
3
+ from attrs import define, field
4
+
5
+ # exdrf-keep-start other_imports ----------------------------------------------
6
+
7
+ # exdrf-keep-end other_imports ------------------------------------------------
8
+
9
+ # exdrf-keep-start other_globals ----------------------------------------------
10
+
11
+ # exdrf-keep-end other_globals ------------------------------------------------
12
+
13
+
14
+ @define
15
+ class Tag:
16
+ # exdrf-keep-start other_attributes ---------------------------------------
17
+
18
+ # exdrf-keep-end other_attributes -----------------------------------------
19
+ name: Optional[str] = field(default=None)
20
+ parents: Optional[list[str]] = field(default=None)
21
+ id: Optional[int] = field(default=None)
22
+
23
+ # exdrf-keep-start extra_class_content -------------------------------------
24
+
25
+ # exdrf-keep-end extra_class_content ---------------------------------------
26
+
27
+
28
+ # exdrf-keep-start more_content -----------------------------------------------
29
+
30
+ # exdrf-keep-end more_content -------------------------------------------------
File without changes
exdrf_dev/cli.py ADDED
@@ -0,0 +1,89 @@
1
+ import logging
2
+ import os
3
+ import subprocess
4
+
5
+ import click
6
+ from dotenv import load_dotenv
7
+
8
+ from exdrf_al.click_support.auto_db_migration import auto_db_migration
9
+ from exdrf_al.click_support.downgrade_db import downgrade_db
10
+ from exdrf_al.click_support.list_db_version import list_db_versions
11
+ from exdrf_al.click_support.set_db_version import set_db_version
12
+ from exdrf_al.click_support.upgrade_db import upgrade_db
13
+ from exdrf_dev.__version__ import __version__
14
+
15
+
16
+ @click.group()
17
+ @click.option("--debug/--no-debug", default=False)
18
+ @click.version_option(__version__, prog_name="exdrf-dev")
19
+ def cli(debug: bool):
20
+ logging.basicConfig(
21
+ level=logging.DEBUG if debug else logging.INFO,
22
+ format="[%(levelname)s] %(message)s",
23
+ datefmt="%Y-%m-%d %H:%M:%S",
24
+ )
25
+ logging.debug("Debug mode is on")
26
+ os.environ["CURDIR"] = os.getcwd()
27
+
28
+ load_dotenv(override=True)
29
+ click.echo("=" * 80)
30
+ _print_env("Environment variables after .env")
31
+ click.echo("=" * 80)
32
+
33
+
34
+ def _print_env(title: str = "Environment variables"):
35
+ click.echo(title)
36
+ for key in sorted(os.environ.keys()):
37
+ value = os.environ[key]
38
+ if len(value) > 50:
39
+ click.echo(f"{key}:")
40
+ for part in value.split(";"):
41
+ click.echo(f" {part}")
42
+ else:
43
+ click.echo(f"{key}: {value}")
44
+
45
+
46
+ @cli.command()
47
+ def print_env():
48
+ """Print the environment variables."""
49
+ _print_env()
50
+
51
+
52
+ @cli.command()
53
+ @click.argument("args", nargs=-1)
54
+ def run(args):
55
+ """Run the exdrf-dev application with provided arguments."""
56
+ click.echo(f"Running exdrf-dev with arguments: {args}")
57
+ try:
58
+ final_args = []
59
+ for a in args:
60
+ if a.startswith("env:"):
61
+ env_var = a[4:]
62
+ env_value = os.environ.get(env_var)
63
+ if env_value is None:
64
+ click.echo(f"Env. variable '{env_var}' not found.", err=True)
65
+ return
66
+ a = env_value
67
+ final_args.append(a)
68
+
69
+ result = subprocess.run(
70
+ final_args, check=True, text=True, capture_output=True, shell=True
71
+ )
72
+ click.echo(result.stdout)
73
+ if result.stderr:
74
+ click.echo(result.stderr, err=True)
75
+ except subprocess.CalledProcessError as e:
76
+ click.echo(f"Command failed with exit code {e.returncode}", err=True)
77
+ click.echo(e.stderr, err=True)
78
+ except FileNotFoundError:
79
+ click.echo("Command not found", err=True)
80
+
81
+
82
+ cli.add_command(auto_db_migration)
83
+ cli.add_command(list_db_versions)
84
+ cli.add_command(set_db_version)
85
+ cli.add_command(upgrade_db)
86
+ cli.add_command(downgrade_db)
87
+
88
+ if __name__ == "__main__":
89
+ cli()
File without changes
exdrf_dev/db/api.py ADDED
@@ -0,0 +1,10 @@
1
+ from exdrf_dev.db.models import ( # noqa: F401
2
+ Child,
3
+ CompositeKeyModel,
4
+ Parent,
5
+ ParentTagAssociation,
6
+ Profile,
7
+ RelatedItem,
8
+ StatusEnum,
9
+ Tag,
10
+ )
exdrf_dev/db/models.py ADDED
@@ -0,0 +1,504 @@
1
+ import datetime
2
+ import enum
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from sqlalchemy import (
6
+ JSON,
7
+ Boolean,
8
+ Date,
9
+ DateTime,
10
+ Enum,
11
+ Float,
12
+ ForeignKey,
13
+ ForeignKeyConstraint,
14
+ Integer,
15
+ LargeBinary,
16
+ PrimaryKeyConstraint,
17
+ String,
18
+ Time,
19
+ create_engine,
20
+ )
21
+ from sqlalchemy.orm import (
22
+ Mapped,
23
+ mapped_column,
24
+ relationship,
25
+ sessionmaker,
26
+ )
27
+
28
+ from exdrf_al.base import Base
29
+
30
+
31
+ class StatusEnum(enum.Enum):
32
+ """Enumeration for various status values."""
33
+
34
+ PENDING = "pending"
35
+ PROCESSING = "processing"
36
+ COMPLETED = "completed"
37
+ FAILED = "failed"
38
+
39
+
40
+ # --- Association Table for Many-to-Many ---
41
+
42
+
43
+ class ParentTagAssociation(Base):
44
+ """Association object for the many-to-many relationship between Parent and
45
+ Tag.
46
+ """
47
+
48
+ __tablename__ = "parent_tag_association"
49
+ __table_args__ = (
50
+ PrimaryKeyConstraint("parent_id", "tag_id"),
51
+ {"info": {"label": """(concat "Parent:" parent_id " Tag:" tag_id)"""}},
52
+ )
53
+
54
+ parent_id: Mapped[int] = mapped_column(
55
+ Integer,
56
+ ForeignKey("parents.id"),
57
+ primary_key=True,
58
+ doc="Foreign key to the parents table.",
59
+ )
60
+ tag_id: Mapped[int] = mapped_column(
61
+ Integer,
62
+ ForeignKey("tags.id"),
63
+ primary_key=True,
64
+ doc="Foreign key to the tags table.",
65
+ )
66
+
67
+ def __repr__(self) -> str:
68
+ return (
69
+ f"<ParentTagAssociation(parent_id={self.parent_id}, tag_id={self.tag_id})>"
70
+ )
71
+
72
+
73
+ # --- Model Definitions ---
74
+
75
+
76
+ class Parent(Base):
77
+ """Represents a parent entity with various relationships."""
78
+
79
+ __tablename__ = "parents"
80
+ __table_args__ = {"info": {"label": """(concat "ID:" id " Name:" name)"""}}
81
+
82
+ id: Mapped[int] = mapped_column(
83
+ Integer, primary_key=True, doc="Primary key for the parent."
84
+ )
85
+ name: Mapped[str] = mapped_column(
86
+ String(100),
87
+ index=True,
88
+ doc="Name of the parent.",
89
+ info={
90
+ "min_length": 1,
91
+ "multiline": False,
92
+ "visible": True,
93
+ "sortable": True,
94
+ "filterable": True,
95
+ },
96
+ )
97
+ created_at: Mapped[datetime.datetime] = mapped_column(
98
+ DateTime,
99
+ default=datetime.datetime.utcnow,
100
+ doc="Timestamp when the parent was created.",
101
+ info={
102
+ "min": datetime.datetime(2020, 1, 1, 0, 0),
103
+ "max": datetime.datetime(2030, 12, 31, 23, 59),
104
+ },
105
+ )
106
+ is_active: Mapped[bool] = mapped_column(
107
+ Boolean,
108
+ default=True,
109
+ doc="Flag indicating if the parent is active.",
110
+ info={
111
+ "true_str": "Active",
112
+ "false_str": "Inactive",
113
+ },
114
+ )
115
+
116
+ # One-to-Many relationship with Child
117
+ children: Mapped[List["Child"]] = relationship(
118
+ "Child",
119
+ back_populates="parent",
120
+ cascade="all, delete-orphan",
121
+ info={
122
+ "doc": "Children associated with this parent.",
123
+ "direction": "OneToMany",
124
+ },
125
+ )
126
+
127
+ # One-to-One relationship with Profile
128
+ profile: Mapped[Optional["Profile"]] = relationship(
129
+ "Profile",
130
+ back_populates="parent",
131
+ uselist=False,
132
+ cascade="all, delete-orphan",
133
+ info={
134
+ "doc": "Profile associated with this parent (one-to-one).",
135
+ "direction": "OneToOne",
136
+ },
137
+ )
138
+
139
+ # Many-to-Many relationship with Tag
140
+ tags: Mapped[List["Tag"]] = relationship(
141
+ "Tag",
142
+ secondary="parent_tag_association",
143
+ back_populates="parents",
144
+ info={
145
+ "doc": "Tags associated with this parent (many-to-many).",
146
+ "direction": "ManyToMany",
147
+ },
148
+ )
149
+
150
+ def __repr__(self) -> str:
151
+ return f"<Parent(id={self.id}, name='{self.name}')>"
152
+
153
+
154
+ class Child(Base):
155
+ """Represents a child entity linked to a parent."""
156
+
157
+ __tablename__ = "children"
158
+ __table_args__ = {
159
+ "info": {
160
+ "label": """
161
+ (concat "ID:" id " Parent " parent.name " Data:" data)
162
+ """
163
+ }
164
+ }
165
+
166
+ id: Mapped[int] = mapped_column(
167
+ Integer, primary_key=True, doc="Primary key for the child."
168
+ )
169
+ data: Mapped[Optional[str]] = mapped_column(
170
+ String,
171
+ doc="Some data associated with the child.",
172
+ info={
173
+ "min_length": 1,
174
+ "max_length": 200,
175
+ "multiline": True,
176
+ "visible": True,
177
+ "sortable": True,
178
+ "filterable": True,
179
+ },
180
+ )
181
+ parent_id: Mapped[int] = mapped_column(
182
+ Integer,
183
+ ForeignKey("parents.id"),
184
+ doc="Foreign key linking to the parent.",
185
+ )
186
+
187
+ # Many-to-One relationship with Parent
188
+ parent: Mapped["Parent"] = relationship(
189
+ "Parent",
190
+ back_populates="children",
191
+ info={
192
+ "doc": "The parent associated with this child.",
193
+ "direction": "ManyToOne",
194
+ },
195
+ )
196
+
197
+ def __repr__(self) -> str:
198
+ return f"<Child(id={self.id}, data='{self.data}', parent_id={self.parent_id})>"
199
+
200
+
201
+ class Profile(Base):
202
+ """Represents a profile entity linked one-to-one with a parent."""
203
+
204
+ __tablename__ = "profiles"
205
+ __table_args__ = {"info": {"label": """(concat "ID:" id " Bio:" bio)"""}}
206
+
207
+ id: Mapped[int] = mapped_column(
208
+ Integer, primary_key=True, doc="Primary key for the profile."
209
+ )
210
+ bio: Mapped[Optional[str]] = mapped_column(
211
+ String, doc="Biography text for the profile."
212
+ )
213
+ parent_id: Mapped[int] = mapped_column(
214
+ Integer,
215
+ ForeignKey("parents.id"),
216
+ unique=True, # Ensures one-to-one relationship at the DB level
217
+ doc="Foreign key linking to the parent (must be unique).",
218
+ )
219
+
220
+ # One-to-One relationship back to Parent
221
+ parent: Mapped["Parent"] = relationship(
222
+ "Parent",
223
+ back_populates="profile",
224
+ info={
225
+ "doc": "The parent associated with this profile.",
226
+ "direction": "OneToOne",
227
+ },
228
+ )
229
+
230
+ def __repr__(self) -> str:
231
+ return f"<Profile(id={self.id}, parent_id={self.parent_id})>"
232
+
233
+
234
+ class Tag(Base):
235
+ """Represents a tag entity for many-to-many relationships."""
236
+
237
+ __tablename__ = "tags"
238
+ __table_args__ = {"info": {"label": """(concat "ID:" id " Name:" name)"""}}
239
+
240
+ id: Mapped[int] = mapped_column(
241
+ Integer, primary_key=True, doc="Primary key for the tag."
242
+ )
243
+ name: Mapped[str] = mapped_column(
244
+ String(50), unique=True, index=True, doc="Unique name of the tag."
245
+ )
246
+
247
+ # Many-to-Many relationship back to Parent
248
+ parents: Mapped[List["Parent"]] = relationship(
249
+ "Parent",
250
+ secondary="parent_tag_association",
251
+ back_populates="tags",
252
+ info={
253
+ "doc": "Parents associated with this tag.",
254
+ "direction": "ManyToMany",
255
+ },
256
+ )
257
+
258
+ def __repr__(self) -> str:
259
+ return f"<Tag(id={self.id}, name='{self.name}')>"
260
+
261
+
262
+ class CompositeKeyModel(Base):
263
+ """Demonstrates a model with a composite primary key and various data
264
+ types.
265
+ """
266
+
267
+ __tablename__ = "comp_key_models"
268
+
269
+ # Composite Primary Key
270
+ key_part1: Mapped[str] = mapped_column(
271
+ String(50),
272
+ primary_key=True,
273
+ doc="First part of the composite primary key (string).",
274
+ )
275
+ key_part2: Mapped[int] = mapped_column(
276
+ Integer,
277
+ primary_key=True,
278
+ doc="Second part of the composite primary key (integer).",
279
+ )
280
+
281
+ description: Mapped[Optional[str]] = mapped_column(
282
+ String,
283
+ doc="A description for this record.",
284
+ info={
285
+ "multiline": True,
286
+ },
287
+ )
288
+ some_float: Mapped[Optional[float]] = mapped_column(
289
+ Float,
290
+ doc="A floating-point number.",
291
+ info={
292
+ "min": 0.0,
293
+ "max": 100.0,
294
+ "precision": 2,
295
+ "scale": 2,
296
+ "unit": "units",
297
+ "unit_symbol": "u",
298
+ },
299
+ )
300
+ some_date: Mapped[Optional[datetime.date]] = mapped_column(
301
+ Date,
302
+ doc="A date value.",
303
+ info={
304
+ "min": datetime.date(2020, 1, 1),
305
+ "max": datetime.date(2030, 12, 31),
306
+ },
307
+ )
308
+ some_time: Mapped[Optional[datetime.time]] = mapped_column(
309
+ Time,
310
+ doc="A time value.",
311
+ )
312
+ some_enum: Mapped[Optional[StatusEnum]] = mapped_column(
313
+ Enum(StatusEnum), doc="An enum value representing status."
314
+ )
315
+ some_json: Mapped[Optional[Dict[str, Any]]] = mapped_column(
316
+ JSON, doc="A JSON object."
317
+ )
318
+ some_binary: Mapped[Optional[bytes]] = mapped_column(
319
+ LargeBinary,
320
+ doc="Binary data.",
321
+ info={
322
+ "visible": False,
323
+ "sortable": False,
324
+ "filterable": False,
325
+ "mime_type": "application/octet-stream",
326
+ },
327
+ )
328
+
329
+ # One-to-Many relationship with RelatedItem using composite foreign key
330
+ related_items: Mapped[List["RelatedItem"]] = relationship(
331
+ "RelatedItem",
332
+ back_populates="comp_key_owner",
333
+ cascade="all, delete-orphan",
334
+ foreign_keys="[RelatedItem.comp_key_part1, RelatedItem.comp_key_part2]",
335
+ info={
336
+ "doc": "Items related to this composite key model.",
337
+ "direction": "OneToMany",
338
+ },
339
+ )
340
+
341
+ __table_args__ = (
342
+ PrimaryKeyConstraint("key_part1", "key_part2", name="composite_pk"),
343
+ {"info": {"label": """(concat "Description:" description)"""}},
344
+ )
345
+
346
+ def __repr__(self) -> str:
347
+ return (
348
+ f"<CompositeKeyModel(key_part1='{self.key_part1}', "
349
+ f"key_part2={self.key_part2})>"
350
+ )
351
+
352
+
353
+ class RelatedItem(Base):
354
+ """Model related to CompositeKeyModel via its composite key."""
355
+
356
+ __tablename__ = "related_items"
357
+
358
+ id: Mapped[int] = mapped_column(
359
+ Integer, primary_key=True, doc="Primary key for the related item."
360
+ )
361
+ item_data: Mapped[Optional[str]] = mapped_column(
362
+ String(200), doc="Data specific to the related item."
363
+ )
364
+ some_int: Mapped[Optional[int]] = mapped_column(
365
+ Integer,
366
+ doc="An integer value associated with the related item.",
367
+ info={
368
+ "min": 0,
369
+ "max": 1000,
370
+ "unit": "units",
371
+ "unit_symbol": "u",
372
+ },
373
+ )
374
+
375
+ # Composite Foreign Key parts
376
+ comp_key_part1: Mapped[str] = mapped_column(
377
+ String(50), doc="Foreign key part 1 referencing CompositeKeyModel."
378
+ )
379
+ comp_key_part2: Mapped[int] = mapped_column(
380
+ Integer, doc="Foreign key part 2 referencing CompositeKeyModel."
381
+ )
382
+
383
+ # Many-to-One relationship back to CompositeKeyModel
384
+ comp_key_owner: Mapped["CompositeKeyModel"] = relationship(
385
+ "CompositeKeyModel",
386
+ back_populates="related_items",
387
+ foreign_keys=[comp_key_part1, comp_key_part2],
388
+ info={
389
+ "doc": "The owner model with the composite key.",
390
+ "direction": "ManyToOne",
391
+ },
392
+ )
393
+
394
+ # Define the composite foreign key constraint
395
+ __table_args__ = (
396
+ ForeignKeyConstraint(
397
+ ["comp_key_part1", "comp_key_part2"],
398
+ ["comp_key_models.key_part1", "comp_key_models.key_part2"],
399
+ name="related_item_composite_fk",
400
+ ),
401
+ {"info": {"label": """(concat "ID:" id)"""}},
402
+ )
403
+
404
+ def __repr__(self) -> str:
405
+ return (
406
+ f"<RelatedItem(id={self.id}, "
407
+ f"key1='{self.comp_key_part1}', key2={self.comp_key_part2})>"
408
+ )
409
+
410
+
411
+ def get_dev_engine():
412
+ """Creates an in-memory SQLite database engine for development/testing."""
413
+ engine = create_engine("sqlite:///:memory:")
414
+ Base.metadata.create_all(engine)
415
+ return engine
416
+
417
+
418
+ def get_populated_dev_engine(engine=None):
419
+ """Creates an in-memory SQLite database engine and populates it with
420
+ sample data.
421
+ """
422
+ if engine is None:
423
+ engine = get_dev_engine()
424
+ SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
425
+
426
+ with SessionLocal() as session:
427
+ # Create instances
428
+ tag1 = Tag(name="Urgent")
429
+ tag2 = Tag(name="Project Alpha")
430
+
431
+ parent1 = Parent(name="Parent One")
432
+ parent1.profile = Profile(bio="Profile for Parent One")
433
+ parent1.children.append(Child(data="Child A data"))
434
+ parent1.children.append(Child(data="Child B data"))
435
+ parent1.tags.extend([tag1, tag2])
436
+
437
+ parent2 = Parent(name="Parent Two", is_active=False)
438
+ parent2.children.append(Child(data="Child C data"))
439
+ parent2.tags.append(tag1)
440
+
441
+ comp_key_obj1 = CompositeKeyModel(
442
+ key_part1="ITEM_A",
443
+ key_part2=101,
444
+ description="First composite item",
445
+ some_float=3.14,
446
+ some_date=datetime.date(2023, 1, 15),
447
+ some_time=datetime.time(10, 30, 0),
448
+ some_enum=StatusEnum.PROCESSING,
449
+ some_json={"config": True, "values": [1, 2, 3]},
450
+ some_binary=b"\x01\x02\x03\x04",
451
+ )
452
+ comp_key_obj1.related_items.append(
453
+ RelatedItem(item_data="Related data 1", some_int=42)
454
+ )
455
+ comp_key_obj1.related_items.append(
456
+ RelatedItem(item_data="Related data 2", some_int=84)
457
+ )
458
+
459
+ comp_key_obj2 = CompositeKeyModel(
460
+ key_part1="ITEM_B",
461
+ key_part2=202,
462
+ description="Second composite item",
463
+ some_enum=StatusEnum.COMPLETED,
464
+ )
465
+
466
+ # Add to session and commit
467
+ session.add_all([parent1, parent2, comp_key_obj1, comp_key_obj2])
468
+ session.commit()
469
+
470
+ return engine
471
+
472
+
473
+ def print_db_content(engine):
474
+ """Prints the content of all tables defined in Base.metadata."""
475
+ SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
476
+ models_to_print = [
477
+ Parent,
478
+ Child,
479
+ Profile,
480
+ Tag,
481
+ CompositeKeyModel,
482
+ RelatedItem,
483
+ ]
484
+
485
+ with SessionLocal() as session:
486
+ for model_cls in models_to_print:
487
+ table_name = model_cls.__tablename__
488
+ print(f"\n--- Table: {table_name} ---")
489
+ try:
490
+ instances = session.query(model_cls).all()
491
+ if instances:
492
+ for instance in instances:
493
+ print(instance)
494
+ else:
495
+ print("(empty)")
496
+ except Exception as e:
497
+ print(f"Error querying table {table_name}: {e}")
498
+
499
+
500
+ if __name__ == "__main__":
501
+ # Example usage
502
+ engine = get_populated_dev_engine()
503
+ print_db_content(engine)
504
+ print("Database populated and printed successfully.")