mirror of
https://github.com/coddingtonbear/django-mailbox.git
synced 2026-07-10 06:48:19 +02:00
optionable reference to user model
This commit is contained in:
parent
08512ac316
commit
45488cb725
3 changed files with 31 additions and 0 deletions
|
|
@ -43,6 +43,7 @@ resend_message_received_signal.short_description = (
|
||||||
class MailboxAdmin(admin.ModelAdmin):
|
class MailboxAdmin(admin.ModelAdmin):
|
||||||
list_display = (
|
list_display = (
|
||||||
'name',
|
'name',
|
||||||
|
'user',
|
||||||
'uri',
|
'uri',
|
||||||
'from_email',
|
'from_email',
|
||||||
'active',
|
'active',
|
||||||
|
|
|
||||||
23
django_mailbox/migrations/0007_auto_20171105_1015.py
Normal file
23
django_mailbox/migrations/0007_auto_20171105_1015.py
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Generated by Django 1.10.3 on 2017-11-05 09:15
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
|
from django.db import migrations, models
|
||||||
|
import django.db.models.deletion
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
|
('django_mailbox', '0006_mailbox_last_polling'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='mailbox',
|
||||||
|
name='user',
|
||||||
|
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
|
||||||
|
),
|
||||||
|
]
|
||||||
|
|
@ -48,6 +48,13 @@ class ActiveMailboxManager(models.Manager):
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class Mailbox(models.Model):
|
class Mailbox(models.Model):
|
||||||
|
user = models.ForeignKey(
|
||||||
|
django_settings.AUTH_USER_MODEL,
|
||||||
|
blank=True,
|
||||||
|
null=True,
|
||||||
|
default=None
|
||||||
|
)
|
||||||
|
|
||||||
name = models.CharField(
|
name = models.CharField(
|
||||||
_(u'Name'),
|
_(u'Name'),
|
||||||
max_length=255,
|
max_length=255,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue