-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support specifying metadata in DatabaseFlagsSource
This change supports specifying metadata in the DatabaseFlagsSource by using a FlagMetadata model. It also modifies the DatabaseFlagSource to return a three-tuple instead of the dict that was deprecated in b1a752f.
- Loading branch information
1 parent
e454cdb
commit 2a319db
Showing
10 changed files
with
153 additions
and
22 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
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 |
---|---|---|
@@ -1,11 +1,16 @@ | ||
from django.contrib import admin | ||
|
||
from flags.forms import FlagStateForm | ||
from flags.models import FlagState | ||
from flags.forms import FlagMetadataForm, FlagStateForm | ||
from flags.models import FlagMetadata, FlagState | ||
|
||
|
||
class FlagMetadataAdmin(admin.ModelAdmin): | ||
form = FlagMetadataForm | ||
|
||
|
||
class FlagStateAdmin(admin.ModelAdmin): | ||
form = FlagStateForm | ||
|
||
|
||
admin.site.register(FlagMetadata, FlagMetadataAdmin) | ||
admin.site.register(FlagState, FlagStateAdmin) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Generated by Django 2.2.12 on 2020-05-28 20:37 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('flags', '0013_add_required_field'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='FlagMetadata', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('name', models.CharField(max_length=64)), | ||
('key', models.CharField(max_length=64)), | ||
('value', models.TextField()), | ||
], | ||
options={ | ||
'unique_together': {('name', 'key')}, | ||
}, | ||
), | ||
] |
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
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
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