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
081e7871
Kaydet (Commit)
081e7871
authored
Haz 26, 2017
tarafından
Mariusz Felisiak
Kaydeden (comit)
Tim Graham
Haz 26, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #23919 -- Stopped inheriting from object to define new style classes.
Tests and docs complement to
cecc0791
.
üst
fba0eaa5
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
24 additions
and
24 deletions
+24
-24
custom-model-fields.txt
docs/howto/custom-model-fields.txt
+1
-1
outputting-csv.txt
docs/howto/outputting-csv.txt
+1
-1
writing-migrations.txt
docs/howto/writing-migrations.txt
+1
-1
coding-style.txt
docs/internals/contributing/writing-code/coding-style.txt
+1
-1
contributing.txt
docs/intro/contributing.txt
+3
-3
customizing.txt
docs/topics/auth/customizing.txt
+4
-4
passwords.txt
docs/topics/auth/passwords.txt
+1
-1
cache.txt
docs/topics/cache.txt
+1
-1
generic-editing.txt
docs/topics/class-based-views/generic-editing.txt
+1
-1
mixins.txt
docs/topics/class-based-views/mixins.txt
+1
-1
multi-db.txt
docs/topics/db/multi-db.txt
+2
-2
middleware.txt
docs/topics/http/middleware.txt
+1
-1
migrations.txt
docs/topics/migrations.txt
+1
-1
signals.txt
docs/topics/signals.txt
+1
-1
templates.txt
docs/topics/templates.txt
+1
-1
test_ddl_references.py
tests/backends/test_ddl_references.py
+1
-1
test_writer.py
tests/migrations/test_writer.py
+1
-1
models.py
tests/model_meta/models.py
+1
-1
No files found.
docs/howto/custom-model-fields.txt
Dosyayı görüntüle @
081e7871
...
@@ -36,7 +36,7 @@ You only need to know that 52 cards are dealt out equally to four players, who
...
@@ -36,7 +36,7 @@ You only need to know that 52 cards are dealt out equally to four players, who
are traditionally called *north*, *east*, *south* and *west*. Our class looks
are traditionally called *north*, *east*, *south* and *west*. Our class looks
something like this::
something like this::
class Hand
(object)
:
class Hand:
"""A hand of cards (bridge style)"""
"""A hand of cards (bridge style)"""
def __init__(self, north, east, south, west):
def __init__(self, north, east, south, west):
...
...
docs/howto/outputting-csv.txt
Dosyayı görüntüle @
081e7871
...
@@ -71,7 +71,7 @@ the assembly and transmission of a large CSV file::
...
@@ -71,7 +71,7 @@ the assembly and transmission of a large CSV file::
from django.http import StreamingHttpResponse
from django.http import StreamingHttpResponse
class Echo
(object)
:
class Echo:
"""An object that implements just the write method of the file-like
"""An object that implements just the write method of the file-like
interface.
interface.
"""
"""
...
...
docs/howto/writing-migrations.txt
Dosyayı görüntüle @
081e7871
...
@@ -42,7 +42,7 @@ method of database routers as ``**hints``:
...
@@ -42,7 +42,7 @@ method of database routers as ``**hints``:
.. snippet::
.. snippet::
:filename: myapp/dbrouters.py
:filename: myapp/dbrouters.py
class MyRouter
(object)
:
class MyRouter:
def allow_migrate(self, db, app_label, model_name=None, **hints):
def allow_migrate(self, db, app_label, model_name=None, **hints):
if 'target_db' in hints:
if 'target_db' in hints:
...
...
docs/internals/contributing/writing-code/coding-style.txt
Dosyayı görüntüle @
081e7871
...
@@ -151,7 +151,7 @@ Imports
...
@@ -151,7 +151,7 @@ Imports
CONSTANT = 'foo'
CONSTANT = 'foo'
class Example
(object)
:
class Example:
# ...
# ...
* Use convenience imports whenever available. For example, do this::
* Use convenience imports whenever available. For example, do this::
...
...
docs/intro/contributing.txt
Dosyayı görüntüle @
081e7871
...
@@ -427,7 +427,7 @@ Navigate to the ``django/django/forms/`` folder and open the ``forms.py`` file.
...
@@ -427,7 +427,7 @@ Navigate to the ``django/django/forms/`` folder and open the ``forms.py`` file.
Find the ``BaseForm`` class on line 72 and add the ``prefix`` class attribute
Find the ``BaseForm`` class on line 72 and add the ``prefix`` class attribute
right after the ``field_order`` attribute::
right after the ``field_order`` attribute::
class BaseForm
(object)
:
class BaseForm:
# This is the main implementation of all the Form logic. Note that this
# This is the main implementation of all the Form logic. Note that this
# class is different than Form. See the comments by the Form class for
# class is different than Form. See the comments by the Form class for
# more information. Any improvements to the form API should be made to
# more information. Any improvements to the form API should be made to
...
@@ -529,7 +529,7 @@ Use the arrow keys to move up and down.
...
@@ -529,7 +529,7 @@ Use the arrow keys to move up and down.
index 509709f..d1370de 100644
index 509709f..d1370de 100644
--- a/django/forms/forms.py
--- a/django/forms/forms.py
+++ b/django/forms/forms.py
+++ b/django/forms/forms.py
@@ -75,6 +75,7 @@ class BaseForm
(object)
:
@@ -75,6 +75,7 @@ class BaseForm:
# information. Any improvements to the form API should be made to *this*
# information. Any improvements to the form API should be made to *this*
# class, not to the Form class.
# class, not to the Form class.
field_order = None
field_order = None
...
@@ -537,7 +537,7 @@ Use the arrow keys to move up and down.
...
@@ -537,7 +537,7 @@ Use the arrow keys to move up and down.
def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
initial=None, error_class=ErrorList, label_suffix=None,
initial=None, error_class=ErrorList, label_suffix=None,
@@ -83,7 +84,8 @@ class BaseForm
(object)
:
@@ -83,7 +84,8 @@ class BaseForm:
self.data = data or {}
self.data = data or {}
self.files = files or {}
self.files = files or {}
self.auto_id = auto_id
self.auto_id = auto_id
...
...
docs/topics/auth/customizing.txt
Dosyayı görüntüle @
081e7871
...
@@ -100,14 +100,14 @@ and returns a user object.
...
@@ -100,14 +100,14 @@ and returns a user object.
The ``authenticate`` method takes a ``request`` argument and credentials as
The ``authenticate`` method takes a ``request`` argument and credentials as
keyword arguments. Most of the time, it'll just look like this::
keyword arguments. Most of the time, it'll just look like this::
class MyBackend
(object)
:
class MyBackend:
def authenticate(self, request, username=None, password=None):
def authenticate(self, request, username=None, password=None):
# Check the username/password and return a user.
# Check the username/password and return a user.
...
...
But it could also authenticate a token, like so::
But it could also authenticate a token, like so::
class MyBackend
(object)
:
class MyBackend:
def authenticate(self, request, token=None):
def authenticate(self, request, token=None):
# Check the token and return a user.
# Check the token and return a user.
...
...
...
@@ -135,7 +135,7 @@ object the first time a user authenticates::
...
@@ -135,7 +135,7 @@ object the first time a user authenticates::
from django.contrib.auth.hashers import check_password
from django.contrib.auth.hashers import check_password
from django.contrib.auth.models import User
from django.contrib.auth.models import User
class SettingsBackend
(object)
:
class SettingsBackend:
"""
"""
Authenticate against the settings ADMIN_LOGIN and ADMIN_PASSWORD.
Authenticate against the settings ADMIN_LOGIN and ADMIN_PASSWORD.
...
@@ -198,7 +198,7 @@ will immediately fail and Django won't check the backends that follow.
...
@@ -198,7 +198,7 @@ will immediately fail and Django won't check the backends that follow.
The simple backend above could implement permissions for the magic admin
The simple backend above could implement permissions for the magic admin
fairly simply::
fairly simply::
class SettingsBackend
(object)
:
class SettingsBackend:
...
...
def has_perm(self, user_obj, perm, obj=None):
def has_perm(self, user_obj, perm, obj=None):
return user_obj.username == settings.ADMIN_LOGIN
return user_obj.username == settings.ADMIN_LOGIN
...
...
docs/topics/auth/passwords.txt
Dosyayı görüntüle @
081e7871
...
@@ -648,7 +648,7 @@ Here's a basic example of a validator, with one optional setting::
...
@@ -648,7 +648,7 @@ Here's a basic example of a validator, with one optional setting::
from django.core.exceptions import ValidationError
from django.core.exceptions import ValidationError
from django.utils.translation import gettext as _
from django.utils.translation import gettext as _
class MinimumLengthValidator
(object)
:
class MinimumLengthValidator:
def __init__(self, min_length=8):
def __init__(self, min_length=8):
self.min_length = min_length
self.min_length = min_length
...
...
docs/topics/cache.txt
Dosyayı görüntüle @
081e7871
...
@@ -238,7 +238,7 @@ operations to ``cache_replica``, and all write operations to
...
@@ -238,7 +238,7 @@ operations to ``cache_replica``, and all write operations to
``cache_primary``. The cache table will only be synchronized onto
``cache_primary``. The cache table will only be synchronized onto
``cache_primary``::
``cache_primary``::
class CacheRouter
(object)
:
class CacheRouter:
"""A router to control all database cache operations"""
"""A router to control all database cache operations"""
def db_for_read(self, model, **hints):
def db_for_read(self, model, **hints):
...
...
docs/topics/class-based-views/generic-editing.txt
Dosyayı görüntüle @
081e7871
...
@@ -233,7 +233,7 @@ works for AJAX requests as well as 'normal' form POSTs::
...
@@ -233,7 +233,7 @@ works for AJAX requests as well as 'normal' form POSTs::
from django.views.generic.edit import CreateView
from django.views.generic.edit import CreateView
from myapp.models import Author
from myapp.models import Author
class AjaxableResponseMixin
(object)
:
class AjaxableResponseMixin:
"""
"""
Mixin to add AJAX support to a form.
Mixin to add AJAX support to a form.
Must be used with an object-based FormView (e.g. CreateView)
Must be used with an object-based FormView (e.g. CreateView)
...
...
docs/topics/class-based-views/mixins.txt
Dosyayı görüntüle @
081e7871
...
@@ -603,7 +603,7 @@ For example, a simple JSON mixin might look something like this::
...
@@ -603,7 +603,7 @@ For example, a simple JSON mixin might look something like this::
from django.http import JsonResponse
from django.http import JsonResponse
class JSONResponseMixin
(object)
:
class JSONResponseMixin:
"""
"""
A mixin that can be used to render a JSON response.
A mixin that can be used to render a JSON response.
"""
"""
...
...
docs/topics/db/multi-db.txt
Dosyayı görüntüle @
081e7871
...
@@ -295,7 +295,7 @@ databases::
...
@@ -295,7 +295,7 @@ databases::
Now we'll need to handle routing. First we want a router that knows to
Now we'll need to handle routing. First we want a router that knows to
send queries for the ``auth`` app to ``auth_db``::
send queries for the ``auth`` app to ``auth_db``::
class AuthRouter
(object)
:
class AuthRouter:
"""
"""
A router to control all database operations on models in the
A router to control all database operations on models in the
auth application.
auth application.
...
@@ -340,7 +340,7 @@ from::
...
@@ -340,7 +340,7 @@ from::
import random
import random
class PrimaryReplicaRouter
(object)
:
class PrimaryReplicaRouter:
def db_for_read(self, model, **hints):
def db_for_read(self, model, **hints):
"""
"""
Reads go to a randomly-chosen replica.
Reads go to a randomly-chosen replica.
...
...
docs/topics/http/middleware.txt
Dosyayı görüntüle @
081e7871
...
@@ -43,7 +43,7 @@ A middleware can be written as a function that looks like this::
...
@@ -43,7 +43,7 @@ A middleware can be written as a function that looks like this::
Or it can be written as a class whose instances are callable, like this::
Or it can be written as a class whose instances are callable, like this::
class SimpleMiddleware
(object)
:
class SimpleMiddleware:
def __init__(self, get_response):
def __init__(self, get_response):
self.get_response = get_response
self.get_response = get_response
# One-time configuration and initialization.
# One-time configuration and initialization.
...
...
docs/topics/migrations.txt
Dosyayı görüntüle @
081e7871
...
@@ -717,7 +717,7 @@ serializable, you can use the ``@deconstructible`` class decorator from
...
@@ -717,7 +717,7 @@ serializable, you can use the ``@deconstructible`` class decorator from
from django.utils.deconstruct import deconstructible
from django.utils.deconstruct import deconstructible
@deconstructible
@deconstructible
class MyCustomClass
(object)
:
class MyCustomClass:
def __init__(self, foo=1):
def __init__(self, foo=1):
self.foo = foo
self.foo = foo
...
...
docs/topics/signals.txt
Dosyayı görüntüle @
081e7871
...
@@ -243,7 +243,7 @@ arguments as you like.
...
@@ -243,7 +243,7 @@ arguments as you like.
For example, here's how sending our ``pizza_done`` signal might look::
For example, here's how sending our ``pizza_done`` signal might look::
class PizzaStore
(object)
:
class PizzaStore:
...
...
def send_pizza(self, toppings, size):
def send_pizza(self, toppings, size):
...
...
docs/topics/templates.txt
Dosyayı görüntüle @
081e7871
...
@@ -531,7 +531,7 @@ fictional ``foobar`` template library::
...
@@ -531,7 +531,7 @@ fictional ``foobar`` template library::
raise TemplateSyntaxError(exc.args)
raise TemplateSyntaxError(exc.args)
class Template
(object)
:
class Template:
def __init__(self, template):
def __init__(self, template):
self.template = template
self.template = template
...
...
tests/backends/test_ddl_references.py
Dosyayı görüntüle @
081e7871
...
@@ -122,7 +122,7 @@ class ForeignKeyNameTests(IndexNameTests):
...
@@ -122,7 +122,7 @@ class ForeignKeyNameTests(IndexNameTests):
)
)
class
MockReference
(
object
)
:
class
MockReference
:
def
__init__
(
self
,
representation
,
referenced_tables
,
referenced_columns
):
def
__init__
(
self
,
representation
,
referenced_tables
,
referenced_columns
):
self
.
representation
=
representation
self
.
representation
=
representation
self
.
referenced_tables
=
referenced_tables
self
.
referenced_tables
=
referenced_tables
...
...
tests/migrations/test_writer.py
Dosyayı görüntüle @
081e7871
...
@@ -40,7 +40,7 @@ class Money(decimal.Decimal):
...
@@ -40,7 +40,7 @@ class Money(decimal.Decimal):
)
)
class
TestModel1
(
object
)
:
class
TestModel1
:
def
upload_to
(
self
):
def
upload_to
(
self
):
return
'/somewhere/dynamic/'
return
'/somewhere/dynamic/'
thing
=
models
.
FileField
(
upload_to
=
upload_to
)
thing
=
models
.
FileField
(
upload_to
=
upload_to
)
...
...
tests/model_meta/models.py
Dosyayı görüntüle @
081e7871
...
@@ -9,7 +9,7 @@ class Relation(models.Model):
...
@@ -9,7 +9,7 @@ class Relation(models.Model):
pass
pass
class
InstanceOnlyDescriptor
(
object
)
:
class
InstanceOnlyDescriptor
:
def
__get__
(
self
,
instance
,
cls
=
None
):
def
__get__
(
self
,
instance
,
cls
=
None
):
if
instance
is
None
:
if
instance
is
None
:
raise
AttributeError
(
'Instance only'
)
raise
AttributeError
(
'Instance only'
)
...
...
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