|
1 | 1 | # ducktools.env |
2 | 2 | # MIT License |
3 | | -# |
| 3 | +# |
4 | 4 | # Copyright (c) 2024 David C Ellis |
5 | | -# |
| 5 | +# |
6 | 6 | # Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | 7 | # of this software and associated documentation files (the "Software"), to deal |
8 | 8 | # in the Software without restriction, including without limitation the rights |
9 | 9 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
10 | 10 | # copies of the Software, and to permit persons to whom the Software is |
11 | 11 | # furnished to do so, subject to the following conditions: |
12 | | -# |
| 12 | +# |
13 | 13 | # The above copyright notice and this permission notice shall be included in all |
14 | 14 | # copies or substantial portions of the Software. |
15 | | -# |
| 15 | +# |
16 | 16 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
17 | 17 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
18 | 18 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
@@ -106,13 +106,13 @@ class ExampleClass(SQLClass): |
106 | 106 | @property |
107 | 107 | def field_dict(self): |
108 | 108 | return { |
109 | | - "uid": SQLAttribute(default=None, primary_key=True, type=int), |
110 | | - "name": SQLAttribute(unique=True, type=str), |
111 | | - "age": SQLAttribute(default=20, internal=True, type=int), |
112 | | - "height_m": SQLAttribute(type=float), |
113 | | - "height_feet": SQLAttribute(default=None, computed="height_m * 3.28084", type=float), |
114 | | - "friends": SQLAttribute(default_factory=list, type=list[str]), |
115 | | - "some_bool": SQLAttribute(type=bool), |
| 109 | + "uid": SQLAttribute(default=None, primary_key=True, type=int, kw_only=True), |
| 110 | + "name": SQLAttribute(unique=True, type=str, kw_only=True), |
| 111 | + "age": SQLAttribute(default=20, internal=True, type=int, kw_only=True), |
| 112 | + "height_m": SQLAttribute(type=float, kw_only=True), |
| 113 | + "height_feet": SQLAttribute(default=None, computed="height_m * 3.28084", type=float, kw_only=True), |
| 114 | + "friends": SQLAttribute(default_factory=list, type=list[str], kw_only=True), |
| 115 | + "some_bool": SQLAttribute(type=bool, kw_only=True), |
116 | 116 | } |
117 | 117 |
|
118 | 118 |
|
@@ -572,4 +572,3 @@ class ExampleClass(SQLClass): |
572 | 572 | height_feet: float = SQLAttribute(computed="height_m * 3.28084") |
573 | 573 | friends: list[str] = SQLAttribute(default_factory=list) |
574 | 574 | some_bool: bool |
575 | | - |
0 commit comments