diff --git a/analyze/df/generate_backend.go b/analyze/df/generate_backend.go index 6d013f3..51d8a39 100644 --- a/analyze/df/generate_backend.go +++ b/analyze/df/generate_backend.go @@ -511,7 +511,7 @@ func (obj Object) RelatedToMountain() string { func (obj Object) Related(relation string, regex *regexp.Regexp, init string) string { var list []string for n, f := range obj.Fields { - if f.Type == "int" && !f.SameField(obj) && (relation == f.Related || regex.MatchString(n)) { + if f.Type == "int" && !f.SameField(obj) && (relation == f.Related || (f.Related == "" && regex.MatchString(n))) { if !f.Multiple { list = append(list, fmt.Sprintf("x.%s == id", f.Name)) } else { diff --git a/analyze/overwrites.json b/analyze/overwrites.json index e83ea45..304cb99 100644 --- a/analyze/overwrites.json +++ b/analyze/overwrites.json @@ -9,7 +9,8 @@ "HistoricalEventMusicalFormCreated.FormId": "musicalForm", "HistoricalEventPoeticFormCreated.FormId": "poeticForm", "HistoricalEventHfReachSummit.MountainPeakId": "mountain", - "HistoricalEventBuildingProfileAcquired.StructureId": "structure" + "HistoricalEventBuildingProfileAcquired.StructureId": "structure", + "HistoricalEventHfPreach.SiteHfid": "site" }, "AdditionalFields": { "DfWorld": [ diff --git a/backend/model/model.go b/backend/model/model.go index 7e8402d..fa832d6 100644 --- a/backend/model/model.go +++ b/backend/model/model.go @@ -11373,11 +11373,11 @@ func (s HistoricalEventHfPreachTopic) MarshalJSON() ([]byte, error) { } type HistoricalEventHfPreach struct { - Entity1 int `json:"entity1" legend:"base" related:""` // entity_1 - Entity2 int `json:"entity2" legend:"base" related:""` // entity_2 - SiteHfid int `json:"siteHfid" legend:"base" related:""` // site_hfid - SpeakerHfid int `json:"speakerHfid" legend:"base" related:""` // speaker_hfid - Topic HistoricalEventHfPreachTopic `json:"topic" legend:"base" related:""` // topic + Entity1 int `json:"entity1" legend:"base" related:""` // entity_1 + Entity2 int `json:"entity2" legend:"base" related:""` // entity_2 + SiteHfid int `json:"siteHfid" legend:"base" related:"site"` // site_hfid + SpeakerHfid int `json:"speakerHfid" legend:"base" related:""` // speaker_hfid + Topic HistoricalEventHfPreachTopic `json:"topic" legend:"base" related:""` // topic } func NewHistoricalEventHfPreach() *HistoricalEventHfPreach { @@ -11392,11 +11392,9 @@ func (x *HistoricalEventHfPreach) Type() string { return "hf preach" } func (x *HistoricalEventHfPreach) RelatedToEntity(id int) bool { return x.Entity1 == id || x.Entity2 == id } -func (x *HistoricalEventHfPreach) RelatedToHf(id int) bool { - return x.SiteHfid == id || x.SpeakerHfid == id -} +func (x *HistoricalEventHfPreach) RelatedToHf(id int) bool { return x.SpeakerHfid == id } func (x *HistoricalEventHfPreach) RelatedToArtifact(id int) bool { return false } -func (x *HistoricalEventHfPreach) RelatedToSite(id int) bool { return false } +func (x *HistoricalEventHfPreach) RelatedToSite(id int) bool { return x.SiteHfid == id } func (x *HistoricalEventHfPreach) RelatedToStructure(siteId, id int) bool { return false } func (x *HistoricalEventHfPreach) RelatedToRegion(id int) bool { return false } func (x *HistoricalEventHfPreach) RelatedToWorldConstruction(id int) bool { return false }