2 from django.db import models
3 from core.models import PlCoreBase
4 from core.models import Site,Deployment
5 from core.models import Tag
6 from django.contrib.contenttypes import generic
8 # Create your models here.
10 class Node(PlCoreBase):
11 name = models.CharField(max_length=200, unique=True, help_text="Name of the Node")
12 site = models.ForeignKey(Site, related_name='nodes')
13 deployment = models.ForeignKey(Deployment, related_name='nodes')
14 tags = generic.GenericRelation(Tag)
16 def __unicode__(self): return u'%s' % (self.name)
19 def select_by_user(user):
20 qs = Node.objects.all()