hash stringlengths 64 64 | content stringlengths 0 1.51M |
|---|---|
151b8f80f114608c344d9d9da91ad4f644b8f3002ed407f8ed45c16a534ee0dc | from django.contrib.auth import models as auth
from django.db import models
# No related name is needed here, since symmetrical relations are not
# explicitly reversible.
class SelfRefer(models.Model):
name = models.CharField(max_length=10)
references = models.ManyToManyField('self')
related = models.Many... |
bb27aa9962020f316b5a5f453b054c4d067f86ce3a324752852da1fe5ffd090d | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('migrations', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='ipaddressfield',
name='ip',
),
]
|
8dff28a8efe3f81753b3088cbbe878c8a8b56944d2b7491e2787c95ab17c1c57 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='IPAddressField',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary... |
cef88c0f8a0f93350719e440fd579c8b1271db6b33e426f15e39285d27749ed6 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.CreateModel(
"Book",
[
("id", models.AutoField(primary_key=True)),
("autho... |
1f0a89460b680c53851966eae5391a9761523fd8023050a2624f1c9bf915d185 | from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Salamander",
[
("id", models.AutoField(primary_key=True)),
("size", models.IntegerField(default=0)),
("silly_fie... |
2099a345973eb6854c764ac5fb5ea355b4591f98d9aef6c8c22d7502d584fc7a | from django.db import migrations, models
class Migration(migrations.Migration):
"""
This is a wee bit crazy, but it's just to show that run_before works.
"""
dependencies = [
("migrations", "0001_initial"),
]
run_before = [
("migrations", "0002_second"),
]
operations... |
b86b6ce7c80c7672cef72837fe9fd077b1ff2d9929becf9558d7adeb3779598f | from django.db import migrations, models
class Migration(migrations.Migration):
initial = False
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
... |
bcba71c410b4f74004b7c97fc4290420b770c717fd0e3d7c159d6bf1829c82b8 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("auth", "__first__"),
]
operations = [
migrations.CreateModel(
"Book",
[
("id", models.AutoField(primary_key=True)),
("user", models.... |
9b1f5bc126f9162e1a237301f097ab04a6c2096fccdd1063031670b33f32cebb | from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
("slug", mode... |
3ab741f3f83e02c186ac8268c0b55aade0a5e20a7f7979c9bdc60cf87b072bb5 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "thefirst"),
("migrations2", "0002_second"),
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author", "silly_field"),
mig... |
50df7ac222012020d6d59be4d06efcdbdb9b8ac87442f53c7ce4ce5962e3c45c | from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
"Author",
[
("id",... |
2194d40f3a0a0269ea8207cf0ce6c6bf4e5f46bcf583bf6c144379c10dad6947 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author", "silly_field"),
migrations.AddField("Author", "rating",... |
71877b259f567e40edf7a5092238b1c4b20bde3b636acfdbabc5a2fab0086321 | from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
... |
39207b3321a027811d9b31e405b4d4d50e8865c2cf7562623c6c596064098b9d | from django.db import migrations, models
def raise_error(apps, schema_editor):
# Test operation in non-atomic migration is not wrapped in transaction
Publisher = apps.get_model('migrations', 'Publisher')
Publisher.objects.create(name='Test Publisher')
raise RuntimeError('Abort migration')
class Migr... |
273c3c52849663f93358228c1ee10d21987508b7ee77a93664331e4b798066cb | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "5_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
8acd16fe188b7345e539414b331aaade71ed1f1f9abfd4462dffdd7f649de6c9 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "1_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
9ca020b85d134e7f5490ceac10e1e69844dc5ca7b670d290e43e169834093ffd | from django.db import migrations
class Migration(migrations.Migration):
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
914e584aed56f82d29728d210f1d715f27e643ead758dade73771d77f013716b | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "3_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
4984e5b610217bca8d1034aad66a963fe3ba13514e606fa9055f0f72b71e4f65 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "4_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
69cd7b730a41d545a1ec444a387be99dbd252eeb7a51d49fd309d299f1f96f81 | from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("migrations", "3_auto"),
("migrations", "4_auto"),
("migrations", "5_auto"),
]
dependencies = [("migrations", "2_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noo... |
0c0c461143327db7edc3dd6f75db2ad98273208aeb5962993bcb043a2d9ecead | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "6_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
935a01685a7342127463e1945edc64c2ce1d459991ce58c07f97ca16ea416476 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "2_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
43307f6730ae5481b16e4a4255f615952288a1df874920e25d7efbcd4bae2dac | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author", "silly_field"),
migrations.AddField("Author", "rating", models.IntegerField(default=0)),
... |
eef7e6c1bfd6d80aa396928d85d1550e8569d744bf001b6f28ff6fcd21381607 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("migrations", "0001_initial")]
operations = [
migrations.CreateModel(
"Something",
[
("id", models.AutoField(primary_key=True)),
],
)
]
|
5216fd559859ded0746c68de123f1faaa8ee2a5bb979e70b677d34fa0a8c1d09 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("migrations", "0001_initial")]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author", "silly_field"),
migrations.AddField("Author", "rating", models.Integer... |
571e89cd56d59fbd79e47b77d0761f9558d1b8d653d6a4fa98635edb70dacb6e | from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("migrations", "0001_initial"),
("migrations", "0002_second"),
]
|
eb464b0444f56407c92476fbae4de176b74540c712c816f03d65ed61d8203157 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "0001_initial")]
|
944cbcd2c079d80f8a63b3af673447f2325e70693cf447552b206141a7591041 | from django.db import migrations
class Migration(migrations.Migration):
pass
|
fcc3462a4479b0fd5a48cd30c01bfec2f1d3e9bd5ea98ced0275597bd11c77d5 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "0002_second")]
|
f729375fce54fab6db765aed2a9f445fe8a240c2c68bcd06e0f964daffaf2a9d | from django.db import migrations
class Migration(migrations.Migration):
initial = True
operations = [
]
|
ed935d90416bcd565d25ca534cad9d732fabd286209c9a042d6aa247afda4967 | from django.db import migrations, models
class Migration(migrations.Migration):
replaces = [
("migrations", "0001_initial"),
("migrations", "0002_second"),
]
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primar... |
b6c04cdb7aa80c5c8e8bce45279550bf391830516af0f618ed70e3619d65a2fa | from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.AddField("Author", "rating", models.IntegerField(default=0)),
migrations.CreateModel(
"Book... |
dde2a3547d3dcbc7cfa9020f644c55491511bc81b318e3842cf3787a97cd0366 | from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
... |
60964300e70b2972f7d82e9f95b6562d6d3bfb0059abdb37de8fbc3a6bd342bd | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='SillyModel',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key... |
0c030ec6c6fe43c04d3c00d04e2b74b886e0867ce69fa561315ea914d250099f | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('migrations', '0002_second'),
]
operations = [
migrations.CreateModel(
name='ModelWithCustomBase',
fields=[
('id', models.AutoField(verbose_name='ID',... |
8ef0af34dee73fc54a9eacb8885cd626f1b97bc74d8b185a8c0868382aa585ce | from django.db import migrations, models
def raise_error(apps, schema_editor):
# Test atomic operation in non-atomic migration is wrapped in transaction
Editor = apps.get_model('migrations', 'Editor')
Editor.objects.create(name='Test Editor')
raise RuntimeError('Abort migration')
class Migration(mig... |
4aff531ae122bc2b2ce2fc57e471506a63e1de72dbb8f8bbb1152610a7f208c6 | from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("migrations", "0001_initial"),
]
operations = [
migrations.AddField(
model_name='task',
name='projects',
field=models.ManyToManyField(... |
14c02e844de1b3112ca8764e3a6778ad93a43c648a9084057f3e09b8e87b7911 | from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Project',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fa... |
cee11f4a9548907d32e876b6fcb82efeecc3f64cfe4100c0a7594faa6de977e2 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [('migrations', '0001_initial')]
operations = []
|
5fc36f7dc6d77b49cabeb5a3b1f2129942a966f56b8d14f8e2ec63b8daa8740c | from django.db import migrations
class Migration(migrations.Migration):
operations = []
|
1f70aebcde2fe011c91ff94332a82ccf8dde3d258b2bfd37fd2b676dacee1681 | from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
operations = [
migrations.CreateModel(
name='Entry',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
... |
dfff0a55f2ff9304aa21c92664134707b8ae33927889ec4cca3ba8160d7fbc42 | from django.db import models
class OtherAuthor(models.Model):
id = models.AutoField(primary_key=True)
name = models.CharField(max_length=255)
slug = models.SlugField(null=True)
age = models.IntegerField(default=0)
silly_field = models.BooleanField(default=False)
class Meta:
app_label ... |
de40a52b9fa79af5a1e44c0c6a4d54b0d8334600703052b05f5eb294e1842711 | from django.db import models
class SillyModel(models.Model):
silly_field = models.BooleanField(default=False)
silly_tribble = models.ForeignKey("migrations.Tribble", models.CASCADE)
is_trouble = models.BooleanField(default=True)
|
45e51881f60e9f83c1dff5983aa3a82f0c873e20db3658a0230e608922b67bb8 | from django.db import models
class B1(models.Model):
pass
class B2(models.Model):
a1 = models.ForeignKey('lookuperror_a.A1', models.CASCADE)
class B3(models.Model):
pass
|
7663acb14b8845ce31de46da61ef246351990e392092d5078f16f89f5a56e05e | from django.db import models
class A1(models.Model):
pass
class A2(models.Model):
pass
class A3(models.Model):
b2 = models.ForeignKey('lookuperror_b.B2', models.CASCADE)
c2 = models.ForeignKey('lookuperror_c.C2', models.CASCADE)
class A4(models.Model):
pass
|
f0bcc395e9f8f9ee1511ccfaba4b94f7d84d3f579c5d8b5358a00925000df221 | from django.db import models
class C1(models.Model):
pass
class C2(models.Model):
a1 = models.ForeignKey('lookuperror_a.A1', models.CASCADE)
class C3(models.Model):
pass
|
218a1343b729cb948122023a6e993c3776c2869724dc349092e76c915e5b32e3 | from django.db import models
class Classroom(models.Model):
pass
class Lesson(models.Model):
classroom = models.ForeignKey(Classroom, on_delete=models.CASCADE)
|
fe85ad90bf310fcfd7ced83bc3a6eb04e2c8d214597d7e27e03de82fa64a0d5a | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('author_app', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Book',
fields=[
('id', models.AutoField(serialize=False, auto_created=Tr... |
5e85698203c2ffdf53fffe213aafa7d179aa5368ae5065b29e02b491ffa38a63 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('author_app', '0001_initial'),
('book_app', '0001_initial'), # Forces the book table to alter the FK
]
operations = [
migrations.AlterField(
model_name='author',
... |
1ae21278132e32f6cc1d3f9181c97431be61524d46fa5271504344715a74def6 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, primary_key=True)),
... |
30e58ad7932db05f4eb6c8f1fe93ec8f2094fa5a1b70e5eaede4cf978e9f5b88 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("unspecified_app_with_conflict", "0001_initial")]
operations = [
migrations.CreateModel(
"Something",
[
("id", models.AutoField(primary_key=True)),
],... |
014c41b46e09035f2481fe16bdd2c3a7262c4a43bb0da4688b2c434ce45426e7 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("unspecified_app_with_conflict", "0001_initial")]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author", "silly_field"),
migrations.AddField("Author", "rati... |
6e82e7d87b95934dc9c97ed2a4fbb344170e0713d8f5a936486e6595f3eb2f25 | from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"OtherAuthor",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
("slug",... |
472ce2f76d4c7ffdbb9d058f12cf169aa147f6efb77bb19e5113254531e4291b | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("conflicting_app_with_dependencies", "0001_initial"),
]
operations = [
migrations.CreateModel(
"Something",
[
("id", models.AutoField(primary_key=True... |
bab779dfd5c3a29a4956370c21ce902841d6a0241a85739a175bd09ee2edbcda | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("conflicting_app_with_dependencies", "0001_initial"),
("migrated_app", "0001_initial"),
]
operations = [
migrations.DeleteModel("Tribble"),
migrations.RemoveField("Author", "... |
e59ddc4f93a4c219166d45c5c222d17e3c8abaa6899931242937d2de075d7b15 | from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name", models.CharField(max_length=255)),
("slug", model... |
e291e180390d95fe80ba35d5512f96525c29eb7d6ee05d8ca1fa53616376da7d | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mutate_state_b', '0001_initial'),
]
operations = [
migrations.SeparateDatabaseAndState([], [
migrations.CreateModel(
name='A',
fields=[
... |
b4ebd13ea1fe35a11a11c92814fe2e863f5519e4c6bce7b8687ac31132b00eeb | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_a', '0002_a2'),
('lookuperror_b', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='B2',
fields=[
('id', models.Aut... |
7003b358ef4db77e396f801e9668947ad87b9cc4eebeb66597311df2e2b5dbf4 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_b', '0002_b2'),
]
operations = [
migrations.CreateModel(
name='B3',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, ... |
4dae635004629950f89875ada34560aeb600b06123976ac0e7db990a9bb979db | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='B1',
fields=[
('id', models.AutoField(serialize=False, auto_created=True, primary_key=True, verbose_name='ID')),... |
3db7d0d071da1d59e410d2669d50d2cf98eaf2737bdf09eb04709290cde3d63e | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_a', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='A2',
fields=[
('id', models.AutoField(verbose_name='ID', primary_key=... |
c8ca715113e9f891f2c2fbd1420d6d0c535f525bc5139a1fec166b34e5ff42cd | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_a', '0003_a3'),
]
operations = [
migrations.CreateModel(
name='A4',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, ... |
662c8fc5bdae5638f928ba0e72944f80e6b651422d464f589f85ddc19f729fb7 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='A1',
fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)),... |
83f8ed42cd4abdcfd1691edde39b2725b8964e91e24aa55e9c94bcac763d1481 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_c', '0002_c2'),
('lookuperror_b', '0002_b2'),
('lookuperror_a', '0002_a2'),
]
operations = [
migrations.CreateModel(
name='A3',
fields=[
... |
296e70a80993d33ada1f0df8308eeb373c4aa33f6051172d8f16eb3e894ddb38 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mutate_state_b', '0001_initial'),
]
operations = [
migrations.SeparateDatabaseAndState([], [
migrations.AddField(
model_name='B',
name='added',
... |
3cd9c52a15f386a173029be9e82daabea10c0cced32cf4d42483fda39b622ed3 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.SeparateDatabaseAndState([], [
migrations.CreateModel(
name='B',
fields=[
('id', models.AutoField(serialize... |
f8ea4fae77f8fe49606ab7658bcc88a77ab93d5eaa9c1073116feeadf31cfe22 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_a', '0002_a2'),
('lookuperror_c', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='C2',
fields=[
('id', models.Aut... |
d7cf8f7b1bde986fdc42b081391952f3cdf5848b6b5abb4f32d64acd4beda54c | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('lookuperror_c', '0002_c2'),
]
operations = [
migrations.CreateModel(
name='C3',
fields=[
('id', models.AutoField(auto_created=True, serialize=False, ... |
bbd236542bdcf9078546d308a72a3ebd3380df2659f4b60b91d0043df68ef499 | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='C1',
fields=[
('id', models.AutoField(serialize=False, verbose_name='ID', auto_created=True, primary_key=True)),... |
bb45591d82a77512328621db2bfac8b8fa1c26069f2cc09d79bcd307b2760151 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "1_auto")]
|
8ffaabb36a3c9f60ca05dc9e474f621be3d393c45f173ddc71e26b602e7ef113 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "2_squashed_3")]
|
7f6061c65da8c79eabe4444b4b6c0c00f7a98cd66c8bc87496cf65bc8e698f30 | from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("app1", "2_auto"),
("app1", "3_auto"),
]
dependencies = [("app1", "1_auto"), ("app2", "1_squashed_2")]
|
89c6397acac7b951c1e78c6308f6d6923752cda330d95568d60122fcce5bbb2e | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "2_auto"), ("app2", "2_auto")]
|
764e9b586db92564541ab56f8c7dfe85590dc1be46097a9de1fa4d37a4fc8087 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app2", "1_auto")]
|
1968c0b17e1c6e5dd412c9706cc5cc1ada4ae022311bf587f3dd10ca69ab2bb8 | from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("app2", "1_auto"),
("app2", "2_auto"),
]
dependencies = [("app1", "1_auto")]
|
f8258ed5f283a81847f97fdbf07857ac4251493e6da31d9a3c99502052b97d4b | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "1_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
cf21708a57511b448941fbdd7d8c662c66e64dcd9ecb292489609123960f1ea9 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "3_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
89441f334d5349dc0ada2bb82cd1fc103561f2370fe6deefa8abf4ebcdaad3d4 | from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("app1", "2_auto"),
("app1", "3_auto"),
]
dependencies = [("app1", "1_auto"), ("app2", "2_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
c48d2b8db9fe48cff8ccb837941723c7a77d67884ca9ebff5684bc69052b74d2 | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app1", "2_auto"), ("app2", "2_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
5111b3340cbcee03a7964575ef3a1b7b81495ffa88707fb90fbff78f5e79692b | from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("app2", "1_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
ff9594d03e03aeb66486fcb880a78bd02242980fba4420b4eccac66dc34161c5 | from django.db import migrations
class Migration(migrations.Migration):
replaces = [
("app2", "1_auto"),
("app2", "2_auto"),
]
dependencies = [("app1", "1_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
f9d4e3d5ae793a7f570d07e4a9599ab569901de80b34c4be4fdffd836b93d84a | from django.template import Library
register = Library()
|
f3a56cc84abb33af070ba71ddb05871d063dfa597bc52d4745dd63ff498a5394 | import DoesNotExist # noqa
|
c5a9207f414f25c41f37685cef127f17c77e4024fbb16acb4102237531014966 | from .custom_permissions import CustomPermissionsUser
from .custom_user import (
CustomUser, CustomUserWithoutIsActiveField, ExtensionUser,
)
from .invalid_models import CustomUserNonUniqueUsername
from .is_active import IsActiveTestUser1
from .minimal import MinimalUser
from .uuid_pk import UUIDUser
from .with_for... |
6c30e410efac029ce8626ed89c557618e5133e8464a855a4a592a6c03ca71517 | from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom user uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
# changes ... |
a4b78c52d7d7eca77a643ba9b5e2e9fab32570474c92c638c5454f54573a19a7 | """
The CustomPermissionsUser users email as the identifier, but uses the normal
Django permissions model. This allows us to check that the PermissionsMixin
includes everything that is needed to interact with the ModelBackend.
"""
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.db ... |
0d858cf1a8580d84a7db2d4a13d25a2aad8c6c2e4d5c3ee0eee5d933eecab787 | import uuid
from django.contrib.auth.models import AbstractUser
from django.db import models
from .custom_user import RemoveGroupsAndPermissions
with RemoveGroupsAndPermissions():
class UUIDUser(AbstractUser):
"""A user with a UUID as primary key"""
id = models.UUIDField(default=uuid.uuid4, prima... |
d4b54517baf24c56e0ef4558aa2a18a524b5ed6b5f5a1a157b4564b61d53f311 | from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.db import models
class IsActiveTestUser1(AbstractBaseUser):
"""
This test user class and derivatives test the default is_active behavior
"""
username = models.CharField(max_length=30, unique=True)
custom_objects ... |
2cdf56a2805388d10336e17f424ba243a3e7a0bf856a75d73f39e1c552f4e024 | from django.contrib.auth.base_user import AbstractBaseUser
from django.contrib.auth.models import BaseUserManager
from django.db import models
class CustomEmailFieldUserManager(BaseUserManager):
def create_user(self, username, password, email):
user = self.model(username=username)
user.set_passwor... |
8ce1b31e4f793b4f6c71f7498d75f96bcab16764548f658bd13c7fc336ada654 | from django.db import models
class MinimalUser(models.Model):
REQUIRED_FIELDS = ()
USERNAME_FIELD = 'id'
|
cbcc07260e06dc8961a1f9d15fa0a572051d4e41018742ee78fc6d7014a44f97 | from django.contrib.auth.base_user import AbstractBaseUser
class UserWithDisabledLastLoginField(AbstractBaseUser):
last_login = None
|
79d69b44327912482593ea2db200241b27b1fda8e2eca324b78d2a204f4469fd | from django.contrib.auth.models import AbstractBaseUser, BaseUserManager, Group
from django.db import models
class Email(models.Model):
email = models.EmailField(verbose_name='email address', max_length=255, unique=True)
class CustomUserWithFKManager(BaseUserManager):
def create_superuser(self, username, em... |
92a5e88707fbe2ef7fc8ba1cd386b5ca03204b4f04fbda11b645add2a0ec924e | from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.db import models
class CustomUserNonUniqueUsername(AbstractBaseUser):
"""
A user with a non-unique username.
This model is not invalid if it is used with a custom authentication
backend which supports non-unique username... |
ff99365fc26320f17a8823e7bc12c4c822f4f7c4ce5fcfc1c78c1ab0a09bd514 | from django.contrib.auth.models import AbstractBaseUser, BaseUserManager
from django.db import models
class IntegerUsernameUserManager(BaseUserManager):
def create_user(self, username, password):
user = self.model(username=username)
user.set_password(password)
user.save(using=self._db)
... |
521c474be2ec2f92a63652cef9d25bab36bfb36b48a8425854b62bfbce332160 | # Import all the models from subpackages
from .article import Article
from .publication import Publication
__all__ = ['Article', 'Publication']
|
6d952c345310f86f6c9cd110988e0008392b3ac236de723c6a70b48fdf7bf540 | from django.db import models
class Publication(models.Model):
title = models.CharField(max_length=30)
|
f2ea3d593e4bb447d9cdda19406a8a91051fdb272c8ff981ee52861332d8348f | from django.db import models
class Site(models.Model):
name = models.CharField(max_length=100)
class Article(models.Model):
sites = models.ManyToManyField(Site)
headline = models.CharField(max_length=100)
publications = models.ManyToManyField("model_package.Publication", blank=True)
|
9265199f164dd9104d6db178f98f38ccf3ade928f0c49a88f777d8dfa9c74d22 | """
Doctest example from the official Python documentation.
https://docs.python.org/3/library/doctest.html
"""
def factorial(n):
"""Return the factorial of n, an exact integer >= 0.
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30) # doctest: +ELLIPSIS
2652528598121910... |
88b7e54d09f4f67044f6f0afbd7e7724a7e915a1f53a799b437958f789db21c3 | import doctest
from unittest import TestCase
from django.test import SimpleTestCase, TestCase as DjangoTestCase
from . import doctests
class TestVanillaUnittest(TestCase):
def test_sample(self):
self.assertEqual(1, 1)
class TestDjangoTestCase(DjangoTestCase):
def test_sample(self):
self.... |
d04c7f6349660b458357e81d27435688d70f390d97d5492acb631fc63c157aef | from unittest import TestCase
class Test(TestCase):
def test_sample(self):
self.assertEqual(1, 1)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.