Opened 18 years ago

Closed 18 years ago

Last modified 13 years ago

#2228 closed enhancement (wontfix)

[patch] Add e-mail and URL to free comments

Reported by: Tyson Tate <tyson@…> Owned by: Adrian Holovaty
Component: contrib.comments Version:
Severity: normal Keywords:
Cc: tyson@… Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Replaces #2184 due to comment spam.

This patch adds the ability for comments to accept a person's e-mail address and/or URL, optionally. This is a feature found in most comment systems and would be very useful in Django.

The current patch doesn't validate e-mail addresses or URLs, because I'm not too sure where I should do that.

Attachments (5)

better_comments.diff (3.9 KB ) - added by Tyson Tate <tyson@…> 18 years ago.
Adds e-mail and URL capability
comment_test.zip (10.8 KB ) - added by Tyson Tate <tyson@…> 18 years ago.
Sample use of free comments with e-mail and URL.
better_comments2.diff (3.9 KB ) - added by Tyson Tate <tyson@…> 18 years ago.
Changed from TextField to proper fields and, by consequence, adds proper error checking
comment_test2.zip (14.4 KB ) - added by Tyson Tate <tyson@…> 18 years ago.
Adds error output for field validation
better_comments3.diff (4.2 KB ) - added by Bjorn Kristinsson 16 years ago.
Simply an update of the diff file for more recent releases.

Download all attachments as: .zip

Change History (21)

by Tyson Tate <tyson@…>, 18 years ago

Attachment: better_comments.diff added

Adds e-mail and URL capability

comment:1 by James Bennett, 18 years ago

EmailField and URLField both have their own validation routines baked in; EmailField makes sure you've entered something that looks like an email address (though it won't email to validate for you; that'd be something that could be developed on a per-case basis), and URLField checks the format of the URL and, by default, hits it to make sure it exists.

comment:2 by Tyson Tate <tyson@…>, 18 years ago

Cc: tyson@… added

I set up a small test app, and was able to enter "x" for all fields (name, e-mail, url, comment), and both e-mail and url were accepted as "x" and displayed as "x". In the database, they were stored as "x".

Is there someplace that I should set-up proper validation? I think it might be handy that, if a developer adds the e-mail and url fields, the fields get validated like the name field is checked for emptiness.

I'll attach my sample project.

by Tyson Tate <tyson@…>, 18 years ago

Attachment: comment_test.zip added

Sample use of free comments with e-mail and URL.

comment:3 by greg[at]abbas.org, 18 years ago

Hi Tyson, +1 from me (FWIW :-) on this, you're absolutely right IMHO that free comments ought to support email address & URL.

Regarding the validation issue, you probably want to change django/contrib/comments/views/comments.py so that it instantiates a forms.URLField and a forms.EmailField, instead of two plain TextFields.

-greg a.

by Tyson Tate <tyson@…>, 18 years ago

Attachment: better_comments2.diff added

Changed from TextField to proper fields and, by consequence, adds proper error checking

by Tyson Tate <tyson@…>, 18 years ago

Attachment: comment_test2.zip added

Adds error output for field validation

comment:4 by Tyson Tate <tyson@…>, 18 years ago

A hah! I knew I was missing something simple. I've uploaded a better patch and an updated comment test project. I've tried messing it up in a number of ways, but it looks pretty fool-proof now.

Thanks, Greg!

comment:5 by hi-world cup, 18 years ago

Cc: hi-world cup added; tyson@… removed
Keywords: rthml tab space editor js added
Summary: [patch] Add e-mail and URL to free commentshi-world cup

comment:6 by Adrian Holovaty, 18 years ago

Cc: hi-world cup removed
Summary: hi-world cup[patch] Add e-mail and URL to free comments

comment:7 by Tyson Tate <tyson@…>, 18 years ago

Cc: tyson@… added
Keywords: rthml tab space editor js removed

Stupid spam. *grumble grumble*

comment:8 by Adrian Holovaty, 18 years ago

Component: Contrib appsdjango.contrib.comments

comment:9 by Simon G. <dev@…>, 18 years ago

Triage Stage: UnreviewedAccepted

comment:10 by Malcolm Tredinnick, 18 years ago

Resolution: wontfix
Status: newclosed

Jacob is rewriting the comments app for 1.0, so it isn't worth applying this and taking the compatibility hit for just one release.

comment:11 by anonymous, 18 years ago

xvcxvxc

comment:12 by anonymous, 18 years ago

Component: django.contrib.commentsDatabase wrapper
Keywords: fitness equipment health and fitness added
Triage Stage: AcceptedDesign decision needed
Version: new-admin

comment:13 by Simon G. <dev@…>, 18 years ago

Keywords: fitness equipment health and fitness removed
Version: new-admin

spam cleanup

comment:14 by Simon G. <dev@…>, 18 years ago

Component: Database wrapperdjango.contrib.comments

comment:16 by Russell Keith-Magee, 17 years ago

Reverted ticket spam

by Bjorn Kristinsson, 16 years ago

Attachment: better_comments3.diff added

Simply an update of the diff file for more recent releases.

comment:17 by Jacob, 13 years ago

milestone: 1.0 beta

Milestone 1.0 beta deleted

Note: See TracTickets for help on using tickets.
Back to Top