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
46509cf1
Kaydet (Commit)
46509cf1
authored
May 25, 2016
tarafından
Johannes Dollinger
Kaydeden (comit)
Tim Graham
Agu 08, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved EmpytResultSet to django.core.exceptions.
This removes the need for some inner imports.
üst
c002a0d3
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
26 additions
and
13 deletions
+26
-13
exceptions.py
django/core/exceptions.py
+5
-0
expressions.py
django/db/models/expressions.py
+1
-2
lookups.py
django/db/models/lookups.py
+1
-1
__init__.py
django/db/models/sql/__init__.py
+1
-1
compiler.py
django/db/models/sql/compiler.py
+1
-2
datastructures.py
django/db/models/sql/datastructures.py
+2
-4
where.py
django/db/models/sql/where.py
+1
-1
exceptions.txt
docs/ref/exceptions.txt
+13
-0
tests.py
tests/queries/tests.py
+1
-2
No files found.
django/core/exceptions.py
Dosyayı görüntüle @
46509cf1
...
...
@@ -187,3 +187,8 @@ class ValidationError(Exception):
def
__repr__
(
self
):
return
'ValidationError(
%
s)'
%
self
class
EmptyResultSet
(
Exception
):
"""A database query predicate is impossible."""
pass
django/db/models/expressions.py
Dosyayı görüntüle @
46509cf1
import
copy
import
datetime
from
django.core.exceptions
import
FieldError
from
django.core.exceptions
import
EmptyResultSet
,
FieldError
from
django.db.backends
import
utils
as
backend_utils
from
django.db.models
import
fields
from
django.db.models.query_utils
import
Q
...
...
@@ -836,7 +836,6 @@ class Case(Expression):
return
c
def
as_sql
(
self
,
compiler
,
connection
,
template
=
None
,
case_joiner
=
None
,
**
extra_context
):
from
django.db.models.sql.datastructures
import
EmptyResultSet
connection
.
ops
.
check_expression_support
(
self
)
if
not
self
.
cases
:
return
compiler
.
compile
(
self
.
default
)
...
...
django/db/models/lookups.py
Dosyayı görüntüle @
46509cf1
...
...
@@ -2,6 +2,7 @@ import math
import
warnings
from
copy
import
copy
from
django.core.exceptions
import
EmptyResultSet
from
django.db.models.expressions
import
Func
,
Value
from
django.db.models.fields
import
DateTimeField
,
Field
,
IntegerField
from
django.db.models.query_utils
import
RegisterLookupMixin
...
...
@@ -276,7 +277,6 @@ class In(FieldGetDbPrepValueIterableMixin, BuiltinLookup):
rhs
=
self
.
rhs
if
not
rhs
:
from
django.db.models.sql.datastructures
import
EmptyResultSet
raise
EmptyResultSet
# rhs should be an iterable; use batch_process_rhs() to
...
...
django/db/models/sql/__init__.py
Dosyayı görüntüle @
46509cf1
from
django.
db.models.sql.datastructure
s
import
EmptyResultSet
from
django.
core.exception
s
import
EmptyResultSet
from
django.db.models.sql.query
import
*
# NOQA
from
django.db.models.sql.subqueries
import
*
# NOQA
from
django.db.models.sql.where
import
AND
,
OR
...
...
django/db/models/sql/compiler.py
Dosyayı görüntüle @
46509cf1
import
re
from
itertools
import
chain
from
django.core.exceptions
import
FieldError
from
django.core.exceptions
import
EmptyResultSet
,
FieldError
from
django.db.models.constants
import
LOOKUP_SEP
from
django.db.models.expressions
import
OrderBy
,
Random
,
RawSQL
,
Ref
from
django.db.models.query_utils
import
QueryWrapper
,
select_related_descend
from
django.db.models.sql.constants
import
(
CURSOR
,
GET_ITERATOR_CHUNK_SIZE
,
MULTI
,
NO_RESULTS
,
ORDER_DIR
,
SINGLE
,
)
from
django.db.models.sql.datastructures
import
EmptyResultSet
from
django.db.models.sql.query
import
Query
,
get_order_dir
from
django.db.transaction
import
TransactionManagementError
from
django.db.utils
import
DatabaseError
...
...
django/db/models/sql/datastructures.py
Dosyayı görüntüle @
46509cf1
...
...
@@ -2,13 +2,11 @@
Useful auxiliary data structures for query construction. Not useful outside
the SQL domain.
"""
# for backwards-compatibility in Django 1.11
from
django.core.exceptions
import
EmptyResultSet
# NOQA: F401
from
django.db.models.sql.constants
import
INNER
,
LOUTER
class
EmptyResultSet
(
Exception
):
pass
class
MultiJoin
(
Exception
):
"""
Used by join construction code to indicate the point at which a
...
...
django/db/models/sql/where.py
Dosyayı görüntüle @
46509cf1
...
...
@@ -2,7 +2,7 @@
Code to manage the creation and SQL rendering of 'where' constraints.
"""
from
django.
db.models.sql.datastructure
s
import
EmptyResultSet
from
django.
core.exception
s
import
EmptyResultSet
from
django.utils
import
tree
from
django.utils.functional
import
cached_property
...
...
docs/ref/exceptions.txt
Dosyayı görüntüle @
46509cf1
...
...
@@ -24,6 +24,19 @@ Django core exception classes are defined in ``django.core.exceptions``.
See :meth:`~django.db.models.query.QuerySet.get()` for further information
on :exc:`ObjectDoesNotExist` and :exc:`~django.db.models.Model.DoesNotExist`.
``EmptyResultSet``
------------------
.. exception:: EmptyResultSet
``EmptyResultSet`` may be raised during query generation if a query won't
return any results. Most Django projects won't encounter this exception,
but it might be useful for implementing custom lookups and expressions.
.. versionchanged:: 1.11
In older versions, it's only importable from ``django.db.models.sql``.
``FieldDoesNotExist``
---------------------
...
...
tests/queries/tests.py
Dosyayı görüntüle @
46509cf1
...
...
@@ -6,11 +6,10 @@ import unittest
from
collections
import
OrderedDict
from
operator
import
attrgetter
from
django.core.exceptions
import
FieldError
from
django.core.exceptions
import
EmptyResultSet
,
FieldError
from
django.db
import
DEFAULT_DB_ALIAS
,
connection
from
django.db.models
import
Count
,
F
,
Q
from
django.db.models.sql.constants
import
LOUTER
from
django.db.models.sql.datastructures
import
EmptyResultSet
from
django.db.models.sql.where
import
NothingNode
,
WhereNode
from
django.test
import
TestCase
,
skipUnlessDBFeature
from
django.test.utils
import
CaptureQueriesContext
...
...
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