Skip to content

Instantly share code, notes, and snippets.

@jerzyk
Created May 18, 2017 12:49
Show Gist options
  • Save jerzyk/1b914f9bbcb384ed90c27eb70dc3ba86 to your computer and use it in GitHub Desktop.
Save jerzyk/1b914f9bbcb384ed90c27eb70dc3ba86 to your computer and use it in GitHub Desktop.
from django.db import models
class Company(models.Model):
nip = models.CharField(max_length=30, blank=True, null=True, unique=True)
In [1]: from first.models import Company
In [2]: Company().save()
In [3]: Company().save()
In [4]: Company().save()
In [5]: Company.objects.values()
Out[5]: <QuerySet [{'nip': None, u'id': 1}, {'nip': None, u'id': 2}, {'nip': None, u'id': 3}]>
@ad-m
Copy link

ad-m commented May 18, 2017

Masz rację.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment