Re: URLValidator on urls without protocol

2012-11-17 Thread Jared Martin
Yes it indeed was. That was a mistake on my part. I saw it as soon as I 
submitted. Sorry. 

On Nov 17, 2012, at 11:32 PM, Karen Tracey  wrote:

> On Sun, Nov 18, 2012 at 12:21 AM, Jared Martin  wrote:
> I don't mean to wake a dead dog, but what has become of this? I came across 
> this problem today. For now, I've subclassed. But it should be fixed, right?
> 
> 
> Yes, it should be fixed. Per the ticket referenced it was fixed two years 
> ago. The specific scenario showin in the ticket is fixed:
> 
> Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
> [GCC 4.6.3] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import django
> >>> django.get_version()
> '1.4.2'
> >>> from django.forms import URLField
> >>> f = URLField()
> >>> f.clean('www.example.com/://')
> u'http://www.example.com/://'
> >>> 
> 
> So what do you mean, exactly, that you came across it today? What exactly is 
> failing unexpectedly and on what version of Django?
>  
> 
> On Sunday, June 20, 2010 7:35:23 PM UTC-6, Samus_ wrote:
> ticket: http://code.djangoproject.com/ticket/13804
> 
> also found a real-life scenario when this feature of the RFC is implemented, 
> the site reddit.com uses it for a shortcut that searchs/submits links to 
> their website, example:
> http://www.reddit.com/s/http://code.djangoproject.com/ticket/13804
> 
> On Sat, Jun 12, 2010 at 7:42 AM, MIL  wrote:
> I was the guy that brought it up on #django
> And I would like to follow this thread.
> 
> Thanks :o)
> 
> Michael Hjulskov
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django developers" group.
> To post to this group, send email to django-developers@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-developers+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-developers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: URLValidator on urls without protocol

2012-11-17 Thread Karen Tracey
On Sun, Nov 18, 2012 at 12:21 AM, Jared Martin wrote:

> I don't mean to wake a dead dog, but what has become of this? I came
> across this problem today. For now, I've subclassed. But it should be
> fixed, right?
>
>
Yes, it should be fixed. Per the ticket referenced it was fixed two years
ago. The specific scenario showin in the ticket is fixed:

Python 2.7.3 (default, Aug  1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> django.get_version()
'1.4.2'
>>> from django.forms import URLField
>>> f = URLField()
>>> f.clean('www.example.com/://')
u'http://www.example.com/://'
>>>

So what do you mean, exactly, that you came across it today? What exactly
is failing unexpectedly and on what version of Django?


>
> On Sunday, June 20, 2010 7:35:23 PM UTC-6, Samus_ wrote:
>
>> ticket: 
>> http://code.djangoproject.com/**ticket/13804
>>
>> also found a real-life scenario when this feature of the RFC is
>> implemented, the site reddit.com uses it for a shortcut that
>> searchs/submits links to their website, example:
>> http://www.reddit.com/s/http:/**/code.djangoproject.com/**ticket/13804
>>
>> On Sat, Jun 12, 2010 at 7:42 AM, MIL  wrote:
>>
>>> I was the guy that brought it up on #django
>>> And I would like to follow this thread.
>>>
>>> Thanks :o)
>>>
>>> Michael Hjulskov
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: URLValidator on urls without protocol

2012-11-17 Thread Jared Martin
I don't mean to wake a dead dog, but what has become of this? I came across 
this problem today. For now, I've subclassed. But it should be fixed, right?

On Sunday, June 20, 2010 7:35:23 PM UTC-6, Samus_ wrote:
>
> ticket: http://code.djangoproject.com/ticket/13804
>
> also found a real-life scenario when this feature of the RFC is 
> implemented, the site reddit.com uses it for a shortcut that 
> searchs/submits links to their website, example:
> http://www.reddit.com/s/http://code.djangoproject.com/ticket/13804
>
> On Sat, Jun 12, 2010 at 7:42 AM, MIL >wrote:
>
>> I was the guy that brought it up on #django
>> And I would like to follow this thread.
>>
>> Thanks :o)
>>
>> Michael Hjulskov
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django developers" group.
>> To post to this group, send email to 
>> django-d...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-develop...@googlegroups.com .
>> For more options, visit this group at 
>> http://groups.google.com/group/django-developers?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/Vi3dz9q9c-cJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: how to write a text editing in the webpage using django

2012-11-17 Thread Karen Tracey
Please ask questions about using Django on django-users. The topic of this
list is the development of Django itself.

