mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-13 07:29:39 +00:00
Citadel: Use better repr in id mapping model
This commit is contained in:
parent
750483bdd2
commit
fea862cc3a
@ -13,6 +13,7 @@ from indico.modules.events.contributions import Contribution
|
||||
from indico.modules.events.contributions.models.subcontributions import SubContribution
|
||||
from indico.modules.events.notes.models.notes import EventNote
|
||||
from indico.util.enum import IndicoEnum
|
||||
from indico.util.string import format_repr
|
||||
|
||||
|
||||
class EntryType(int, IndicoEnum):
|
||||
@ -173,6 +174,10 @@ class CitadelIdMap(db.Model):
|
||||
)
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return format_repr(self, 'id', 'entry_type', event_id=None, contrib_id=None, subcontrib_id=None,
|
||||
attachment_id=None, note_id=None, attachment_file_id=None, _repr=self.citadel_id)
|
||||
|
||||
@classmethod
|
||||
def get_citadel_id(cls, obj_type, obj_id):
|
||||
"""Get the citadel_id for a given object type and id.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user