Skip to content

Commit

Permalink
Via property the directory id with type uuid can now be indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tschuppi81 committed Sep 13, 2023
1 parent 21e87ff commit c81a188
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/onegov/directory/models/directory_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def es_public(self):
name = Column(Text, nullable=False)

#: The directory this entry belongs to
directory_id: 'Column[UUID]' = Column(
ForeignKey('directories.id'), nullable=False)
_directory_id: 'Column[UUID]' = Column(
ForeignKey('directories.id'), name='directory_id', nullable=False)

#: the polymorphic type of the entry
type = Column(Text, nullable=False, default=lambda: 'generic')
Expand Down Expand Up @@ -74,6 +74,10 @@ def es_public(self):
Index('unique_entry_name', 'directory_id', 'name', unique=True),
)

@property
def directory_id(self):
return self.directory_id

@property
def external_link(self):
return self.directory.configuration.extract_link(self.values)
Expand Down

0 comments on commit c81a188

Please sign in to comment.