2đź‘Ť
Strictly speaking, “reserved word” is the wrong term here. Reserved words are properties of a programming language, and Django is not a language.
There is a class called Field
in Django in the django.db.models.fields
package, and another (similar but different) class with the same name in the django.forms.fields
package.
However, these Field
classes are so low level classes that it’s unlikely that you will ever need to import them, so they won’t interfere with your own Field
class.
In any case, and as you can see, within Django itself the same class can exist in multiple packages with the same name. It’s fine, because the package name serves as a namespace, so you can always fully qualify a class by using its complete package name.
Another useful thing in Python is importing classes with a different name:
from django.db.models.fields import Field as DjangoField
help(DjangoField)
Similarly, importing packages with a different name:
from django.db.models import fields as djangofields
help(djangofields.Field)
This way you can always avoid collisions in class and package names.
2đź‘Ť
little explanation with fun
Answer is Simply No,
Because Language only has the authority to own anything.Python is the owner of the house
The Django guy is paying rent to Python guy. So, How Django guy can reserve the objects of the house?
same logic is applied here too
- [Django]-Django Forms for generic relationships. How to include them?
- [Django]-Setting up Django with Redis, Celery to send emails via Gmail
- [Django]-Omit last element in comma-separated list
- [Django]-Django unable to connect to MySQL server