Thanks,
Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



how to write a text editing in the webpage using django

2012-11-17 Thread Jianhui Chen
Hi all,
I am a new web developer and new django comer. I am developing an web
site that allow people to edit their text in a web page and store to a
local file as .txt.
Does anaone tell me some template in django that I can use for web page
design?
Thanks very much.

lood339

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Google groups - possible issues with deleted posts.

2012-11-17 Thread Karen Tracey
On Fri, Nov 16, 2012 at 12:25 PM, Tom Christie wrote:

> Be aware that there may be issues with google groups at the moment...


Sigh.


> There are two messages in this 
> thread
>  that
> are marked as deleted, apparently not 
> intentionally
> .
>

These got caught in the sometimes inexplicable "this looks like spam even
though it came from an allowed poster" filter. For these GG puts them in
the moderation queue but does not send an immediate email to
moderatorsit sends email sometimes days later, though in this case it
seems to have sent that email the email with only a 12 hour or so delay.
The emails in the "moderator's spam report" note were:

--- 1 of 3  ---
> Subject: django.contrib.redirects customisation
> From: "Лебедев Илья" 
> Date: Nov 15 03:22PM +0400
>
> Recently I needed functionality just like in django.contrib.redirects -
> redirects table, that can be edited in admin. I was sad to find out that
> its strongly not configurable. For example, I dont need status 301, but
> need something else.
>
> Approve:
> http://groups.google.com/group/django-developers/pendmsg?view=full&pending_id=3390956786051711982
>
> --- 2 of 3  ---
> Subject: Re: Class based views: A standard hook for
> http-method-independent code
> From: George Hickman 
> Date: Nov 15 04:27AM -0800
>
> I have a slightly different proposal, one where we can avoid the extra hook
> but hopefully cover everyone's use cases too.
>
>
> https://github.com/ghickman/django/commit/85ac39a481074c25af1ed72a7a12e62ff5425e54
>
> I've personally never liked the
>
> Approve:
> http://groups.google.com/group/django-developers/pendmsg?view=full&pending_id=548044182767120459
>
> --- 3 of 3  ---
> Subject: Re: Class based views: A standard hook for
> http-method-independent code
> From: George Hickman 
> Date: Nov 15 01:24PM -0800
>
> Apologies if this is a double reply, I think Google Groups might have
> deleted my last post...
>
> I'd like to suggest a slight tangent to the proposed feature that hopefully
> covers what everyone seems to be looking for.
>
>
> Approve:
> http://groups.google.com/group/django-developers/pendmsg?view=full&pending_id=7023679753100488970
>

(Can anyone see anything in any of these messages that would cause GG to
think they were spam??)

Anyway, I did delete the last of these, since it was a duplicate due to the
moderation hold up. The other two I moderated through. The first shows up
in both the group and my email records for the list. The second apparently
only got sent out via email, I have no idea why it doesn't show up in the
group (but it did go out to email subscribers -- I have it and there's a
response to it in the group). I know the same thing has happened before,
where something held in this "might be spam" filter, after being approved,
went out in email but never appeared in the group archive. But that
apparently doesn't happen all the time since the first message in this
batch does appear in the group.


> There are also three messages in this 
> thread,
> all around the same timeframe which are marked as deleted, which seems a
> little suspect.
>

I have no idea what those might have been. I do recall deleting 4 spam
messages, I think yesterday, I think from the dev group. Two had subjects
along the lines of "sexy teen hot bodies" and two were google talk invites.
Ordinarily I would have just deleted the google talk invites as
non-intentional spam, but they were from the same address as the real spam
so I marked them all as spam, which has the side-effect of banning the
poster. It's possible that even with the different subject lines they were
posted to that thread..but from my recollection there were 4, not 3, so I
have no idea if those that I remember connect to the three deletions noted
in that thread. I don't recall deleting any other messages from the dev
group moderation queue in the last few days.

Karen

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Class based views: A standard hook for http-method-independent code

2012-11-17 Thread Jeremy Dunck
+1, this looks like a good change anyway and doesn't smell to me.

On Fri, Nov 16, 2012 at 6:09 AM, Daniel Sokolowski
 wrote:
