3.2.1 Models
둘러보기
- Quick example
- Using models
- Fields
- Meta options
- Model attributes
- Model methods
- Organizing models in a package
- Model inheritance
세부목차
- Quick example
- Using models
- Fields
- Field types
- Field options
- Automatic primary key fields
- Verbose field names
- Relationships
- Many-to-one relationships
- Many-to-many relationships
- Extra fields on many-to-many relationships
- One-to-one relationships
- Models across files
- Field name restrictions
- Custom field types
- Meta options
- Model attributes
- Model methods
- Overriding predefined model methods
- Executing custom SQL
- Organizing models in a package
- Model inheritance
- Abstract base classes
- Meta inheritance
- Be careful with related_name and related_query_name
- Multi-table inheritance
- Meta and multi-table inheritance
- Inheritance and reverse relations
- Specifying the parent link field
- Proxy models
- QuerySets still return the model that was requested
- Base class restrictions
- Proxy model managers
- Differences between proxy inheritance and unmanaged models
- Multiple inheritance
- Field name "hiding" is not permitted
첫번째 이미지는 파이참에서 장고의 모델을 설정한 모습입니다.
두번째 이미지는 각 모델(class)이 데이터베이스에서 테이블에 연결(map)된 것을 보여줍니다.
(개인적 추측 : 앱 안에 있는 각각의 클래스(필드)들이 모델이기 때문에 이것들을 모아놓으면 models.py인 듯)