示例#1
0
文件: package.py 项目: go38/exedjango
 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
示例#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
示例#3
0
文件: package.py 项目: TUM-MZ/creyoco
    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
示例#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