Exemplo n.º 1
0
 def create(self, *args, **kwargs):
     package = Package(*args, **kwargs)
     dublincore = DublinCore.objects.create()
     package.dublincore = dublincore
     package.save()
     root = Node(package=package, parent=None,
                 title="Home", is_root=True)
     root.save()
     return package
Exemplo n.º 2
0
    def create(self, *args, **kwargs):
        package = Package(*args, **kwargs)
        dublincore = DublinCore.objects.create()
        package.dublincore = dublincore
        package.save()
        root = Node(package=package,
                    parent=None,
                    title="Home",
                    is_current_node=True,
                    is_root=True)
        root.save()

        return package
Exemplo n.º 3
0
    def create(self, *args, **kwargs):
        package = Package(*args, **kwargs)
        dublincore = DublinCore.objects.create()
        package.dublincore = dublincore
        package.save()

        user = kwargs['user']
        order = PackageOrder.objects.filter(user=user).aggregate(Max('sort_order'))['sort_order__max']
        if order is None:
            order = 0
        else:
            order += 1
        package_order = PackageOrder(package=package, user=user, sort_order=order)
        package_order.save()
        root = Node(package=package, parent=None,
                    title="Home", is_root=True)
        root.save()
        return package
Exemplo n.º 4
0
    def create(self, *args, **kwargs):
        package = Package(*args, **kwargs)
        dublincore = DublinCore.objects.create()
        package.dublincore = dublincore
        package.save()

        user = kwargs['user']
        order = PackageOrder.objects.filter(user=user).aggregate(
            Max('sort_order'))['sort_order__max']
        if order is None:
            order = 0
        else:
            order += 1
        package_order = PackageOrder(package=package,
                                     user=user,
                                     sort_order=order)
        package_order.save()
        root = Node(package=package, parent=None, title="Home", is_root=True)
        root.save()
        return package