refactor: trying to align my naming into something specific. removing dynamic routing code.

This commit is contained in:
2024-01-03 14:50:00 +01:00
parent fb72a5deab
commit eef65cfdd0
7 changed files with 98 additions and 167 deletions
+35 -1
View File
@@ -95,4 +95,38 @@ impl AdminRepository for UserRepository {
}
}
```
```
## Finding Names
Ultimately the goal will be to rename even "app" and "model" as concepts later on - maybe.
As I started by quickly using a django admin template with CSS to jump start the admin interface, with the hope to create something that is very much also compatible with existing django admin templates in projects, I ran quickly into naming maelstrom.
#### Django-Admin:
| key | description |
| --- | ----------- |
| app_label | This refers to the name of the Django application that contains the model. It's usually set to the name of the directory that holds the app. In Django's admin interface and internal workings, app_label is used to distinguish models from different apps that might have the same model name. |
| model_name | This is the name of the model class in lowercase. Django uses model_name as a convenient way to refer to models, particularly in URL patterns and in the database layer, where the table name is typically derived from the app_label and model_name. |
| object_name | object_name is the name of the model class itself, typically starting with a capital letter (following Python's class naming conventions). This is more often used in Django's internals and templates. |
| verbose_name | This is a human-readable name for the model, which can be set in the model's Meta class. If not set explicitly, Django generates it automatically by converting the object_name from CamelCase to space-separated words. verbose_name is used in the Django admin interface and any place where a more readable model name is needed. |
| verbose_name_plural | Similar to verbose_name, this is the plural form of the human-readable name of the model. It's used in the Django admin interface where a plural form of the model's name is appropriate, like in list views. |
#### miniweb-admin:
| key | description |
| --- | ----------- |
| app_key | refers to the lowercase slug representation of the app, which might be represented by an Arc<str> in the future |
| model_key | refers to the lowercase slug representation of the model, which might be represented by an Arc<str> in the future |
| app_name | represents the human readable representation of the app |
| model_name | represents the human readable representation of the model |
#### Replacing:
| django-admin | miniweb-admin | explanation |
| ------------ | ------------- | ----------- |
| object_name\|lower | key, app_key, model_key | |
| app_label | key, app_key | |