Похожие чаты

But i think django is python?

16 ответов

20 просмотров

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

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

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

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта