// SetRelationModel implements mapping.SingleRelationer interface.
SetRelationModel implements mapping.SingleRelationer interface.
// SetRelationModel implements mapping . SingleRelationer interface .
func (b *Blog) SetRelationModel(relation *mapping.StructField, model mapping.Model) error {
	switch relation.Index[0] {
	case 4: 
		if model == nil {
			b.TopPost = nil
			return nil
		} else if topPost, ok := model.(*Post); ok {
			b.TopPost = topPost
			return nil
		}
		return errors.Wrapf(mapping.ErrInvalidRelationValue, "provided invalid model value: '%T' for relation TopPost", model)
	default:
		return errors.Wrapf(mapping.ErrInvalidRelationField, "provided invalid relation: '%s' for model: '%T'", relation, b)
	}
}
func ( b * Blog ) SetRelationModel ( relation * mapping . StructField , model mapping . Model ) error { switch relation . Index [ 0 ] { case 4 : if model == nil { b . TopPost = nil return nil } else if topPost , ok := model . ( * Post ) ; ok { b . TopPost = topPost return nil } return errors . Wrapf ( mapping . ErrInvalidRelationValue , " " , model ) default : return errors . Wrapf ( mapping . ErrInvalidRelationField , " " , relation , b ) } }
SetRelationModel implements mapping.SingleRelationer interface.
SetRelationModel implements mapping . SingleRelationer interface .
// TopPost