> I like this approach.
>
> From: George Hickman
> Sent: Thursday, November 15, 2012 7:27 AM
> To: django-developers@googlegroups.com
> Subject: Re: Class based views: A standard hook for http-method-independent
> code
>
> I have a slightly different proposal, one where we can avoid the extra hook
> but hopefully cover everyone's use cases too.
>
> https://github.com/ghickman/django/commit/85ac39a481074c25af1ed72a7a12e62ff5425e54
>
> I've personally never liked the setting of args, kwargs & request from
> within dispatch since it seems like it's feature creep of the dispatch
> method. However I'm also in the same boat as many of the other posters here
> in needing to do permissions related checks before dispatch is called.
>
> With my suggestion above you would be able to put your pre-dispatch code in
> a subclasses overridden dispatch before calling super while also depending
> on args, kwargs & request on self.
>
> On Thursday, November 15, 2012 4:18:34 AM UTC, Aaron Merriam wrote:
>>
>> If the super call changes any data then by the time you've run whatever
>> code comes after the super call, the changes have already occured.
>>
>>
>> If you wait to call super before running your own code, then request,
>> args, and kwargs are not available on the request, so anything that depends
>> on them being there (such as self.get_object()) will not work, so it must be
>> re-implemented,
>> Otherwise you have to set request, args, kwargs yourself which does not
>> feel very DRY.
>>
>> For me, the entire reason I would like this change, is so that I can do
>> something before dispatch that uses self.request/args/kwargs.  Everything I
>> want can be accomplished within dispatch, but not as cleanly, or as DRY as
>> if this method hook existed.
>>
>> On Wednesday, November 14, 2012 6:49:06 AM UTC-7, Daniel Sokolowski wrote:
>>>
>>> Can you elaborate the nasty side effects you are thinking of? I can’t
>>> think of any that that the base views do to warrant your statement.
>>>
>>> From: Aaron Merriam
>>> Sent: Friday, November 09, 2012 3:12 PM
>>> To: django-d...@googlegroups.com
>>> Subject: Re: Class based views: A standard hook for
>>> http-method-independent code
>>>
>>> That pattern has nasty side-effects.  It can be used in some cases but it
>>> fails in most.
>>>
>>> On Friday, November 9, 2012 8:28:47 AM UTC-7, Daniel Sokolowski wrote:

 I’ve done the below in the past, the only issue with that is if you have
 side effects in parent’s dispatch you don’t want executed but you would 
 also
 run that risk if you had an initialize() method work flow; in the end I 
 find
 dispatch() is enough in my experience.

 def dispatch(self, request, *args, **kwargs):
 parent_dispatch_return = super(Class, self).dispatch(request, *args,
 **kwargs)
 ...my code based on values based on the super call...
 return parent_dispatch_return

 From: Jordan Hagan
 Sent: Friday, November 09, 2012 12:37 AM
 To: django-d...@googlegroups.com
 Subject: Re: Class based views: A standard hook for
 http-method-independent code

 Hey Russ,

 The main point of concern which I think you may be missing is that
 self.kwargs and self.args are set inside dispatch, so using other mixins
 that require self.kwargs and self.args to be set (most do) will not work,
 without doing:

 def dispatch(self, request, *args, **kwargs):
 self.args = args;
 self.kwargs = kwargs
 self.init()
 return super(Class, self).dispatch(request, *args, **kwargs)

 Which isn't very tidy, to me having self.args and self.kwargs be set
 twice (once in my overridden dispatch method, and once in the original
 dispatch) feels wrong. I can't give you a good reason for it, it just feels
 bad every time I do it. The only way to work around this is to override
 dispatch without calling the original, and essentially duplicate the
 original dispatch method with an init call added in.

 Cheers,
 Jordan

 On Fri, Nov 9, 2012 at 6:25 PM, Russell Keith-Magee
  wrote:
>
>
>
> On Fri, Nov 9, 2012 at 1:05 PM, Aaron Merriam 
> wrote:
>>
>> Without setting request, args, and kwargs on on the view instance
>> (which is done during the base dispatch view), anything in the view that
>> assumes these values are present cannot run.
>>
>> Most of my views end up with functions which retrieve an object and
>> then do some basic validation to ensure that a user has permissions, or 
>> that
>> the object is valid in some fashion, or that some set of conditions is 
>> met
>> prior to allowing any method call to happen.
>>
>> I have found that without this init method, the vast majority of my
>> views end up 

Ticket 19237

2012-11-17 Thread Chris Khoo
Hi

I was wondering if one of the core developers could have a look at ticket 
#19237 and progress it forward - https://code.djangoproject.com/ticket/19237

It basically makes django.utils.html.strip_tags a little smarter.

Thanks

Chris

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/3l1DW91EmKUJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.