func ToBasicJSON(gallery *models.Gallery) (*jsonschema.Gallery, error) {
	newGalleryJSON := jsonschema.Gallery{
		Checksum:  gallery.Checksum,
		Zip:       gallery.Zip,
		CreatedAt: json.JSONTime{Time: gallery.CreatedAt.Timestamp},
		UpdatedAt: json.JSONTime{Time: gallery.UpdatedAt.Timestamp},
	}

	if gallery.Path.Valid {
		newGalleryJSON.Path = gallery.Path.String
	}

	if gallery.FileModTime.Valid {
		newGalleryJSON.FileModTime = json.JSONTime{Time: gallery.FileModTime.Timestamp}
	}

	if gallery.Title.Valid {
		newGalleryJSON.Title = gallery.Title.String
	}

	if gallery.URL.Valid {
		newGalleryJSON.URL = gallery.URL.String
	}

	if gallery.Date.Valid {
		newGalleryJSON.Date = utils.GetYMDFromDatabaseDate(gallery.Date.String)
	}

	if gallery.Rating.Valid {
		newGalleryJSON.Rating = int(gallery.Rating.Int64)
	}

	newGalleryJSON.Organized = gallery.Organized

	if gallery.Details.Valid {
		newGalleryJSON.Details = gallery.Details.String
	}

	return &newGalleryJSON, nil
}
// ToBasicJSON converts a gallery object into its JSON object equivalent. It
// does not convert the relationships to other objects.
ToBasicJSON converts a gallery object into its JSON object equivalent. It
does not convert the relationships to other objects.
// ToBasicJSON converts a gallery object into its JSON object equivalent . It // does not convert the relationships to other objects .
func ToBasicJSON(gallery *models.Gallery) (*jsonschema.Gallery, error) {
	newGalleryJSON := jsonschema.Gallery{
		Checksum:  gallery.Checksum,
		Zip:       gallery.Zip,
		CreatedAt: json.JSONTime{Time: gallery.CreatedAt.Timestamp},
		UpdatedAt: json.JSONTime{Time: gallery.UpdatedAt.Timestamp},
	}
	if gallery.Path.Valid {
		newGalleryJSON.Path = gallery.Path.String
	}
	if gallery.FileModTime.Valid {
		newGalleryJSON.FileModTime = json.JSONTime{Time: gallery.FileModTime.Timestamp}
	}
	if gallery.Title.Valid {
		newGalleryJSON.Title = gallery.Title.String
	}
	if gallery.URL.Valid {
		newGalleryJSON.URL = gallery.URL.String
	}
	if gallery.Date.Valid {
		newGalleryJSON.Date = utils.GetYMDFromDatabaseDate(gallery.Date.String)
	}
	if gallery.Rating.Valid {
		newGalleryJSON.Rating = int(gallery.Rating.Int64)
	}
	newGalleryJSON.Organized = gallery.Organized
	if gallery.Details.Valid {
		newGalleryJSON.Details = gallery.Details.String
	}
	return &newGalleryJSON, nil
}
func ToBasicJSON ( gallery * models . Gallery ) ( * jsonschema . Gallery , error ) { newGalleryJSON := jsonschema . Gallery { Checksum : gallery . Checksum , Zip : gallery . Zip , CreatedAt : json . JSONTime { Time : gallery . CreatedAt . Timestamp } , UpdatedAt : json . JSONTime { Time : gallery . UpdatedAt . Timestamp } , } if gallery . Path . Valid { newGalleryJSON . Path = gallery . Path . String } if gallery . FileModTime . Valid { newGalleryJSON . FileModTime = json . JSONTime { Time : gallery . FileModTime . Timestamp } } if gallery . Title . Valid { newGalleryJSON . Title = gallery . Title . String } if gallery . URL . Valid { newGalleryJSON . URL = gallery . URL . String } if gallery . Date . Valid { newGalleryJSON . Date = utils . GetYMDFromDatabaseDate ( gallery . Date . String ) } if gallery . Rating . Valid { newGalleryJSON . Rating = int ( gallery . Rating . Int64 ) } newGalleryJSON . Organized = gallery . Organized if gallery . Details . Valid { newGalleryJSON . Details = gallery . Details . String } return & newGalleryJSON , nil }
ToBasicJSON converts a gallery object into its JSON object equivalent.
ToBasicJSON converts a gallery object into its JSON object equivalent .