Entity_Federations.__unicode__()   A
last analyzed

Complexity

Conditions 2

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 2
1
#################################################################
2
# MET v2 Metadate Explorer Tool
3
#
4
# This Software is Open Source. See License: https://github.com/TERENA/met/blob/master/LICENSE.md
5
# Copyright (c) 2012, TERENA All rights reserved.
6
#
7
# This Software is based on MET v1 developed for TERENA by Yaco Sistemas, http://www.yaco.es/
8
# MET v2 was developed for TERENA by Tamim Ziai, DAASI International GmbH, http://www.daasi.de
9
# Current version of MET has been revised for performance improvements by Andrea Biancini,
10
# Consortium GARR, http://www.garr.it
11
##########################################################################
12
13
from django.db import models
14
from django.utils.translation import ugettext_lazy as _
15
16
17
class Entity_Federations(models.Model):
18
    """
19
    Description of the relationship between entities and federations.
20
    """
21
22
    entity = models.ForeignKey('Entity')
23
24
    federation = models.ForeignKey('Federation')
25
26
    registration_instant = models.DateField(blank=True, null=True,
27
                                            verbose_name=_(u'Registration Instant'))
28
29
    entity_categories = models.ManyToManyField('EntityCategory',
30
                                               verbose_name=_(u'Entity categories'))
31
32
    def __unicode__(self):
33
        cats = [ c.name for c in self.entity_categories.all() ]
34
        return "%s in federation %s %s" % (self.entity.entityid, self.federation.slug, cats)
35