Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
fe533fc5
Kaydet (Commit)
fe533fc5
authored
Nis 22, 2015
tarafından
Richard Eames
Kaydeden (comit)
Tim Graham
Nis 22, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.8.x] Fixed #24613 -- Added example to QuerySet.defer() documentation
Backport of
dd99f577
from master
üst
322b9c90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
querysets.txt
docs/ref/models/querysets.txt
+24
-0
No files found.
docs/ref/models/querysets.txt
Dosyayı görüntüle @
fe533fc5
...
@@ -1379,6 +1379,30 @@ one, doing so will result in an error.
...
@@ -1379,6 +1379,30 @@ one, doing so will result in an error.
reader, is slightly faster and consumes a little less memory in the Python
reader, is slightly faster and consumes a little less memory in the Python
process.
process.
For example, both of these models use the same underlying database table::
class CommonlyUsedModel(models.Model):
f1 = models.CharField(max_length=10)
class Meta:
managed = False
db_table = 'app_largetable'
class ManagedModel(models.Model):
f1 = models.CharField(max_length=10)
f2 = models.CharField(max_length=10)
class Meta:
db_table = 'app_largetable'
# Two equivalent QuerySets:
CommonlyUsedModel.objects.all()
ManagedModel.objects.all().defer('f2')
If many fields need to be duplicated in the unmanaged model, it may be best
to create an abstract model with the shared fields and then have the
unmanaged and managed models inherit from the abstract model.
.. note::
.. note::
When calling :meth:`~django.db.models.Model.save()` for instances with
When calling :meth:`~django.db.models.Model.save()` for instances with
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment