- package models
- import "gorm.io/gorm"
- type Estudiante struct {
- gorm.Model
- Nombre string `gorm:"not null" json:"nombre"`
- ApellidoP string `gorm:"not null" json:"apellido_p"`
- ApellidoM string `gorm:"not null" json:"apellido_m"`
- Sexo string `gorm:"not null" json:"sexo"`
- FechaN string `gorm:"not null" json:"fecha_n"`
- CategoriaID uint `json:"categoria_id"` // Field to store
- Categoria Categoria `gorm:"foreignKey:CategoriaID"` // Relation with Attribute
- }
|