mirror of
https://github.com/jazzband/django-authority.git
synced 2026-05-23 22:55:48 +00:00
Updated models/migrations.
This commit is contained in:
parent
e4d8f218d5
commit
4adc727778
2 changed files with 8 additions and 8 deletions
|
|
@ -24,10 +24,10 @@ class Migration(migrations.Migration):
|
|||
('approved', models.BooleanField(default=False, help_text='Designates whether the permission has been approved and treated as active. Unselect this instead of deleting permissions.', verbose_name='approved')),
|
||||
('date_requested', models.DateTimeField(default=datetime.datetime.now, verbose_name='date requested')),
|
||||
('date_approved', models.DateTimeField(null=True, verbose_name='date approved', blank=True)),
|
||||
('content_type', models.ForeignKey(related_name='row_permissions', to='contenttypes.ContentType')),
|
||||
('creator', models.ForeignKey(related_name='created_permissions', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
|
||||
('group', models.ForeignKey(blank=True, to='auth.Group', null=True)),
|
||||
('user', models.ForeignKey(related_name='granted_permissions', blank=True, to=settings.AUTH_USER_MODEL, null=True)),
|
||||
('content_type', models.ForeignKey(related_name='row_permissions', to='contenttypes.ContentType', on_delete=models.CASCADE)),
|
||||
('creator', models.ForeignKey(related_name='created_permissions', blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
|
||||
('group', models.ForeignKey(blank=True, to='auth.Group', null=True, on_delete=models.CASCADE)),
|
||||
('user', models.ForeignKey(related_name='granted_permissions', blank=True, to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'permission',
|
||||
|
|
|
|||
|
|
@ -16,15 +16,15 @@ class Permission(models.Model):
|
|||
of any content type.
|
||||
"""
|
||||
codename = models.CharField(_('codename'), max_length=100)
|
||||
content_type = models.ForeignKey(ContentType, related_name="row_permissions")
|
||||
content_type = models.ForeignKey(ContentType, related_name="row_permissions", on_delete=models.CASCADE)
|
||||
object_id = models.PositiveIntegerField()
|
||||
content_object = GenericForeignKey('content_type', 'object_id')
|
||||
|
||||
user = models.ForeignKey(
|
||||
user_model_label, null=True, blank=True, related_name='granted_permissions')
|
||||
group = models.ForeignKey(Group, null=True, blank=True)
|
||||
user_model_label, null=True, blank=True, related_name='granted_permissions', on_delete=models.CASCADE)
|
||||
group = models.ForeignKey(Group, null=True, blank=True, on_delete=models.CASCADE)
|
||||
creator = models.ForeignKey(
|
||||
user_model_label, null=True, blank=True, related_name='created_permissions')
|
||||
user_model_label, null=True, blank=True, related_name='created_permissions', on_delete=models.CASCADE)
|
||||
|
||||
approved = models.BooleanField(
|
||||
_('approved'),
|
||||
|
|
|
|||
Loading…
Reference in a new issue