-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adds a LicenseTransferJob model and admin
Also installs django-autocomplete-light for help to support advanced admin autocomplete field filtering, and therefore runs make upgrade to pull in some other new package versions.
- Loading branch information
1 parent
9335ec3
commit 763a33b
Showing
19 changed files
with
665 additions
and
83 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
70 changes: 70 additions & 0 deletions
70
license_manager/apps/subscriptions/migrations/0062_add_license_transfer_job.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,70 @@ | ||
# Generated by Django 4.2.6 on 2023-10-23 20:03 | ||
|
||
from django.conf import settings | ||
import django.core.serializers.json | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import django.utils.timezone | ||
import model_utils.fields | ||
import simple_history.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('subscriptions', '0061_auto_20230927_1119'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='LicenseTransferJob', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), | ||
('completed_at', models.DateTimeField(blank=True, help_text='The time at which the job was successfully processed.', null=True)), | ||
('notes', models.TextField(blank=True, help_text='Say something about why the licenses are being transferred.', null=True)), | ||
('is_dry_run', models.BooleanField(default=False)), | ||
('delimiter', models.CharField(choices=[('newline', 'Newline character'), ('comma', 'Comma character'), ('pipe', 'Pipe character')], default='newline', max_length=8)), | ||
('license_uuids_raw', models.TextField(help_text='Delimitted list of license_uuids to transfer')), | ||
('processed_results', models.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, help_text='Raw results of what licenses were changed, either in dry-run form, or actual form.', null=True)), | ||
('customer_agreement', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='license_transfer_jobs', to='subscriptions.customeragreement')), | ||
('new_subscription_plan', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='license_transfer_jobs_new', to='subscriptions.subscriptionplan')), | ||
('old_subscription_plan', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='license_transfer_jobs_old', to='subscriptions.subscriptionplan')), | ||
], | ||
options={ | ||
'verbose_name': 'License Transfer Job', | ||
'verbose_name_plural': 'License Transfer Jobs', | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='HistoricalLicenseTransferJob', | ||
fields=[ | ||
('id', models.IntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')), | ||
('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')), | ||
('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')), | ||
('completed_at', models.DateTimeField(blank=True, help_text='The time at which the job was successfully processed.', null=True)), | ||
('notes', models.TextField(blank=True, help_text='Say something about why the licenses are being transferred.', null=True)), | ||
('is_dry_run', models.BooleanField(default=False)), | ||
('delimiter', models.CharField(choices=[('newline', 'Newline character'), ('comma', 'Comma character'), ('pipe', 'Pipe character')], default='newline', max_length=8)), | ||
('license_uuids_raw', models.TextField(help_text='Delimitted list of license_uuids to transfer')), | ||
('processed_results', models.JSONField(blank=True, encoder=django.core.serializers.json.DjangoJSONEncoder, help_text='Raw results of what licenses were changed, either in dry-run form, or actual form.', null=True)), | ||
('history_id', models.AutoField(primary_key=True, serialize=False)), | ||
('history_date', models.DateTimeField()), | ||
('history_change_reason', models.CharField(max_length=100, null=True)), | ||
('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)), | ||
('customer_agreement', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscriptions.customeragreement')), | ||
('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)), | ||
('new_subscription_plan', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscriptions.subscriptionplan')), | ||
('old_subscription_plan', models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to='subscriptions.subscriptionplan')), | ||
], | ||
options={ | ||
'verbose_name': 'historical License Transfer Job', | ||
'verbose_name_plural': 'historical License Transfer Jobs', | ||
'ordering': ('-history_date', '-history_id'), | ||
'get_latest_by': ('history_date', 'history_id'), | ||
}, | ||
bases=(simple_history.models.HistoricalChanges, models.Model), | ||
), | ||
] |
Oops, something went wrong.