{"id":3624,"date":"2021-07-27T11:53:53","date_gmt":"2021-07-27T11:53:53","guid":{"rendered":"https:\/\/www.bearloga.space\/?page_id=3624"},"modified":"2021-07-27T11:53:54","modified_gmt":"2021-07-27T11:53:54","slug":"dzhango-modeli","status":"publish","type":"page","link":"https:\/\/www.bearloga.space\/en\/dzhango-modeli\/","title":{"rendered":"\u0414\u0436\u0430\u043d\u0433\u043e \u2014 \u041c\u043e\u0434\u0435\u043b\u0438"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u041c\u043e\u0434\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0432 \u043d\u0430\u0448\u0435\u0439 \u0411\u0414, \u0438 \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.&nbsp;\u041c\u043e\u0434\u0435\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 app \/ models.py (\u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435: myapp \/ models.py)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0438<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043c\u043e\u0434\u0435\u043b\u044c Dreamreal, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0430\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from django.db import models\n\nclass Dreamreal(models.Model):\n\n   website = models.CharField(max_length = 50)\n   mail = models.CharField(max_length = 50)\n   name = models.CharField(max_length = 50)\n   phonenumber = models.IntegerField()\n\n   class Meta:\n      db_table = \"dreamreal\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u0430\u0436\u0434\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442 django.db.models.Model.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441 \u0438\u043c\u0435\u0435\u0442 4 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 (3 CharField \u0438 1 Integer), \u044d\u0442\u043e \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043b\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041c\u0435\u0442\u0430-\u043a\u043b\u0430\u0441\u0441 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c db_table \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.&nbsp;Django \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438: myapp_modelName.&nbsp;\u042d\u0442\u043e\u0442 \u043a\u043b\u0430\u0441\u0441 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043c \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c \u0438\u043c\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412 django.db.models \u0435\u0441\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0442\u0438\u043f\u043e\u0432 \u043f\u043e\u043b\u0435\u0439, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043d\u0430&nbsp;<a target=\"_blank\" rel=\"noreferrer noopener\" href=\"https:\/\/translate.googleusercontent.com\/translate_c?depth=1&amp;rurl=translate.google.ru&amp;sl=en&amp;sp=nmt4&amp;tl=ru&amp;u=https:\/\/docs.djangoproject.com\/en\/1.5\/ref\/models\/fields\/&amp;xid=17259,15700022,15700186,15700190,15700256,15700259,15700262&amp;usg=ALkJrhiZZcjmS_sm7yZaEh5n3wJxMyvm8w#field-types\">https:\/\/docs.djangoproject.com\/en\/1.5\/ref\/models\/fields\/#field-types<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Django \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$python manage.py syncdb\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u041c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 (CRUD)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u00abcrudops\u00bb, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 CRUD \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044f\u0445.&nbsp;\u041d\u0430\u0448 myapp \/ views.py \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u043a\u0430\u043a \u2014<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>MyApp \/ views.py<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from myapp.models import Dreamreal\nfrom django.http import HttpResponse\n\ndef crudops(request):\n   #Creating an entry\n   \n   dreamreal = Dreamreal(\n      website = \"www.polo.com\", mail = \"sorex@polo.com\", \n      name = \"sorex\", phonenumber = \"002376970\"\n   )\n   \n   dreamreal.save()\n   \n   #Read ALL entries\n   objects = Dreamreal.objects.all()\n   res ='Printing all Dreamreal entries in the DB : &lt;br&gt;'\n   \n   for elt in objects:\n      res += elt.name+\"&lt;br&gt;\"\n   \n   #Read a specific entry:\n   sorex = Dreamreal.objects.get(name = \"sorex\")\n   res += 'Printing One entry &lt;br&gt;'\n   res += sorex.name\n   \n   #Delete an entry\n   res += '&lt;br&gt; Deleting an entry &lt;br&gt;'\n   sorex.delete()\n   \n   #Update\n   dreamreal = Dreamreal(\n      website = \"www.polo.com\", mail = \"sorex@polo.com\", \n      name = \"sorex\", phonenumber = \"002376970\"\n   )\n   \n   dreamreal.save()\n   res += 'Updating entry&lt;br&gt;'\n   \n   dreamreal = Dreamreal.objects.get(name = 'sorex')\n   dreamreal.name = 'thierry'\n   dreamreal.save()\n   \n   return HttpResponse(res)<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u0414\u0440\u0443\u0433\u043e\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u043c\u043e\u0434\u0435\u043b\u044f\u0445.&nbsp;\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 CRUD \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441 \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u043c \u043d\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u00abdatamanipulation\u00bb \u0432\u00a0<strong>myapp \/ views.py<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from myapp.models import Dreamreal\nfrom django.http import HttpResponse\n\ndef datamanipulation(request):\n   res = ''\n   \n   #Filtering data:\n   qs = Dreamreal.objects.filter(name = \"paul\")\n   res += \"Found : %s results&lt;br&gt;\"%len(qs)\n   \n   #Ordering results\n   qs = Dreamreal.objects.order_by(\"name\")\n   \n   for elt in qs:\n      res += elt.name + '&lt;br&gt;'\n   \n   return HttpResponse(res)<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u0421\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Django ORM \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 3 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u2014<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0437\u0434\u0435\u0441\u044c, \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u00ab\u043e\u0434\u0438\u043d \u043a\u043e \u043c\u043d\u043e\u0433\u0438\u043c\u00bb.&nbsp;\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u044b\u0448\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u044f Dreamreal \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043d\u043b\u0430\u0439\u043d-\u0441\u0430\u0439\u0442\u043e\u0432.&nbsp;\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e django.db.models.ForeignKey \u2014<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>MyApp \/ models.py<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">from django.db import models\n\nclass Dreamreal(models.Model):\n   website = models.CharField(max_length = 50)\n   mail = models.CharField(max_length = 50)\n   name = models.CharField(max_length = 50)\n   phonenumber = models.IntegerField()\n   online = models.ForeignKey('Online', default = 1)\n   \n   class Meta:\n      db_table = \"dreamreal\"\n\nclass Online(models.Model):\n      domain = models.CharField(max_length = 30)\n   \n   class Meta:\n      db_table = \"online\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041a\u0430\u043a \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c myapp \/ models.py, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043e\u043d\u043b\u0430\u0439\u043d-\u043c\u043e\u0434\u0435\u043b\u044c \u0438 \u0441\u0432\u044f\u0437\u0430\u043b\u0438 \u0435\u0435 \u0441 \u043d\u0430\u0448\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e Dreamreal.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0443 manage.py \u2014<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0439 (\u0437\u0430\u043f\u0438\u0441\u0438 Dreamreal) \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043d\u0430\u0448\u0435\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0435 Django \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$python manage.py shell\n\n&gt;&gt;&gt; from myapp.models import Dreamreal, Online\n&gt;&gt;&gt; dr1 = Dreamreal()\n&gt;&gt;&gt; dr1.website = 'company1.com'\n&gt;&gt;&gt; dr1.name = 'company1'\n&gt;&gt;&gt; dr1.mail = 'contact@company1'\n&gt;&gt;&gt; dr1.phonenumber = '12345'\n&gt;&gt;&gt; dr1.save()\n&gt;&gt;&gt; dr2 = Dreamreal()\n&gt;&gt;&gt; dr1.website = 'company2.com'\n&gt;&gt;&gt; dr2.website = 'company2.com'\n&gt;&gt;&gt; dr2.name = 'company2'\n&gt;&gt;&gt; dr2.mail = 'contact@company2'\n&gt;&gt;&gt; dr2.phonenumber = '56789'\n&gt;&gt;&gt; dr2.save()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u0435 \u0434\u043e\u043c\u0435\u043d\u044b \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&gt;&gt;&gt; on1 = Online()\n&gt;&gt;&gt; on1.company = dr1\n&gt;&gt;&gt; on1.domain = \"site1.com\"\n&gt;&gt;&gt; on2 = Online()\n&gt;&gt;&gt; on2.company = dr1\n&gt;&gt;&gt; on2.domain = \"site2.com\"\n&gt;&gt;&gt; on3 = Online()\n&gt;&gt;&gt; on3.domain = \"site3.com\"\n&gt;&gt;&gt; dr2 = Dreamreal.objects.all()[2]\n&gt;&gt;&gt; on3.company = dr2\n&gt;&gt;&gt; on1.save()\n&gt;&gt;&gt; on2.save()\n&gt;&gt;&gt; on3.save()<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 (Dreamreal entry) \u0438\u0437 \u043e\u043d\u043b\u0430\u0439\u043d-\u0434\u043e\u043c\u0435\u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&gt;&gt;&gt; on1.company.name\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418 \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u043d\u0430\u0442\u044c \u0432\u0435\u0441\u044c \u043e\u043d\u043b\u0430\u0439\u043d-\u0434\u043e\u043c\u0435\u043d, \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0435\u0439 \u0432 Dreamreal, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&gt;&gt;&gt; dr1.online_set.all()\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c QuerySet, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043c\u0430\u043d\u0438\u043f\u0443\u043b\u044f\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 (filter, all, exclude, order_by \u2026.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0434\u043b\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043e\u043d\u043b\u0430\u0439\u043d-\u0434\u043e\u043c\u0435\u043d\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u044f Dreamreal \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u00abcompany\u00bb \u2014<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&gt;&gt;&gt; Online.objects.filter(company__name__contains = 'company'\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435.<\/strong>&nbsp;\u042d\u0442\u043e\u0442 \u0442\u0438\u043f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 SQL.&nbsp;\u042d\u0442\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0411\u0414, \u0433\u0434\u0435 \u043d\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u00ab_\u00bb.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u041d\u043e \u044d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438, \u0443 \u0432\u0430\u0441 \u0442\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c OneToOneField, \u0441\u0441\u044b\u043b\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u0441\u0432\u044f\u0437\u044c \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430\u043c\u0438 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u0430.&nbsp;\u0415\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 OneToOneField \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432\u044b\u0448\u0435, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u043b\u043e \u0431\u044b, \u0447\u0442\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 Dreamreal \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0437\u0430\u043f\u0438\u0441\u044c Online, \u0430 \u0434\u0440\u0443\u0433\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c -.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0418 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, ManyToManyField \u0434\u043b\u044f (nn) \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438.&nbsp;\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u043e\u043d\u0438 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b \u0434\u043b\u044f \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 SQL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041c\u043e\u0434\u0435\u043b\u044c \u2014 \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0438\u043b\u0438 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044e \u0432 \u043d\u0430\u0448\u0435\u0439 \u0411\u0414, \u0438 \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u043a\u043b\u0430\u0441\u0441\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[118],"tags":[],"class_list":["post-3624","page","type-page","status-publish","hentry","category-dzhango"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages\/3624","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/comments?post=3624"}],"version-history":[{"count":0,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/pages\/3624\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/media?parent=3624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/categories?post=3624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bearloga.space\/en\/wp-json\/wp\/v2\/tags?post=3624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}