Пример #1
0
class ConcreteEdge(edge_factory('ConcreteNode', concrete=False)):
    """
    Test edge, adds just one field
    """
    name = CharField(max_length=32, blank=True, null=True)

    class Meta:
        app_label = 'django_dag'
Пример #2
0
class TaskEdge(edge_factory(TaskNode, concrete=False)):
    name = models.CharField(max_length=100, blank=True, null=True)
    graph = models.ForeignKey('DiGraph',
                              null=True,
                              blank=True,
                              on_delete=models.CASCADE)

    class Meta:
        verbose_name_plural = 'Dependencies'

    def save(self, *args, **kwargs):
        super(TaskEdge, self).save()
        self.graph = self.parent.graph
        super(TaskEdge, self).save()
Пример #3
0
class SectionRelation(edge_factory(Section, concrete=False)):
    """Through class for parent/child relationships between sections"""
    weight = models.IntegerField(default=0)

    def __unicode__(self):
        return u"%s is child of %s" % (self.child, self.parent)
Пример #4
0
class PlaceRelation(edge_factory(Place, concrete=False)):
    class Meta:
        unique_together = (("parent", "child"), )
Пример #5
0
class AnalysisEdge(edge_factory(AnalysisNode, concrete=False)):
    pass