Похожие чаты

But i think django is python?

16 ответов

15 просмотров

It is.

Bruce-Minanga Автор вопроса
Gian
It is.

Then how comes it's creating classes differently

Bruce Minanga
Then how comes it's creating classes differently

It is not? I think it would be helpful if you could show what you mean. I guess you might be confused by the fact that models only have fields (usually) in them.

Bruce-Minanga Автор вопроса
Gian
It is not? I think it would be helpful if you coul...

Yes am confused on how django defines it's classes in the models.py file. I find it conflicting with pythons conventional way of defining a class

Bruce Minanga
Yes am confused on how django defines it's classes...

So, django models gets **kwargs on it's init. that's where it parses the fields. Nothing special about it. Also, nothing prevents you from overriding the init.

Bruce-Minanga Автор вопроса
Gian
So, django models gets **kwargs on it's init. that...

I don't see **kwargs here. Or where is it located?

Bruce-Minanga Автор вопроса
Gian
django.db.models.Model

I can't find that file, do you have any link from the internet? This is all i could find https://docs.djangoproject.com/en/2.0/_modules/django/db/models/fields/files/

Bruce Minanga
I can't find that file, do you have any link from ...

https://github.com/django/django/blob/main/django/db/models/base.py#L476

Bruce-Minanga Автор вопроса
Gian
https://github.com/django/django/blob/main/django/...

I might be tempted to create a child class without using the init function just to check if it will work the way it worked in django

Bruce-Minanga Автор вопроса
Bruce-Minanga Автор вопроса
Gian
I guess you need to learn about dataclass

Will that help me achieve this? Can you write a short code to illustrate it?

Bruce Minanga
Will that help me achieve this? Can you write a sh...

class AccessKwargs: def __init__(self, *args, **kwargs): print(kwargs) test = DataClass(worked='wow, it worked')

Bruce-Minanga Автор вопроса
Gian
class AccessKwargs: def __init__(self, *args, ...

There is no child class here? I mean there is no inheritance anywhere in that code

Похожие вопросы

Обсуждают сегодня

а через ESC-код ?
Alexey Kulakov
29
30500 за редактор? )
Владимир
47
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
Чёт не понял, я ж правильной функцией воспользовался чтобы вывести отладочную информацию? но что-то она не ловится
notme
18
Привет)) уже кажется эту тему перемусолили, но вот я так и не понял. Я сейчас сижу на 27дюймов 2к мониторе. На Актуальной макоси, если я куплю 27д 4к монитор: - будет ли изобр...
Vladislav Piskunov
15
Hi guys, any problem with Pulsebrige? Trying to transfer from wETH to ETH. First it tells me to connect my metamask "through mobile app" not desktop. Then I did and confirmed ...
Snowflakecrypto
13
any reference of this implementation?
BitBuddha
29
У меня есть функция где происходит это: write_bit(buffer, 1); write_bit(buffer, 0); write_bit(buffer, 1); write_bit(buffer, 1); write_bit(buffer, 1); w...
~
13
Страшнейшая правда про списки ЦБ. С первых дней жизни P2P сферы, молодые человеки, начитавшись законодательной базы и "внутренних" документов, решили, что им противостоит сер...
Foxcool
3
&"C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.42.34433\bin\Hostx64\x64\dumpbin.exe" /EXPORTS C:\Users\Yeet\Tauon\vcpkg\installed\x64-window...
Martin Rys
6
Карта сайта