Re: Does anybody have a generic relation implementation
Ralf Schlatterbeck <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.roundup.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, May 08, 2019 at 09:50:41PM -0400, John P. Rouillard wrote:
> Consider an object called LinkRelation with the fields:
>
> type - link to relation_type
> issue - link to issue
> ticket - link to ticket
> url - string
[more description deleted]
> I have a feeling this simple implementation will not perform very
> well. It probably has other issues that I haven't thought of.
This depends on your use-cases and how you do the searching.
Roundup does support transitive properties for some time. So you can do
searches like
db.issue.filter(None, {'relationship.type': ..., ...}
This will automagically create a join in the generated sql query and
should perform equally well as a multilink does -- a multilink is
internally also implemented as an intermediate table with foreign keys
to both sides of the multilink (also resulting in a join in SQL when
multilinks are involved).
> Has anybody done something like this or thought about this generic
> relationship idea?
I like your concept.
Ralf
--
Dr. Ralf Schlatterbeck Tel: +43/2243/26465-16
Open Source Consulting www: http://www.runtux.com
Reichergasse 131, A-3411 Weidling email: [email protected]