Model create using dictionary in django
<p>In Django is it possible to create through dictionary similar as to filtering?</p>

<p>Here is my models.py:</p>

<pre><code>class Personnels(models.Model):
    name = models.CharField(max_length=100)
</code></pre>

<p>Here is my views.py:</p>

<pre><code>from . models import *

def artists(request):
    personnels = Personnels.objects.all()

    if request.method == "POST":
            data = {"name": "Dean Armada"}
            Personnels.objects.create(data)
</code></pre>

<p>However the code above will throw an error. What I really am trying to do is to do a create function coming from a "request.POST" but my views above serves as a simple example on doing it</p>

<p>Simply unwrap the dictionary within <code>create</code> function like:</p>

<pre><code>Personnels.objects.create(**data)
</code></pre>

python django