semvec/pypi-packages huggingface dataset:
djraphql 0.2.18
DjraphQL builds a flexible & performant GraphQL schema by examining your Django models.
Requires Python: >=3.7

# DjraphQL

Check out the [documentation](https://radico.github.io/djraphql)!

## What

DjraphQL ("GiraffeQL") is a library that examines your Django models and builds a flexible, performant GraphQL schema using [Graphene](https://docs.graphene-python.org/en/latest/). No resolvers necessary.

You can of course extend this schema, reference the defined types and build custom business logic into your own resolvers. The goal is to remove the monotonous 90% of boilerplate generalized C.R.U.D. and allow you to focus on stuff that can't be auto-generated.

## How

You provide a list of Django models and some associated metadata. For example, you can define the QuerySet that will be used for each fetch of a certain model type (you have access to the Django request object in the definition lambda for the QuerySet). By providing a QuerySet that is already filtered by e.g., user account, the library will use that QuerySet in the resolvers it generates. The requirement that you must _remember_ to filter by account is all but eliminated.

It builds each relationship into the schema, so you can traverse from `Label` to `Artist` to `Album` to `Song` in a single query (both in the result-set and via filtering), still retrieving only the data you need.

You can specify arbitrarily complex SQL statements: the schema allows specifying filtering via `where`, `orderBy`, `offset`, `limit`, or `distinct`.

It allows smooth (nested, if you're bold enough!) updates & inserts.

Perhaps best of all, it automatically generates `select_related` and `prefetch_related` calls to your QuerySet. This avoids the classic GraphQL N+1 problem usually solved by things like [dataloader](https://docs.graphene-python.org/en/latest/execution/dataloader/). Additionally, it fetches _only_ the columns necessary to satisfy the query. No over fetching!

A hand-rolled schema providing all of this for a single model would be hundreds of lines of code. Multiply that by a realistic, mature application with a hundred or more models, and you have an unmaintainable mess. This library auto-generates it for you, leaving the fun stuff for you.

## Contributing

See `CONTRIBUTING.md`.
django-simple-form 0.0.2
Django-simple-form is a simple way to build your forms in HTML-level
Keywords: django,widget,form,field

==================
django-simple-form
==================

Django-simple-form is a simple way to build your forms in HTML-level.


Installation
~~~~~~~~~~~~

You can get Django simple form by using pip::

    $ pip install django-simple-form


To enable the package you need to add it to `INSTALLED_APPS`::

    INSTALLED_APPS = [
        ...
        'simple_form',
        ...
    ]


Usage
~~~~~

Render all fields form::

    {% load simple_form %}

    ...

    {{ form|render_form }}


Render field by field::

    {% load simple_form %}

    ...

    {{ form.name|render_field }}
    {{ form.email|render_field }}



Custom the template
~~~~~~~~~~~~~~~~~~~


Create a folder with name `simple_form` in your template dir::

    templates/
        ...
        simple_form/
            field.html
            ...

In HTML file you define the structure for each field the form::


    <div>
      <label for="{{ field.auto_id }}">
        {{ field.label }}
      </label>

      {{ field }}

      {% if field.errors %}
        {% for error in field.errors %}
          <span>{{ error }}</span>
        {% endfor %}
      {% endif %}
    </div>

    {% if field.help_text %}
      <p title="{{ field.help_text }}">
        {{ field.help_text }}
      </p>
    {% endif %}


If you need to customize the rendering for the type field, create an HTML file to the specific type of his widget::

    templates/
        ...
        simple_form/
            field.html
            checkboxinput.html
            ...
DotIndex 1.1.0
Allows you to use dot notation to index dicts, like how you can in javascript
Requires Python: >=3.6

# DotIndex
Allows you to use dot notation to index dicts, like how you can in javascript

When printed, DotIndex objects are printed as a normal dict would be, however
the curly braces have a full stop before them, to signify that it is a
DotIndex object. (`.{}` would be an empty object)

## Code Examples
Basic usage:
```py
from DotIndex import DotIndex

x = {
  "foo": "bar"
}

y = DotIndex(x)

print(y) # Expected output: ".{'foo': 'bar'}"
print(y.foo) # Expected output: "bar"
print(y["foo"]) # Expected output: "bar"

y["cat"] = "dog"

print(y.cat) # Expected output: "dog"
```

Adding together objects:
```py
from DotIndex import DotIndex

x = DotIndex({
  "foo": "bar"
})

y = DotIndex({
  "cat": "dog"
})

# Adds all values in y to x
# Also works if you do `x = x + y`
x += y

print(x) # Expected output: ".{'cat': 'dog', 'foo': 'bar'}"

# Adding a DotIndex and a dict
z = x + {
  "dicts": True
}

print(z) # Expected output: ".{'cat': 'dog', 'dicts': True, 'foo': 'bar'}"

# The second value overwrites any duplicate keys from the original object
z += {
  "cat": "not dog"
}

print(z) # Expected output: ".{'cat': 'not dog', 'dicts': True, 'foo': 'bar'}"

```

## Documentation
Creating the object
- Parameters
  - obj (`dict[str, Any]`) - the dict object that should be turned into a DotIndex object
  - recursive (`bool`, default: True) - whether or not to DotIndex-ify any dicts inside the original object
  - verbose_logs (`bool`, default: False) - whether or not to print out extra logs
  - ignore_errors (`bool`, default: False) - whether or not to ignore non-critical errors
- Other information:
  - Keys in `obj` must be strings, any other types will throw a `TypeError` (ignored with `ignore_errors`)
  - Keys in `obj` cannot start with two underscores (`"__"`) as those could be used to overwrite preexisting instance variables used for the class itself
  - If `recursive` is true, the values of `verbose_logs` and `ignore_errors` will be passed through into any new DotIndex objects created

Converting types
- `iter(...)` - Returns all keys in alphabetical order
- `str(...)` - Returns a string formatted like the `str(...)` value of a dict object, with a full stop (`"."`) at the start to show that it is a DotIndex type. Example: `".{'foo': 'bar'}"`
- `repr(...)` - Same as `str(...)`
- `int(...)` - Returns the amount of keys in the object
- `float(...)` - Same as `int(...)` except as a float type
- `bool(...)` - Returns `True` if there are any keys in the object, and if there aren't it returns `False`

Comparisons
- `==` - Checks if the two objects have all the values the same. Works with both DotIndex objects and dict objects
- `!=` - Opposite of `==`
- `>`, `<`, `>=`, `<=` - Compares the amount of keys in the object

Misc.
- `+` - Takes the keys from the object on the right and adds them to the object on the left, overwriting any duplicates
- `len(...)` - Returns the amount of keys in the object
- `'val' in ...` - Returns true if `"val"` is a key in the object