Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
c0bba714
Commit
c0bba714
authored
Jul 06, 2012
by
Bridger Maxwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a migration to unique article slugs.
parent
5489819f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
lms/djangoapps/simplewiki/migrations/0002_unique_slugs.py
+3
-7
No files found.
lms/djangoapps/simplewiki/migrations/0002_unique_slugs.py
View file @
c0bba714
...
@@ -16,6 +16,7 @@ class Migration(DataMigration):
...
@@ -16,6 +16,7 @@ class Migration(DataMigration):
while
new_name
in
unique_slugs
:
while
new_name
in
unique_slugs
:
i
+=
1
i
+=
1
new_name
=
article
.
slug
+
str
(
i
)
new_name
=
article
.
slug
+
str
(
i
)
print
"Changing"
,
article
.
slug
,
"to"
,
new_name
article
.
slug
=
new_name
article
.
slug
=
new_name
article
.
save
()
article
.
save
()
...
@@ -87,14 +88,14 @@ class Migration(DataMigration):
...
@@ -87,14 +88,14 @@ class Migration(DataMigration):
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
})
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
})
},
},
'simplewiki.article'
:
{
'simplewiki.article'
:
{
'Meta'
:
{
'unique_together'
:
"(('slug', '
namespace
'),)"
,
'object_name'
:
'Article'
},
'Meta'
:
{
'unique_together'
:
"(('slug', '
parent
'),)"
,
'object_name'
:
'Article'
},
'created_by'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['auth.User']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'created_by'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['auth.User']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'created_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'1'
,
'blank'
:
'True'
}),
'created_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'1'
,
'blank'
:
'True'
}),
'current_revision'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'current_rev'"
,
'unique'
:
'True'
,
'null'
:
'True'
,
'to'
:
"orm['simplewiki.Revision']"
}),
'current_revision'
:
(
'django.db.models.fields.related.OneToOneField'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'current_rev'"
,
'unique'
:
'True'
,
'null'
:
'True'
,
'to'
:
"orm['simplewiki.Revision']"
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'locked'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'locked'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'modified_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'1'
,
'blank'
:
'True'
}),
'modified_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'1'
,
'blank'
:
'True'
}),
'
namespace'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['simplewiki.Namespace']"
}),
'
parent'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['simplewiki.Article']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'permissions'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['simplewiki.Permission']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'permissions'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['simplewiki.Permission']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'related'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'related_rel_+'"
,
'null'
:
'True'
,
'to'
:
"orm['simplewiki.Article']"
}),
'related'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'related_rel_+'"
,
'null'
:
'True'
,
'to'
:
"orm['simplewiki.Article']"
}),
'slug'
:
(
'django.db.models.fields.SlugField'
,
[],
{
'max_length'
:
'100'
,
'blank'
:
'True'
}),
'slug'
:
(
'django.db.models.fields.SlugField'
,
[],
{
'max_length'
:
'100'
,
'blank'
:
'True'
}),
...
@@ -108,11 +109,6 @@ class Migration(DataMigration):
...
@@ -108,11 +109,6 @@ class Migration(DataMigration):
'uploaded_by'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['auth.User']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'uploaded_by'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['auth.User']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'uploaded_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'True'
,
'blank'
:
'True'
})
'uploaded_on'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'True'
,
'blank'
:
'True'
})
},
},
'simplewiki.namespace'
:
{
'Meta'
:
{
'object_name'
:
'Namespace'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'30'
,
'db_index'
:
'True'
})
},
'simplewiki.permission'
:
{
'simplewiki.permission'
:
{
'Meta'
:
{
'object_name'
:
'Permission'
},
'Meta'
:
{
'object_name'
:
'Permission'
},
'can_read'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'read'"
,
'null'
:
'True'
,
'symmetrical'
:
'False'
,
'to'
:
"orm['auth.User']"
}),
'can_read'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'read'"
,
'null'
:
'True'
,
'symmetrical'
:
'False'
,
'to'
:
"orm['auth.User']"
}),
...
...
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