-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow users to edit Version's
identifier
and/or slug
This is an initial POC to test the minimal implementation that we discussed in readthedocs/meta#147 (comment). The main goals here are: - Keep all the user/original values separated from the real `Version` - Do not update edited `Version` with values from VCS - Keep syncing code working properly - Make the minimal changes to prove this idea is possible
- Loading branch information
Showing
4 changed files
with
96 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
readthedocs/builds/migrations/0060_change_slug_identifier.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by Django 4.2.16 on 2024-12-02 15:05 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django_extensions.db.fields | ||
from django_safemigrate import Safe | ||
|
||
|
||
class Migration(migrations.Migration): | ||
safe = Safe.before_deploy | ||
|
||
dependencies = [ | ||
('builds', '0059_add_version_date_index'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='VersionOverride', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')), | ||
('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')), | ||
('original_slug', models.CharField(blank=True, max_length=255, null=True)), | ||
('user_slug', models.CharField(blank=True, max_length=255, null=True)), | ||
('original_identifier', models.CharField(blank=True, max_length=255, null=True)), | ||
('user_identifier', models.CharField(blank=True, max_length=255, null=True)), | ||
('version', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='override', to='builds.version')), | ||
], | ||
options={ | ||
'get_latest_by': 'modified', | ||
'abstract': False, | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters