12 Jan 2024 |
pedro.diaz | nah, yeah I fixed it already | 15:30:56 |
pedro.diaz | just found it funny | 15:31:00 |
alc.alc | what was the actual issue? | 15:31:10 |
pedro.diaz | that | 15:31:17 |
pedro.diaz | this one | 15:31:25 |
pedro.diaz | at the app layer and route | 15:31:32 |
alc.alc | yeah, been bitten by it | 15:31:38 |
13 Jan 2024 |
__peter__ | Maybe that error message can be improved? | 00:43:43 |
.nilsso | Is there an option to set a global DTO config with max depth of zero? | 01:46:38 |
alc.alc | I would suggest the fullstack way of doing this https://github.com/litestar-org/litestar-fullstack/blob/bab48d887bf2503906f5db75dde12eaf2ce85654/src/app/lib/dto.py#L49 and then apply it like https://github.com/litestar-org/litestar-fullstack/blob/bab48d887bf2503906f5db75dde12eaf2ce85654/src/app/domain/analytics/dtos.py#L17 the default / "global" value would be the value you set in the config | 02:03:24 |
GitHub Helper | src/app/lib/dto.py line 49
def config(
src/app/domain/analytics/dtos.py line 17
class NewUsersByWeekDTO(DataclassDTO[NewUsersByWeek]): | 02:03:25 |
pbaletkeman_04917 | What have you tried? This seems to work:
class BMW(BaseModel):
name: str
class FORD(BaseModel):
name: str
@get(path='/sample/{variable:str}')
async def display_variable(self, variable: str) -> list[BMW] | list[FORD] | str:
bmws = [BMW(name='BMW1'),BMW(name='BMW2'),BMW(name='BMW3')]
fords = [FORD(name='FORD1'), FORD(name='FORD2'), FORD(name='FORD3')]
if variable == 'BMW':
return bmws
elif variable == 'FORD':
return fords
else:
return variable | 02:45:34 |
pbaletkeman_04917 | * What have you tried? This seems to work:
class BMW(BaseModel):
name: str
class FORD(BaseModel):
name: str
@get(path='/sample/{variable:str}')
async def display_variable(self, variable: str) -> list[BMW] | list[FORD] | str:
bmws = [BMW(name='BMW1'),BMW(name='BMW2'),BMW(name='BMW3')]
fords = [FORD(name='FORD1'), FORD(name='FORD2'), FORD(name='FORD3')]
if variable == 'BMW':
return bmws
elif variable == 'FORD':
return fords
else:
return variable
But if you do not know the return try at all then you could do this
async def display_variable(self, variable: str) -> Any | 02:46:40 |
pbaletkeman_04917 | I appreciate how easy it was to get this example working https://docs.litestar.dev/latest/usage/security/jwt.html#oauth2-bearer-password-flow Other frameworks require significantly more effort and code. Thank you | 02:55:47 |
18 Jan 2024 |
| @darkpup2001:matrix.org joined the room. | 00:12:33 |
| @darkpup2001:matrix.org left the room. | 00:22:57 |
19 Jan 2024 |
| Hasan Sezer Taลan joined the room. | 06:22:00 |
24 Jan 2024 |
| tobin6579 joined the room. | 06:44:02 |
3 Feb 2024 |
| @jojo404:matrix.org joined the room. | 20:29:27 |
4 Feb 2024 |
| @tommy_pac:matrix.org joined the room. | 14:17:31 |
5 Feb 2024 |
@jojo404:matrix.org | "I'll help anyone interested on how to earn 100k in just 24hours from the crypto market. But you will have to pay me my commission! when you receive your profit! if interested click on the group link and send me a direct message
https://t.me/+FGhsj-vpp7dmZDc0
by asking me HOW | 19:38:42 |
6 Feb 2024 |
| @jojo404:matrix.org left the room. | 19:32:59 |
7 Feb 2024 |
@tommy_pac:matrix.org | Hello everyone
Iโm a Grower and supplier of quality cannabis and psychedelics products like shrooms, DMT, Lsd, Mdma, ketamine, chocolate bars,Meth, cart vapes, buds, wax, shatter, Edibles,distillates, chill pills and others like (bank notes) and cloned cards which have been tested to work perfectly๐ฏ.
We do Prescription for patients. Best prices join channel below to see products ๐๐๐๐๐
https://t.me/hightime_markert | 00:06:21 |
| ajodo50 joined the room. | 20:43:35 |
11 Feb 2024 |
| @tommy_pac:matrix.org left the room. | 08:52:53 |
7 Mar 2024 |
| @jcmdln:matrix.org joined the room. | 03:58:05 |
| @jcmdln:matrix.org left the room. | 03:58:31 |
8 Mar 2024 |
| Thandeka Alleta joined the room. | 14:04:43 |
5 Apr 2024 |
| @darksaber:matrix.org left the room. | 16:54:05 |
10 Apr 2024 |
| thompson_plug joined the room. | 22:19:29 |