Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-wiki
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-wiki
Commits
9ca892d8
Commit
9ca892d8
authored
Feb 23, 2013
by
benjaoming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not use URLField, it does not allow relative paths
parent
7ec137f8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
96 additions
and
2 deletions
+96
-2
django_notify/management/commands/notifymail.py
+2
-1
django_notify/migrations/0004_auto__chg_field_notification_url.py
+92
-0
django_notify/models.py
+2
-1
No files found.
django_notify/management/commands/notifymail.py
View file @
9ca892d8
...
@@ -43,7 +43,8 @@ class Command(BaseCommand):
...
@@ -43,7 +43,8 @@ class Command(BaseCommand):
subject
,
message
,
notify_settings
.
EMAIL_SENDER
,
subject
,
message
,
notify_settings
.
EMAIL_SENDER
,
[
context
[
'user'
]
.
email
],
connection
=
connection
[
context
[
'user'
]
.
email
],
connection
=
connection
)
)
email
.
send
()
logger
.
info
(
"Sending to:
%
s"
%
context
[
'user'
]
.
email
)
email
.
send
(
fail_silently
=
False
)
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
...
...
django_notify/migrations/0004_auto__chg_field_notification_url.py
0 → 100644
View file @
9ca892d8
# -*- coding: utf-8 -*-
import
datetime
from
south.db
import
db
from
south.v2
import
SchemaMigration
from
django.db
import
models
class
Migration
(
SchemaMigration
):
def
forwards
(
self
,
orm
):
# Changing field 'Notification.url'
db
.
alter_column
(
'notify_notification'
,
'url'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
200
,
null
=
True
))
def
backwards
(
self
,
orm
):
# Changing field 'Notification.url'
db
.
alter_column
(
'notify_notification'
,
'url'
,
self
.
gf
(
'django.db.models.fields.URLField'
)(
max_length
=
200
,
null
=
True
))
models
=
{
'auth.group'
:
{
'Meta'
:
{
'object_name'
:
'Group'
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'80'
}),
'permissions'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Permission']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
})
},
'auth.permission'
:
{
'Meta'
:
{
'ordering'
:
"('content_type__app_label', 'content_type__model', 'codename')"
,
'unique_together'
:
"(('content_type', 'codename'),)"
,
'object_name'
:
'Permission'
},
'codename'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'content_type'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['contenttypes.ContentType']"
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'50'
})
},
'auth.user'
:
{
'Meta'
:
{
'object_name'
:
'User'
},
'date_joined'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'email'
:
(
'django.db.models.fields.EmailField'
,
[],
{
'max_length'
:
'75'
,
'blank'
:
'True'
}),
'first_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'30'
,
'blank'
:
'True'
}),
'groups'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Group']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'is_active'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'True'
}),
'is_staff'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'is_superuser'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'last_login'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'last_name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'30'
,
'blank'
:
'True'
}),
'password'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'128'
}),
'user_permissions'
:
(
'django.db.models.fields.related.ManyToManyField'
,
[],
{
'to'
:
"orm['auth.Permission']"
,
'symmetrical'
:
'False'
,
'blank'
:
'True'
}),
'username'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'30'
})
},
'contenttypes.contenttype'
:
{
'Meta'
:
{
'ordering'
:
"('name',)"
,
'unique_together'
:
"(('app_label', 'model'),)"
,
'object_name'
:
'ContentType'
,
'db_table'
:
"'django_content_type'"
},
'app_label'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'model'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
})
},
'django_notify.notification'
:
{
'Meta'
:
{
'ordering'
:
"('-id',)"
,
'object_name'
:
'Notification'
,
'db_table'
:
"'notify_notification'"
},
'created'
:
(
'django.db.models.fields.DateTimeField'
,
[],
{
'auto_now_add'
:
'True'
,
'blank'
:
'True'
}),
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'is_emailed'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'is_viewed'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'message'
:
(
'django.db.models.fields.TextField'
,
[],
{}),
'occurrences'
:
(
'django.db.models.fields.PositiveIntegerField'
,
[],
{
'default'
:
'1'
}),
'subscription'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['django_notify.Subscription']"
,
'null'
:
'True'
,
'on_delete'
:
'models.SET_NULL'
,
'blank'
:
'True'
}),
'url'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'200'
,
'null'
:
'True'
,
'blank'
:
'True'
})
},
'django_notify.notificationtype'
:
{
'Meta'
:
{
'object_name'
:
'NotificationType'
,
'db_table'
:
"'notify_notificationtype'"
},
'content_type'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['contenttypes.ContentType']"
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'key'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'128'
,
'primary_key'
:
'True'
}),
'label'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'128'
,
'null'
:
'True'
,
'blank'
:
'True'
})
},
'django_notify.settings'
:
{
'Meta'
:
{
'object_name'
:
'Settings'
,
'db_table'
:
"'notify_settings'"
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'interval'
:
(
'django.db.models.fields.SmallIntegerField'
,
[],
{
'default'
:
'0'
}),
'user'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['auth.User']"
})
},
'django_notify.subscription'
:
{
'Meta'
:
{
'object_name'
:
'Subscription'
,
'db_table'
:
"'notify_subscription'"
},
'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'latest'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'latest_for'"
,
'null'
:
'True'
,
'to'
:
"orm['django_notify.Notification']"
}),
'notification_type'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['django_notify.NotificationType']"
}),
'object_id'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'64'
,
'null'
:
'True'
,
'blank'
:
'True'
}),
'send_emails'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'True'
}),
'settings'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
"orm['django_notify.Settings']"
})
}
}
complete_apps
=
[
'django_notify'
]
\ No newline at end of file
django_notify/models.py
View file @
9ca892d8
...
@@ -63,7 +63,8 @@ class Notification(models.Model):
...
@@ -63,7 +63,8 @@ class Notification(models.Model):
subscription
=
models
.
ForeignKey
(
Subscription
,
null
=
True
,
blank
=
True
,
on_delete
=
models
.
SET_NULL
)
subscription
=
models
.
ForeignKey
(
Subscription
,
null
=
True
,
blank
=
True
,
on_delete
=
models
.
SET_NULL
)
message
=
models
.
TextField
()
message
=
models
.
TextField
()
url
=
models
.
URLField
(
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
u'link for notification'
))
url
=
models
.
CharField
(
blank
=
True
,
null
=
True
,
verbose_name
=
_
(
u'link for notification'
),
max_length
=
200
)
is_viewed
=
models
.
BooleanField
(
default
=
False
)
is_viewed
=
models
.
BooleanField
(
default
=
False
)
is_emailed
=
models
.
BooleanField
(
default
=
False
)
is_emailed
=
models
.
BooleanField
(
default
=
False
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
created
=
models
.
DateTimeField
(
auto_now_add
=
True
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment