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
b87c59b0
Kaydet (Commit)
b87c59b0
authored
Ock 17, 2014
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed some unnecessary __exact operators in filters.
üst
298a2b57
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
17 additions
and
17 deletions
+17
-17
options.py
django/contrib/admin/options.py
+1
-1
log.py
django/contrib/admin/templatetags/log.py
+1
-1
generic.py
django/contrib/contenttypes/generic.py
+1
-1
views.py
django/contrib/flatpages/views.py
+2
-2
managers.py
django/contrib/sites/managers.py
+1
-1
sites.txt
docs/ref/contrib/sites.txt
+1
-1
default.txt
docs/topics/auth/default.txt
+1
-1
many_to_many.txt
docs/topics/db/examples/many_to_many.txt
+3
-3
many_to_one.txt
docs/topics/db/examples/many_to_one.txt
+3
-3
one_to_one.txt
docs/topics/db/examples/one_to_one.txt
+1
-1
queries.txt
docs/topics/db/queries.txt
+2
-2
No files found.
django/contrib/admin/options.py
Dosyayı görüntüle @
b87c59b0
...
...
@@ -1620,7 +1620,7 @@ class ModelAdmin(BaseModelAdmin):
app_label
=
opts
.
app_label
action_list
=
LogEntry
.
objects
.
filter
(
object_id
=
unquote
(
object_id
),
content_type
__id__exact
=
ContentType
.
objects
.
get_for_model
(
model
)
.
id
content_type
=
ContentType
.
objects
.
get_for_model
(
model
)
)
.
select_related
()
.
order_by
(
'action_time'
)
context
=
dict
(
self
.
admin_site
.
each_context
(),
...
...
django/contrib/admin/templatetags/log.py
Dosyayı görüntüle @
b87c59b0
...
...
@@ -18,7 +18,7 @@ class AdminLogNode(template.Node):
user_id
=
self
.
user
if
not
user_id
.
isdigit
():
user_id
=
context
[
self
.
user
]
.
pk
context
[
self
.
varname
]
=
LogEntry
.
objects
.
filter
(
user__pk
__exact
=
user_id
)
.
select_related
(
'content_type'
,
'user'
)[:
int
(
self
.
limit
)]
context
[
self
.
varname
]
=
LogEntry
.
objects
.
filter
(
user__pk
=
user_id
)
.
select_related
(
'content_type'
,
'user'
)[:
int
(
self
.
limit
)]
return
''
...
...
django/contrib/contenttypes/generic.py
Dosyayı görüntüle @
b87c59b0
...
...
@@ -324,7 +324,7 @@ def create_generic_related_manager(superclass):
self
.
pk_val
=
self
.
instance
.
_get_pk_val
()
self
.
core_filters
=
{
'
%
s__pk'
%
content_type_field_name
:
content_type
.
id
,
'
%
s
__exact
'
%
object_id_field_name
:
instance
.
_get_pk_val
(),
'
%
s'
%
object_id_field_name
:
instance
.
_get_pk_val
(),
}
def
__call__
(
self
,
**
kwargs
):
...
...
django/contrib/flatpages/views.py
Dosyayı görüntüle @
b87c59b0
...
...
@@ -35,12 +35,12 @@ def flatpage(request, url):
site_id
=
get_current_site
(
request
)
.
id
try
:
f
=
get_object_or_404
(
FlatPage
,
url
__exact
=
url
,
sites__id__exact
=
site_id
)
url
=
url
,
sites
=
site_id
)
except
Http404
:
if
not
url
.
endswith
(
'/'
)
and
settings
.
APPEND_SLASH
:
url
+=
'/'
f
=
get_object_or_404
(
FlatPage
,
url
__exact
=
url
,
sites__id__exact
=
site_id
)
url
=
url
,
sites
=
site_id
)
return
HttpResponsePermanentRedirect
(
'
%
s/'
%
request
.
path
)
else
:
raise
...
...
django/contrib/sites/managers.py
Dosyayı görüntüle @
b87c59b0
...
...
@@ -39,4 +39,4 @@ class CurrentSiteManager(models.Manager):
def
get_queryset
(
self
):
if
not
self
.
__is_validated
:
self
.
_validate_field_name
()
return
super
(
CurrentSiteManager
,
self
)
.
get_queryset
()
.
filter
(
**
{
self
.
__field_name
+
'__id
__exact
'
:
settings
.
SITE_ID
})
return
super
(
CurrentSiteManager
,
self
)
.
get_queryset
()
.
filter
(
**
{
self
.
__field_name
+
'__id'
:
settings
.
SITE_ID
})
docs/ref/contrib/sites.txt
Dosyayı görüntüle @
b87c59b0
...
...
@@ -84,7 +84,7 @@ This accomplishes several things quite nicely:
def article_detail(request, article_id):
try:
a = Article.objects.get(id=article_id, sites__id
__exact
=get_current_site(request).id)
a = Article.objects.get(id=article_id, sites__id=get_current_site(request).id)
except Article.DoesNotExist:
raise Http404
# ...
...
...
docs/topics/auth/default.txt
Dosyayı görüntüle @
b87c59b0
...
...
@@ -101,7 +101,7 @@ You can also change a password programmatically, using
.. code-block:: python
>>> from django.contrib.auth.models import User
>>> u = User.objects.get(username
__exact
='john')
>>> u = User.objects.get(username='john')
>>> u.set_password('new password')
>>> u.save()
...
...
docs/topics/db/examples/many_to_many.txt
Dosyayı görüntüle @
b87c59b0
...
...
@@ -111,7 +111,7 @@ Create and add a ``Publication`` to an ``Article`` in one step using
Many-to-many relationships can be queried using :ref:`lookups across
relationships <lookups-that-span-relationships>`::
>>> Article.objects.filter(publications__id
__exact
=1)
>>> Article.objects.filter(publications__id=1)
[<Article: Django lets you build Web apps easily>, <Article: NASA uses Python>]
>>> Article.objects.filter(publications__pk=1)
[<Article: Django lets you build Web apps easily>, <Article: NASA uses Python>]
...
...
@@ -143,7 +143,7 @@ The :meth:`~django.db.models.query.QuerySet.count` function respects
Reverse m2m queries are supported (i.e., starting at the table that doesn't have
a :class:`~django.db.models.ManyToManyField`)::
>>> Publication.objects.filter(id
__exact
=1)
>>> Publication.objects.filter(id=1)
[<Publication: The Python Journal>]
>>> Publication.objects.filter(pk=1)
[<Publication: The Python Journal>]
...
...
@@ -151,7 +151,7 @@ a :class:`~django.db.models.ManyToManyField`)::
>>> Publication.objects.filter(article__headline__startswith="NASA")
[<Publication: Highlights for Children>, <Publication: Science News>, <Publication: Science Weekly>, <Publication: The Python Journal>]
>>> Publication.objects.filter(article__id
__exact
=1)
>>> Publication.objects.filter(article__id=1)
[<Publication: The Python Journal>]
>>> Publication.objects.filter(article__pk=1)
[<Publication: The Python Journal>]
...
...
docs/topics/db/examples/many_to_one.txt
Dosyayı görüntüle @
b87c59b0
...
...
@@ -123,7 +123,7 @@ This works as many levels deep as you want. There's no limit. For example::
[<Article: This is a test>]
# Find all Articles for any Reporter whose first name is "John".
>>> Article.objects.filter(reporter__first_name
__exact
='John')
>>> Article.objects.filter(reporter__first_name='John')
[<Article: John's second story>, <Article: This is a test>]
Exact match is implied here::
...
...
@@ -134,7 +134,7 @@ Exact match is implied here::
Query twice over the related field. This translates to an AND condition in the
WHERE clause::
>>> Article.objects.filter(reporter__first_name
__exact='John', reporter__last_name__exact
='Smith')
>>> Article.objects.filter(reporter__first_name
='John', reporter__last_name
='Smith')
[<Article: John's second story>, <Article: This is a test>]
For the related lookup you can supply a primary key value or pass the related
...
...
@@ -184,7 +184,7 @@ Queries can go round in circles::
[<Reporter: John Smith>, <Reporter: John Smith>, <Reporter: John Smith>, <Reporter: John Smith>]
>>> Reporter.objects.filter(article__reporter__first_name__startswith='John').distinct()
[<Reporter: John Smith>]
>>> Reporter.objects.filter(article__reporter
__exact
=r).distinct()
>>> Reporter.objects.filter(article__reporter=r).distinct()
[<Reporter: John Smith>]
If you delete a reporter, his articles will be deleted (assuming that the
...
...
docs/topics/db/examples/one_to_one.txt
Dosyayı görüntüle @
b87c59b0
...
...
@@ -113,7 +113,7 @@ This of course works in reverse::
>>> Place.objects.get(pk=1)
<Place: Demon Dogs the place>
>>> Place.objects.get(restaurant__place
__exact
=p1)
>>> Place.objects.get(restaurant__place=p1)
<Place: Demon Dogs the place>
>>> Place.objects.get(restaurant=r)
<Place: Demon Dogs the place>
...
...
docs/topics/db/queries.txt
Dosyayı görüntüle @
b87c59b0
...
...
@@ -411,7 +411,7 @@ can specify the field name suffixed with ``_id``. In this case, the value
parameter is expected to contain the raw value of the foreign model's primary
key. For example:
>>> Entry.objects.filter(blog_id
__exact
=4)
>>> Entry.objects.filter(blog_id=4)
If you pass an invalid keyword argument, a lookup function will raise
``TypeError``.
...
...
@@ -489,7 +489,7 @@ want.
This example retrieves all ``Entry`` objects with a ``Blog`` whose ``name``
is ``'Beatles Blog'``::
>>> Entry.objects.filter(blog__name
__exact
='Beatles Blog')
>>> Entry.objects.filter(blog__name='Beatles Blog')
This spanning can be as deep as you'd like.
...
...
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