id
int64
0
458k
file_name
stringlengths
4
119
file_path
stringlengths
14
227
content
stringlengths
24
9.96M
size
int64
24
9.96M
language
stringclasses
1 value
extension
stringclasses
14 values
total_lines
int64
1
219k
avg_line_length
float64
2.52
4.63M
max_line_length
int64
5
9.91M
alphanum_fraction
float64
0
1
repo_name
stringlengths
7
101
repo_stars
int64
100
139k
repo_forks
int64
0
26.4k
repo_open_issues
int64
0
2.27k
repo_license
stringclasses
12 values
repo_extraction_date
stringclasses
433 values
2,200
models.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/custom_columns/models.py
""" 17. Custom column/table names If your database column name is different than your model attribute, use the ``db_column`` parameter. Note that you'll use the field's name, not its column name, in API usage. If your database table name is different than your model name, use the ``db_table`` Meta attribute. This has...
1,243
Python
.py
28
40.392857
78
0.72153
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,201
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/custom_columns/tests.py
from django.core.exceptions import FieldError from django.test import TestCase from models import Author, Article class CustomColumnsTests(TestCase): def test_db_column(self): a1 = Author.objects.create(first_name="John", last_name="Smith") a2 = Author.objects.create(first_name="Peter", last_name...
2,224
Python
.py
60
26.483333
86
0.579192
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,202
models.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/m2m_intermediary/models.py
""" 9. Many-to-many relationships via an intermediary table For many-to-many relationships that need extra fields on the intermediary table, use an intermediary model. In this example, an ``Article`` can have multiple ``Reporter`` objects, and each ``Article``-``Reporter`` combination (a ``Writer``) has a ``position`...
1,086
Python
.py
26
37.923077
75
0.71619
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,203
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/m2m_intermediary/tests.py
from datetime import datetime from django.test import TestCase from models import Reporter, Article, Writer class M2MIntermediaryTests(TestCase): def test_intermeiary(self): r1 = Reporter.objects.create(first_name="John", last_name="Smith") r2 = Reporter.objects.create(first_name="Jane", last_na...
1,251
Python
.py
29
33.275862
82
0.610882
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,204
models.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/update/models.py
""" Tests for the update() queryset method that allows in-place, multi-object updates. """ from django.db import models class DataPoint(models.Model): name = models.CharField(max_length=20) value = models.CharField(max_length=20) another_value = models.CharField(max_length=20, blank=True) def __unico...
810
Python
.py
25
28.44
73
0.72
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,205
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/update/tests.py
from django.test import TestCase from models import A, B, C, D, DataPoint, RelatedPoint class SimpleTest(TestCase): def setUp(self): self.a1 = A.objects.create() self.a2 = A.objects.create() for x in range(20): B.objects.create(a=self.a1) D.objects.create(a=self.a1...
4,252
Python
.py
101
33.544554
81
0.631286
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,206
models.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/defer/models.py
""" Tests for defer() and only(). """ from django.db import models class Secondary(models.Model): first = models.CharField(max_length=50) second = models.CharField(max_length=50) class Primary(models.Model): name = models.CharField(max_length=50) value = models.CharField(max_length=50) related =...
505
Python
.py
17
25.941176
44
0.723493
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,207
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/defer/tests.py
from django.db.models.query_utils import DeferredAttribute from django.test import TestCase from models import Secondary, Primary, Child, BigChild class DeferTests(TestCase): def assert_delayed(self, obj, num): count = 0 for field in obj._meta.fields: if isinstance(obj.__class__.__dic...
5,272
Python
.py
116
35.991379
80
0.594158
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,208
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_package/tests.py
from django.contrib.sites.models import Site from django.db import models from django.test import TestCase from models.publication import Publication from models.article import Article class Advertisment(models.Model): customer = models.CharField(max_length=100) publications = models.ManyToManyField( ...
2,570
Python
.py
58
35.689655
142
0.66293
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,209
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_package/models/__init__.py
# Import all the models from subpackages from article import Article from publication import Publication
105
Python
.py
3
34
40
0.872549
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,210
article.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_package/models/article.py
from django.db import models from django.contrib.sites.models import Site class Article(models.Model): sites = models.ManyToManyField(Site) headline = models.CharField(max_length=100) publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,) class Meta: app_lab...
341
Python
.py
8
38.375
94
0.761329
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,211
publication.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_package/models/publication.py
from django.db import models class Publication(models.Model): title = models.CharField(max_length=30) class Meta: app_label = 'model_package'
160
Python
.py
5
27.4
43
0.72549
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,212
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/fixtures_model_package/tests.py
from django.core import management from django.test import TestCase from models import Article class SampleTestCase(TestCase): fixtures = ['fixture1.json', 'fixture2.json'] def testClassFixtures(self): "Test cases can load fixture objects into models defined in packages" self.assertEqual(Art...
2,540
Python
.py
62
29.693548
87
0.590117
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,213
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/fixtures_model_package/models/__init__.py
from django.db import models from django.conf import settings class Article(models.Model): headline = models.CharField(max_length=100, default='Default headline') pub_date = models.DateTimeField() def __unicode__(self): return self.headline class Meta: app_label = 'fixtures_model_pack...
371
Python
.py
10
31.7
75
0.70028
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,214
models.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_formsets/models.py
import datetime from django.db import models class Author(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ('name',) def __unicode__(self): return self.name class BetterAuthor(Author): write_speed = models.IntegerField() class Book(models.Model): aut...
5,488
Python
.py
141
33.751773
92
0.701416
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,215
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/model_formsets/tests.py
import datetime import re from datetime import date from decimal import Decimal from django import forms from django.db import models from django.forms.models import (_get_foreign_key, inlineformset_factory, modelformset_factory, modelformset_factory) from django.test import TestCase, skipUnlessDBFeature from mod...
60,319
Python
.py
1,003
49.551346
381
0.613792
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,216
models.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/serializers/models.py
# -*- coding: utf-8 -*- """ 42. Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from decimal import Decimal from django.db import models class Category(models.Model): name = models.CharField(max_length=20) c...
2,652
Python
.py
77
28.688312
88
0.6618
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,217
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/serializers/tests.py
# -*- coding: utf-8 -*- from datetime import datetime from StringIO import StringIO from xml.dom import minidom from django.conf import settings from django.core import serializers from django.db import transaction from django.test import TestCase, TransactionTestCase, Approximate from django.utils import simplejson, ...
17,157
Python
.py
406
32.623153
103
0.624184
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,218
models.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/fixtures/models.py
""" 37. Fixtures. Fixtures are a way of loading data into the database in bulk. Fixure data can be stored in any serializable format (including JSON and XML). Fixtures are identified by name, and are stored in either a directory named 'fixtures' in the application directory, or in one of the directories named in the `...
3,102
Python
.py
75
34.506667
81
0.670886
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,219
tests.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/tests/modeltests/fixtures/tests.py
import StringIO import sys from django.conf import settings from django.contrib.sites.models import Site from django.core import management from django.db import DEFAULT_DB_ALIAS from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from models import Article, Blog, Book, Category, Person, Spy, T...
29,808
Python
.py
283
94.24735
4,318
0.648534
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,220
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/__init__.py
VERSION = (1, 3, 0, 'final', 0) def get_version(): version = '%s.%s' % (VERSION[0], VERSION[1]) if VERSION[2]: version = '%s.%s' % (version, VERSION[2]) if VERSION[3:] == ('alpha', 0): version = '%s pre-alpha' % version else: if VERSION[3] != 'final': version = '%s %...
549
Python
.py
15
30.466667
68
0.553471
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,221
client.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/test/client.py
import urllib from urlparse import urlparse, urlunparse, urlsplit import sys import os import re import mimetypes import warnings from copy import copy try: from cStringIO import StringIO except ImportError: from StringIO import StringIO from django.conf import settings from django.contrib.auth import authenti...
21,245
Python
.py
491
33.384929
121
0.605892
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,222
testcases.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/test/testcases.py
import re import sys from urlparse import urlsplit, urlunsplit from xml.dom.minidom import parseString, Node from django.conf import settings from django.core import mail from django.core.management import call_command from django.core.signals import request_started from django.core.urlresolvers import clear_url_cache...
24,882
Python
.py
540
34.814815
116
0.59586
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,223
_doctest.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/test/_doctest.py
# This is a slightly modified version of the doctest.py that shipped with Python 2.4 # It incorporates changes that have been submitted to the Python ticket tracker # as ticket #1521051. These changes allow for a DoctestRunner and Doctest base # class to be specified when constructing a DoctestSuite. # Module doctest....
100,621
Python
.py
2,269
34.788012
84
0.587095
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,224
utils.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/test/utils.py
import sys import time import os import warnings from django.conf import settings from django.core import mail from django.core.mail.backends import locmem from django.test import signals from django.template import Template from django.utils.translation import deactivate __all__ = ('Approximate', 'ContextList', 'setu...
3,644
Python
.py
97
31.525773
79
0.689792
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,225
simple.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/test/simple.py
import unittest as real_unittest from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_apps from django.test import _doctest as doctest from django.test.utils import setup_test_environment, teardown_test_environment from django.test.testcases ...
15,012
Python
.py
323
35.44582
115
0.61612
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,226
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/test/__init__.py
""" Django Unit Test and Doctest framework. """ from django.test.client import Client, RequestFactory from django.test.testcases import TestCase, TransactionTestCase, skipIfDBFeature, skipUnlessDBFeature from django.test.utils import Approximate
247
Python
.py
6
40
101
0.854167
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,227
unique-messages.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/bin/unique-messages.py
#!/usr/bin/env python import os import sys def unique_messages(): basedir = None if os.path.isdir(os.path.join('conf', 'locale')): basedir = os.path.abspath(os.path.join('conf', 'locale')) elif os.path.isdir('locale'): basedir = os.path.abspath('locale') else: print "this scri...
900
Python
.py
23
30.434783
94
0.56422
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,228
daily_cleanup.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/bin/daily_cleanup.py
#!/usr/bin/env python """ Daily cleanup job. Can be run as a cronjob to clean out old data from the database (only expired sessions at the moment). """ from django.core import management if __name__ == "__main__": management.call_command('cleanup')
257
Python
.py
9
26.666667
77
0.729508
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,229
django-admin.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/bin/django-admin.py
#!/usr/bin/env python from django.core import management if __name__ == "__main__": management.execute_from_command_line()
128
Python
.py
4
29.75
42
0.707317
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,230
gather_profile_stats.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/bin/profiling/gather_profile_stats.py
#!/usr/bin/env python """ gather_profile_stats.py /path/to/dir/of/profiles Note that the aggregated profiles must be read with pstats.Stats, not hotshot.stats (the formats are incompatible) """ from hotshot import stats import pstats import sys, os def gather_stats(p): profiles = {} for f in os.listdir(p): ...
977
Python
.py
31
24.548387
69
0.579509
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,231
saferef.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/dispatch/saferef.py
""" "Safe weakrefs", originally from pyDispatcher. Provides a way to safely weakref any function, including bound methods (which aren't handled by the core weakref module). """ import weakref, traceback def safeRef(target, onDelete = None): """Return a *safe* weak reference to a callable target target -- th...
10,495
Python
.py
218
37.788991
145
0.638456
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,232
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/dispatch/__init__.py
"""Multi-consumer multi-producer dispatching mechanism Originally based on pydispatch (BSD) http://pypi.python.org/pypi/PyDispatcher/2.0.1 See license.txt for original license. Heavily modified for Django's purposes. """ from django.dispatch.dispatcher import Signal, receiver
279
Python
.py
6
45.166667
83
0.826568
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,233
dispatcher.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/dispatch/dispatcher.py
import weakref import threading from django.dispatch import saferef WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, 'im_func'): return (id(target.im_self), id(target.im_func)) return id(target) class Signal(object): """ Base class ...
9,292
Python
.py
217
29.981567
83
0.581962
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,234
l10n.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/templatetags/l10n.py
from django.conf import settings from django.template import Node from django.template import TemplateSyntaxError, Library from django.utils import formats from django.utils.encoding import force_unicode register = Library() def localize(value): """ Forces a value to be rendered as a localized value, reg...
1,845
Python
.py
55
28.327273
82
0.671541
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,235
future.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/templatetags/future.py
from django.conf import settings from django.template import Library, Node, Template, TemplateSyntaxError from django.template.defaulttags import kwarg_re, include_is_allowed, SsiNode, URLNode from django.utils.encoding import smart_str register = Library() @register.tag def ssi(parser, token): """ Outputs t...
3,486
Python
.py
77
37.25974
86
0.642161
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,236
i18n.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/templatetags/i18n.py
import re from django.template import Node, Variable, VariableNode from django.template import TemplateSyntaxError, TokenParser, Library from django.template import TOKEN_TEXT, TOKEN_VAR from django.template.base import _render_value_in_context from django.utils import translation from django.utils.encoding import for...
13,327
Python
.py
305
35.396721
117
0.635564
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,237
cache.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/templatetags/cache.py
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist from django.template import resolve_variable from django.core.cache import cache from django.utils.encoding import force_unicode from django.utils.http import urlquote from django.utils.hashcompat import md5_constructor regi...
2,406
Python
.py
53
38.169811
109
0.664106
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,238
static.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/templatetags/static.py
from django import template from django.utils.encoding import iri_to_uri register = template.Library() class PrefixNode(template.Node): def __repr__(self): return "<PrefixNode for %r>" % self.name def __init__(self, varname=None, name=None): if name is None: raise template.Templa...
2,149
Python
.py
65
25.307692
66
0.60339
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,239
transaction.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/transaction.py
""" This module implements a transaction manager that can be used to define transaction handling in a request or view function. It is used by transaction control middleware and decorators. The transaction manager can be in managed or in auto state. Auto state means the system is using a commit-on-save strategy (actual...
9,966
Python
.py
264
31.643939
80
0.689298
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,240
utils.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/utils.py
import inspect import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module DEFAULT_DB_ALIAS = 'default' # Define some exceptions that mirror the PEP249 interface. # We will rethrow any backend-specific errors using these # commo...
6,225
Python
.py
148
30.283784
128
0.572349
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,241
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/__init__.py
from django.conf import settings from django.core import signals from django.core.exceptions import ImproperlyConfigured from django.db.utils import ConnectionHandler, ConnectionRouter, load_backend, DEFAULT_DB_ALIAS, \ DatabaseError, IntegrityError from django.utils.functional import curry ...
4,304
Python
.py
91
40.087912
98
0.693571
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,242
signals.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/signals.py
from django.dispatch import Signal class_prepared = Signal(providing_args=["class"]) pre_init = Signal(providing_args=["instance", "args", "kwargs"]) post_init = Signal(providing_args=["instance"]) pre_save = Signal(providing_args=["instance", "raw", "using"]) post_save = Signal(providing_args=["instance", "raw", "c...
658
Python
.py
10
64.2
99
0.71028
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,243
related.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/related.py
from django.utils.encoding import smart_unicode from django.db.models.fields import BLANK_CHOICE_DASH class BoundRelatedObject(object): def __init__(self, related_object, field_mapping, original): self.relation = related_object self.field_mappings = field_mapping[related_object.name] def templ...
3,157
Python
.py
57
46.245614
103
0.665584
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,244
expressions.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/expressions.py
import datetime from django.utils import tree from django.utils.copycompat import deepcopy class ExpressionNode(tree.Node): """ Base class for all query expressions. """ # Arithmetic connectors ADD = '+' SUB = '-' MUL = '*' DIV = '/' MOD = '%%' # This is a quoted % operator - it i...
4,992
Python
.py
117
35.316239
88
0.634146
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,245
deletion.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/deletion.py
from operator import attrgetter from django.db import connections, transaction, IntegrityError from django.db.models import signals, sql from django.db.models.sql.constants import GET_ITERATOR_CHUNK_SIZE from django.utils.datastructures import SortedDict from django.utils.functional import wraps class ProtectedError...
10,907
Python
.py
228
36.307018
84
0.608254
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,246
options.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/options.py
import re from bisect import bisect from django.conf import settings from django.db.models.related import RelatedObject from django.db.models.fields.related import ManyToManyRel from django.db.models.fields import AutoField, FieldDoesNotExist from django.db.models.fields.proxy import OrderWrt from django.db.models.loa...
20,299
Python
.py
450
34.268889
122
0.595393
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,247
query_utils.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/query_utils.py
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ import weakref from django.utils.copycompat import deepcopy from django.d...
5,799
Python
.py
146
32.636986
79
0.649964
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,248
manager.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/manager.py
from django.utils import copycompat as copy from django.conf import settings from django.db import router from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet from django.db.models import signals from django.db.models.fields import FieldDoesNotExist def ensure_default_manager(sender, ...
7,872
Python
.py
170
38.188235
125
0.636755
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,249
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/__init__.py
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured from django.db import connection from django.db.models.loading import get_apps, get_app, get_models, get_model, register_models from django.db.models.query import Q from django.db.models.expressions import F fro...
1,500
Python
.py
33
42.181818
128
0.781421
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,250
base.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/base.py
import types import sys from itertools import izip import django.db.models.manager # Imported to register signal handler. from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned, FieldError, ValidationError, NON_FIELD_ERRORS from django.core import validators from django.db.models.fields imp...
40,137
Python
.py
797
37.542033
166
0.576689
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,251
aggregates.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/aggregates.py
""" Classes to represent the definitions of aggregate functions. """ class Aggregate(object): """ Default Aggregate definition. """ def __init__(self, lookup, **extra): """Instantiate a new aggregate. * lookup is the field on which the aggregate operates. * extra is a diction...
2,101
Python
.py
53
32.509434
82
0.663717
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,252
query.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/query.py
""" The main QuerySet implementation. This provides the public API for the ORM. """ from itertools import izip from django.db import connections, router, transaction, IntegrityError from django.db.models.aggregates import Aggregate from django.db.models.fields import DateField from django.db.models.query_utils import...
53,941
Python
.py
1,261
31.9659
127
0.581811
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,253
loading.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/loading.py
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule im...
8,745
Python
.py
202
33.09901
97
0.605893
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,254
related.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/fields/related.py
from django.conf import settings from django.db import connection, router, transaction from django.db.backends import util from django.db.models import signals, get_model from django.db.models.fields import (AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist) from dja...
54,853
Python
.py
1,021
42.142018
222
0.61539
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,255
proxy.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/fields/proxy.py
""" Field-like classes that aren't really fields. It's easier to use objects that have the same attributes as fields sometimes (avoids a lot of special casing). """ from django.db.models import fields class OrderWrt(fields.IntegerField): """ A proxy for the _order database field that is used when Meta.ord...
528
Python
.py
14
33.357143
78
0.682975
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,256
subclassing.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/fields/subclassing.py
""" Convenience routines for creating non-trivial Field subclasses, as well as backwards compatibility utilities. Add SubfieldBase as the __metaclass__ for your Field subclass, implement to_python() and the other necessary methods and everything will work seamlessly. """ from inspect import getargspec from warnings i...
4,356
Python
.py
103
34.514563
93
0.643784
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,257
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/fields/__init__.py
import datetime import decimal import re import time import math from itertools import tee import django.utils.copycompat as copy from django.db import connection from django.db.models.fields.subclassing import LegacyConnection from django.db.models.query_utils import QueryWrapper from django.conf import settings fro...
43,559
Python
.py
973
35.423433
166
0.622374
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,258
files.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/fields/files.py
import datetime import os import django.utils.copycompat as copy from django.conf import settings from django.db.models.fields import Field from django.core.files.base import File, ContentFile from django.core.files.storage import default_storage from django.core.files.images import ImageFile, get_image_dimensions fr...
16,228
Python
.py
326
41.282209
107
0.661466
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,259
datastructures.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/datastructures.py
""" Useful auxilliary data structures for query construction. Not useful outside the SQL domain. """ class EmptyResultSet(Exception): pass class FullResultSet(Exception): pass class MultiJoin(Exception): """ Used by join construction code to indicate the point at which a multi-valued join was att...
1,157
Python
.py
38
24.710526
76
0.632763
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,260
expressions.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/expressions.py
from django.core.exceptions import FieldError from django.db.models.fields import FieldDoesNotExist from django.db.models.sql.constants import LOOKUP_SEP class SQLEvaluator(object): def __init__(self, expression, query, allow_joins=True): self.expression = expression self.opts = query.get_meta() ...
3,772
Python
.py
78
36.769231
96
0.550476
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,261
compiler.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/compiler.py
from django.core.exceptions import FieldError from django.db import connections from django.db.backends.util import truncate_name from django.db.models.sql.constants import * from django.db.models.sql.datastructures import EmptyResultSet from django.db.models.sql.expressions import SQLEvaluator from django.db.models.sq...
43,006
Python
.py
897
34.254181
108
0.55899
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,262
subqueries.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/subqueries.py
""" Query subclasses which provide extra functionality beyond simple data retrieval. """ from django.core.exceptions import FieldError from django.db import connections from django.db.models.fields import DateField, FieldDoesNotExist from django.db.models.sql.constants import * from django.db.models.sql.datastructures...
8,070
Python
.py
191
33.209424
121
0.619345
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,263
constants.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/constants.py
import re # Valid query types (a dictionary is used for speedy lookups). QUERY_TERMS = dict([(x, None) for x in ( 'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in', 'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year', 'month', 'day', 'week_day', 'isnull', 'search'...
1,043
Python
.py
29
33.862069
79
0.672962
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,264
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/__init__.py
from query import * from subqueries import * from where import AND, OR from datastructures import EmptyResultSet __all__ = ['Query', 'AND', 'OR', 'EmptyResultSet']
166
Python
.py
5
31.8
50
0.754717
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,265
aggregates.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/aggregates.py
""" Classes to represent the default SQL aggregate functions """ class AggregateField(object): """An internal field mockup used to identify aggregates in the data-conversion parts of the database backend. """ def __init__(self, internal_type): self.internal_type = internal_type def get_int...
4,176
Python
.py
101
33.267327
90
0.632411
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,266
query.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/query.py
""" Create SQL statements for QuerySets. The code in here encapsulates all of the SQL construction so that QuerySets themselves do not have to (and could be backed by things other than SQL databases). The abstraction barrier only works one way: this module has to know all about the internals of models in order to get ...
81,267
Python
.py
1,706
35.208089
133
0.58171
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,267
where.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/models/sql/where.py
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import datetime from itertools import repeat from django.utils import tree from django.db.models.fields import Field from django.db.models.query_utils import QueryWrapper from datastructures import EmptyResultSet, FullResultSet # Connection...
13,163
Python
.py
303
32.006601
91
0.573724
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,268
util.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/util.py
import datetime import decimal from time import time from django.utils.hashcompat import md5_constructor from django.utils.log import getLogger logger = getLogger('django.db.backends') class CursorWrapper(object): def __init__(self, cursor, db): self.cursor = cursor self.db = db def __geta...
4,606
Python
.py
122
30.581967
103
0.57098
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,269
creation.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/creation.py
import sys import time from django.conf import settings # The prefix to put on the default database name when creating # the test database. TEST_DATABASE_PREFIX = 'test_' class BaseDatabaseCreation(object): """ This class encapsulates all backend-specific differences that pertain to database *creation*, ...
22,033
Python
.py
434
38.799539
148
0.597001
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,270
__init__.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/__init__.py
import decimal try: import thread except ImportError: import dummy_thread as thread from threading import local from django.conf import settings from django.db import DEFAULT_DB_ALIAS from django.db.backends import util from django.db.transaction import TransactionManagementError from django.utils import datet...
31,199
Python
.py
743
33.250336
102
0.64441
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,271
client.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql/client.py
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'psql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] if settings_dict['USER']: args += ["-U"...
709
Python
.py
19
29.157895
59
0.597668
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,272
creation.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql/creation.py
from django.db.backends.creation import BaseDatabaseCreation from django.db.backends.util import truncate_name class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated PostgreSQL column # types, as strings. Column-type strings can contain format strings; they'll ...
3,753
Python
.py
70
41.1
146
0.559423
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,273
introspection.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql/introspection.py
from django.db.backends import BaseDatabaseIntrospection class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', 20: 'BigIntegerField', 21: 'SmallIntegerField', 23: 'IntegerField', 25: 'T...
3,725
Python
.py
82
34.439024
95
0.587765
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,274
base.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql/base.py
""" PostgreSQL database backend for Django. Requires psycopg 1: http://initd.org/projects/psycopg1 """ import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql.client import DatabaseClient from django.db.backe...
7,448
Python
.py
161
38.118012
140
0.658087
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,275
operations.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql/operations.py
import re from django.db.backends import BaseDatabaseOperations # This DatabaseOperations class lives in here instead of base.py because it's # used by both the 'postgresql' and 'postgresql_psycopg2' backends. class DatabaseOperations(BaseDatabaseOperations): def __init__(self, connection): super(Databas...
9,420
Python
.py
173
41.595376
188
0.58611
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,276
version.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql/version.py
""" Extracts the version of the PostgreSQL server. """ import re # This reg-exp is intentionally fairly flexible here. # Needs to be able to handle stuff like: # PostgreSQL 8.3.6 # EnterpriseDB 8.3 # PostgreSQL 8.3 beta4 # PostgreSQL 8.4beta1 VERSION_RE = re.compile(r'\S+ (\d+)\.(\d+)\.?(\d+)?') def _parse_v...
1,018
Python
.py
27
34.185185
76
0.685917
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,277
introspection.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql_psycopg2/introspection.py
from django.db.backends.postgresql.introspection import DatabaseIntrospection as PostgresDatabaseIntrospection class DatabaseIntrospection(PostgresDatabaseIntrospection): def get_relations(self, cursor, table_name): """ Returns a dictionary of {field_index: (field_index_other_table, other_table)} ...
959
Python
.py
19
40.105263
110
0.627932
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,278
base.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/postgresql_psycopg2/base.py
""" PostgreSQL database backend for Django. Requires psycopg 2: http://initd.org/projects/psycopg2 """ import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql.operations import DatabaseOperations as Postgresq...
8,346
Python
.py
179
37.206704
124
0.647471
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,279
client.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/mysql/client.py
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] db = settings_dict['OPTIONS'].get('db', settings_d...
1,380
Python
.py
34
31.058824
82
0.554478
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,280
compiler.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/mysql/compiler.py
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): values = [] index_extra_select = len(self.query.extra_select.keys()) for value, field in map(None, row[index_extra_select:], fields): if (field and field...
926
Python
.py
21
37.47619
95
0.719689
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,281
creation.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/mysql/creation.py
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__dict_...
3,019
Python
.py
60
40.766667
99
0.599526
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,282
introspection.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/mysql/introspection.py
from django.db.backends import BaseDatabaseIntrospection from MySQLdb import ProgrammingError, OperationalError from MySQLdb.constants import FIELD_TYPE import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseI...
4,329
Python
.py
88
38.75
113
0.619003
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,283
validation.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/mysql/validation.py
from django.db.backends import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def validate_field(self, errors, opts, f): """ There are some field length restrictions for MySQL: - Prior to version 5.0.3, character fields could not exceed 255 characters in...
1,309
Python
.py
23
46.043478
169
0.612627
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,284
base.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/mysql/base.py
""" MySQL database backend for Django. Requires MySQLdb: http://sourceforge.net/projects/mysql-python """ import re import sys try: import MySQLdb as Database except ImportError, e: from django.core.exceptions import ImproperlyConfigured raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) ...
13,894
Python
.py
296
38.429054
127
0.643569
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,285
client.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/oracle/client.py
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlplus' def runshell(self): conn_string = self.connection._connect_string() args = [self.executable_name, "-L", conn_string] if os.name == 'nt': ...
426
Python
.py
12
28.833333
56
0.660976
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,286
compiler.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/oracle/compiler.py
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def resolve_columns(self, row, fields=()): # If this query has limit/offset information, then we expect the # first column to be an extra "_RN" column that we need to throw # away. if self.query.high...
2,830
Python
.py
55
41
146
0.635771
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,287
creation.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/oracle/creation.py
import sys, time from django.db.backends.creation import BaseDatabaseCreation TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated Oracle column # types, as strings. Column-type strings can contain fo...
11,808
Python
.py
242
36.975207
149
0.568605
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,288
introspection.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/oracle/introspection.py
from django.db.backends import BaseDatabaseIntrospection import cx_Oracle import re foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)") class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type objects to Django Field types. data_types_re...
5,106
Python
.py
110
38.236364
113
0.640048
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,289
base.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/oracle/base.py
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ import datetime import sys import time from decimal import Decimal def _setup_environment(environ): import platform # Cygwin requires some special voodoo to set the environment variables # properly so that...
32,300
Python
.py
676
37.152367
126
0.607324
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,290
base.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/dummy/base.py
""" Dummy database backend for Django. Django uses this if the database ENGINE setting is empty (None or empty string). Each of these API functions, except connection.close(), raises ImproperlyConfigured. """ from django.core.exceptions import ImproperlyConfigured from django.db.backends import * from django.db.back...
1,998
Python
.py
53
33.207547
82
0.757246
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,291
client.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/sqlite3/client.py
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'sqlite3' def runshell(self): args = [self.executable_name, self.connection.settings_dict['NAME']] if os.name == 'nt': sys.exit(os.sys...
406
Python
.py
12
26.5
54
0.648718
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,292
creation.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/sqlite3/creation.py
import os import sys from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # SQLite doesn't actually support most of these types, but it "does the right # thing" given more verbose field definitions, so leave them as is so that # schema inspection is mor...
3,239
Python
.py
64
40.234375
152
0.54402
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,293
introspection.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/sqlite3/introspection.py
import re from django.db.backends import BaseDatabaseIntrospection # This light wrapper "fakes" a dictionary interface, because some SQLite data # types include variables in them -- e.g. "varchar(30)" -- and can't be matched # as a simple dictionary lookup. class FlexibleFieldLookupDict(object): # Maps SQL types t...
5,815
Python
.py
120
37.683333
112
0.591333
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,294
base.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/db/backends/sqlite3/base.py
""" SQLite3 backend for django. Python 2.4 requires pysqlite2 (http://pysqlite.org/). Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the standard library. """ import re import sys import datetime from django.db import utils from django.db.backends import * from django.db.backends.signals i...
12,206
Python
.py
264
38.545455
129
0.658324
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,295
i18n.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/views/i18n.py
import os import gettext as gettext_module from django import http from django.conf import settings from django.utils import importlib from django.utils.translation import check_for_language, activate, to_locale, get_language from django.utils.text import javascript_quote from django.utils.encoding import smart_unicod...
9,673
Python
.py
256
31.414063
124
0.629046
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,296
csrf.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/views/csrf.py
from django.http import HttpResponseForbidden from django.template import Context, Template from django.conf import settings # We include the template inline since we need to be able to reliably display # this error message, especially for the sake of developers, and there isn't any # other way of making it available ...
3,834
Python
.py
91
38.307692
133
0.693462
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,297
defaults.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/views/defaults.py
from django import http from django.views.decorators.csrf import requires_csrf_token from django.template import Context, RequestContext, loader # This can be called when CsrfViewMiddleware.process_view has not run, therefore # need @requires_csrf_token in case the template needs {% csrf_token %}. @requires_csrf_toke...
1,663
Python
.py
35
43.085714
103
0.73642
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,298
debug.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/views/debug.py
import datetime import os import re import sys import types from django.conf import settings from django.http import HttpResponse, HttpResponseServerError, HttpResponseNotFound from django.template import (Template, Context, TemplateDoesNotExist, TemplateSyntaxError) from django.template.defaultfilters import forc...
33,304
Python
.py
844
31.856635
251
0.583184
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)
2,299
static.py
gabrielfalcao_lettuce/tests/integration/lib/Django-1.3/django/views/static.py
""" Views and functions for serving static files. These are only to be used during development, and SHOULD NOT be used in a production setting. """ import mimetypes import os import posixpath import re import urllib from django.http import Http404, HttpResponse, HttpResponseRedirect, HttpResponseNotModified from djan...
4,888
Python
.py
122
33.47541
121
0.644645
gabrielfalcao/lettuce
1,274
325
102
GPL-3.0
9/5/2024, 5:08:58 PM (Europe/Amsterdam)