Created
May 18, 2017 12:49
-
-
Save jerzyk/1b914f9bbcb384ed90c27eb70dc3ba86 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Company(models.Model): | |
nip = models.CharField(max_length=30, blank=True, null=True, unique=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}]> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Masz rację.