@permission_required("core.manage_shop")
def add_property_group(request, template_name="manage/property_groups/add_property_group.html"):
    if request.method == "POST":
        form = PropertyGroupForm(data=request.POST)
        if form.is_valid():
            property_group = form.save()
            return lfs.core.utils.set_message_cookie(
                url=reverse("lfs_manage_property_group", kwargs={"id": property_group.id}),
                msg=_(u"Property group has been added."),
            )
    else:
        form = PropertyGroupForm()

    return render_to_response(template_name, RequestContext(request, {
        "form": form,
        "property_groups": PropertyGroup.objects.all(),
        "came_from": (request.POST if request.method == 'POST' else request.GET).get("came_from",
                                                                                     reverse("lfs_manage_property_groups")),
    }))
Adds a new property group
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/property_groups/views.py/add_property_group