Proposal: Optgroup integration with FilePathField and SelectField
I'd like to integrate the optgroup tag (http://www.w3schools.com/tags/tag_optgroup.asp) into the FilePathField (which would in code would lead to this being tacked onto the SelectField object) and want to get people's thoughts before writing the code. My thought would be that: NAME_CHOICES = ( ('Male', (("John", "John"), ("Steve", "Steve"))), ('Female', ("Jane", "Jane")), ('?', "Unknown") ) would produce: John Steve Jane Unknown The main reason this functionality is desired is for the FilePathField. When recursive = True, it would be nice if the directories would be displayed inside a optgroup-enhanced select tag. If the directories go more then 2 directories deep, I assume it would be best to revert back to the regular method, displaying all the files in a single non-optgroup enabled list, since it appears that only IE 5 for Mac supports multi-nested-optgroups (http://www.netmechanic.com/news/vol4/html_no20.htm). Any comments/thoughts/enhancements? If you don't like this, is there another way of doing this without mucking up the predefined objects? --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---
Proposal: Shorter comment tag
Could the comment tag be simplified to something like {! !} or {# #}. The current convention is a bit bulky for my taste. {% comment %} {% if 1 %}{% endif %} {% endcomment %} could be simplified to... {! {% if 1 %}{% endif %} !} or {% comment %} Short comment about following code {% endcomment %} could be... {! Short comment about following code !} What do you guys think?
Re: Proposal: Shorter comment tag
For those that seem to like the idea of shorter comments, I whipped up this piece of middleware for your projects. It's my first attempt at middleware so the code might seem a bit immature for you advanced djangoers out there. I opted to use the {# #} syntax, but that can easily be changed in the regular expressions below. # ### The Middleware # import re regx_extractComments = re.compile('(\{\#.*?\#\})', re.DOTALL) class NewCommentMiddleware: def process_response(self, request, response): if response.has_header and response.headers.get("Content-Type", "")[0:9] == "text/html": response.content = regx_extractComments.sub( "", response.content) return response ### ## For the TextMate Django Bundle. Add following to `HTML (Django)` ### { name = 'comment.block.django.template'; begin = '{#'; end = '#}'; },
Re: Tinymce
Try changing your js variable to js = ('js/tiny_mce/tiny_mce.js','js/tiny_mce/textareas.js'), For some reason on my installation, the /media/ is automagically added.
Re: DoJo Integration & JSON methods
simplejson rocks. no objections here.
Re: are TinyMCE + other HTML input editors safe to use.
I just started using TinyMCE inside django's admin interface on one site I'm working on. Simon is right... it's a bit sloppy and, from my experience, really falters when pasting text. I've even had pages not saving correctly after pasting text from another application. As long as I stick with editing inside TinyMCE, and not pasting anything inside from external applications, things seem to work out pretty well. It's a tough choice. Textile will produce cleaner code, but then you introduce a steeper learning curve for new users to your system.
Re: proposal: endif, endfor etc assume whatever follows in tag is comment
+1 for {# #} comment tag. I've written some middleware to allow me to use the {# #} syntax and it has made templating much smoother. The {# #} middleware and other arguments on this subject can be found here: http://groups.google.com/group/django-developers/browse_frm/thread/d4e30079153011e1/55d74c184ccf247f?#55d74c184ccf247f --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~--~~~~--~~--~--~---