semvec/pypi-packages huggingface dataset:
django-mp-shop-attrs 1.2
Django shop attributes apps
License: MIT

# MP-Shop | Attributes

## Installation

### Install using PIP:
```
pip install django-mp-shop-attrs
```

### Add attributes to settings.py:
```
INSTALLED_APPS = [
    ...
    'attributes',
]
```

### Add attributes to product admin:
```
from attributes.admin import ProductAdminMixin
from attributes.forms import ProductFormMixin

class ProductForm(ProductFormMixin, forms.ModelForm):
    ...

class ProductAdmin(ProductAdminMixin, ModelAdmin):

    form = ProductForm
    ...

```

## Usage

```
product = Product.objects.get(...)

for attr_val in product.attr_values.visible():
    
    print(attr_val.attr.name)
    print(attr_val.value)
    
    attr_val.value = 'example'
    attr_val.save()
```

## Custom product models

```
from django.apps import AppConfig

from attributes import AttributesAppConfig


class CustomAttributesAppConfig(AttributesAppConfig):

    product_model = 'custom_app.CustomProductModel'
    product_category_model = 'custom_app.CustomProductCategoryModel'
```

settings.py
```
INSTALLED_APPS = [
    ...
    'CustomAttributesAppConfig',
]
```

### App requires this packages:
* django
* awesome-slugify

### App compatible with:
* django-modeltranslation
* django-mptt
* django-suit

### Screenshots
Attributes list
![Attrs list](https://user-images.githubusercontent.com/4138122/41437785-1867b074-702e-11e8-940f-504cae19ca22.png)

Attribute change
![Attr change](https://user-images.githubusercontent.com/4138122/41437857-444bd580-702e-11e8-9340-72c301582695.png)
defectdojo_api 1.1.4
An API wrapper for DefectDojo.
License: MIT
Keywords: dojo,api,security,software

DefectDojo API
==============

A Python API wrapper for `DefectDojo <https://github.com/OWASP/django-DefectDojo>`_, an AppSec and Security Vulnerability Management tool.

This package implements API functionality available within Dojo.

Quick Start
-----------

Several quick start options are available:

- Install with pip (recommended): :code:`pip install defectdojo_api`
- `Download the latest release <https://github.com/aaronweaver/defectdojo_api/releases/latest>`_
- Clone the repository: :code:`git clone https://github.com/aaronweaver/defectdojo_api`
- If you are testing the api locally make sure to set the PYTHONPATH. export PYTHONPATH=/path/totheapi/defectdojo_api:$PYTHONPATH

Example
-------

.. code-block:: python

    # import the package
    from defectdojo_api import defectdojo

    # setup DefectDojo connection information
    host = 'http://localhost:8000/'
    api_key = 'your_api_key_from_DefectDojo'
    user = 'admin'

    # instantiate the DefectDojo api wrapper
    dd = defectdojo.DefectDojoAPI(host, api_key, user, debug=False)

    # If you need to disable certificate verification, set verify_ssl to False.
    # dd = defectdojo.DefectDojoAPI(host, api_key, user, verify_ssl=False)

    # Create a product
    prod_type = 1 #1 - Research and Development, product type
    product = dd.create_product("API Product Test", "This is a detailed product description.", prod_type)

    if product.success:
        # Get the product id
        product_id = product.id()
        print "Product successfully created with an id: " + str(product_id)

    #List Products
    products = dd.list_products()

    if products.success:
        print(products.data_json(pretty=True))  # Decoded JSON object

        for product in products.data["objects"]:
            print(product['name'])  # Print the name of each product
    else:
        print products.message

More examples `available <https://github.com/aaronweaver/defectdojo_api/tree/master/examples>`_ on Github.

Supporting information for each method available can be found in the `documentation <https://defectdojo-api.readthedocs.io>`_.

Bugs and Feature Requests
-------------------------

Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, `please open a new issue <https://github.com/aaronweaver/defectdojo_api/issues/new>`_.

Copyright and License
---------------------

- `Licensed under MIT <https://github.com/aaronweaver/defectdojo_api/blob/master/LICENSE.txt>`_.