差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
| python:django:model_definition [2020/12/25 05:40] – [アプリのモデル定義 (django_app/models.py)] ともやん | python:django:model_definition [2020/12/25 06:40] (現在) – [models.py を 1 クラス 1 ファイルに分割する] ともやん | ||
|---|---|---|---|
| 行 31: | 行 31: | ||
| |%%|%%| + |admin.py | |%%|%%| + |admin.py | ||
| |%%|%%| + |apps.py | |%%|%%| + |apps.py | ||
| - | |%%|%%| + |models ディレクトリ|||Django アプリのモデル定義パッケージ。 | + | |%%|%%| + ^models ディレクトリ |
| |%%|%%|%%|%%| + |%%__init__%%.py | |%%|%%|%%|%%| + |%%__init__%%.py | ||
| </ | </ | ||
| 行 39: | 行 39: | ||
| ^django_project ディレクトリ^^^^^^ | ^django_project ディレクトリ^^^^^^ | ||
| | + ^django_app ディレクトリ^^^^^ | | + ^django_app ディレクトリ^^^^^ | ||
| - | |%%|%%| + |models ディレクトリ|||Django アプリのモデル定義パッケージ。 | + | |%%|%%| + ^models ディレクトリ |
| |%%|%%|%%|%%| + |%%__init__%%.py | |%%|%%|%%|%%| + |%%__init__%%.py | ||
| |%%|%%|%%|%%| + |media.py | |%%|%%|%%|%%| + |media.py | ||
| 行 74: | 行 74: | ||
| # メタ情報 | # メタ情報 | ||
| class Meta: | class Meta: | ||
| - | app_label = 'django_vlc_app' | + | app_label = 'django_app' |
| verbose_name = _(' | verbose_name = _(' | ||
| verbose_name_plural = _(' | verbose_name_plural = _(' | ||
| - | db_table = 'ide_mime_type' | + | db_table = 'vlc_media' |
| ordering = (' | ordering = (' | ||
| - | unique_together = ((' | + | unique_together = ((' |
| </ | </ | ||
| </ | </ | ||
| 行 125: | 行 125: | ||
| </ | </ | ||
| - | Python のパッケージ内参照を利用して、パッケージ内の **media** モジュールから **import** するように記述する。\\ | + | Python のパッケージ内参照 |
| <WRAP prewrap 100% # | <WRAP prewrap 100% # | ||
| <code python django_app/ | <code python django_app/ | ||