<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Code Spatter - Latest Comments</title><link xmlns="http://www.w3.org/2005/Atom" rel="http://api.friendfeed.com/2008/03#sup" href="http://disqus.com/sup/all.sup#forumcomments-1baba510" type="application/json"/><link>http://codespatter.disqus.com/</link><description></description><language>en</language><lastBuildDate>Thu, 12 Nov 2009 00:24:16 -0000</lastBuildDate><item><title>Re: How To Use Triggers to Track Changes in MySQL</title><link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/#comment-22804848</link><description>Yeah Dear, the concept you entered is so helpful, well good work.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Phani Kumar Varanasi</dc:creator><pubDate>Thu, 12 Nov 2009 00:24:16 -0000</pubDate></item><item><title>Re: Getting Basecamp API Working with Python</title><link>http://codespatter.com/2009/04/01/getting-basecamp-api-working-with-python/#comment-21728747</link><description>Is this code still working for you?  I made your changes but basecamp dumps me into the login page now.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Greg</dc:creator><pubDate>Mon, 02 Nov 2009 23:03:01 -0000</pubDate></item><item><title>Re: How to Break a MySQL Left Join</title><link>http://codespatter.com/2008/02/19/how-to-break-a-mysql-left-join/#comment-20244303</link><description>Great article.  It pointed me in the right direction.  Thanks for doing this, these kind of blogs save a lot of headache!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Aaron</dc:creator><pubDate>Fri, 16 Oct 2009 22:19:03 -0000</pubDate></item><item><title>Re: Django RequestContext Example</title><link>http://codespatter.com/2008/12/22/django-requestcontext-example/#comment-18827681</link><description>Thanks! It's great simple tutorial!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jakubmusil</dc:creator><pubDate>Tue, 06 Oct 2009 04:40:41 -0000</pubDate></item><item><title>Re: Django Settings Site Domain example.com</title><link>http://codespatter.com/2009/01/05/django-settings-site-domain-examplecom/#comment-17639022</link><description>How change SITE_ID for multidomain on fly? In settings.py only constants.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Eugene</dc:creator><pubDate>Sun, 27 Sep 2009 12:48:42 -0000</pubDate></item><item><title>Re: Conditions on Count or Sum in MySQL</title><link>http://codespatter.com/2008/07/22/conditions-on-count-or-sum-in-mysql/#comment-15543471</link><description>yeah that looks like it should work</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gallard</dc:creator><pubDate>Fri, 28 Aug 2009 16:30:02 -0000</pubDate></item><item><title>Re: Conditions on Count or Sum in MySQL</title><link>http://codespatter.com/2008/07/22/conditions-on-count-or-sum-in-mysql/#comment-15529585</link><description>Hello &lt;br&gt;&lt;br&gt;I just did it.&lt;br&gt;&lt;br&gt;I used this:&lt;br&gt;  SELECT count(products_id) as count_products , SUM( reviews_rating ) as total FROM TABLE WHERE products_id=".$product_id;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jarnail</dc:creator><pubDate>Fri, 28 Aug 2009 11:27:29 -0000</pubDate></item><item><title>Re: Conditions on Count or Sum in MySQL</title><link>http://codespatter.com/2008/07/22/conditions-on-count-or-sum-in-mysql/#comment-15528858</link><description>Can we do count and sum in single SQL?&lt;br&gt;&lt;br&gt;I have a table where i need SUM of a field as will as I have to COUNT total effected rows.&lt;br&gt;&lt;br&gt;Any idea?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jarnail</dc:creator><pubDate>Fri, 28 Aug 2009 11:09:42 -0000</pubDate></item><item><title>Re: A Django Model Manager for Soft Deleting Records and How to Customize the Django Admin</title><link>http://codespatter.com/2009/07/01/django-model-manager-soft-delete-how-to-customize-admin/#comment-14570877</link><description>That would work. If you are using a signal (pre_delete or post_delete), you might need to send it from the new function since you wouldn't want to call the real delete.&lt;br&gt;&lt;br&gt;I've been doing object.deleted = 1 object.save() and not calling or overriding delete(). That way I still have the option to do the real delete in case I need it. You could probably make a real_delete() function to do that if needed though.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gallard</dc:creator><pubDate>Mon, 10 Aug 2009 10:11:07 -0000</pubDate></item><item><title>Re: A Django Model Manager for Soft Deleting Records and How to Customize the Django Admin</title><link>http://codespatter.com/2009/07/01/django-model-manager-soft-delete-how-to-customize-admin/#comment-14567145</link><description>I think I must be missing something, as I cant see where you're setting the flag "deleted".&lt;br&gt;&lt;br&gt;Would overriding the models delete function, setting delete=True and saving suffice?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Dave</dc:creator><pubDate>Mon, 10 Aug 2009 07:17:49 -0000</pubDate></item><item><title>Re: Conditions on Count or Sum in MySQL</title><link>http://codespatter.com/2008/07/22/conditions-on-count-or-sum-in-mysql/#comment-13872433</link><description>ah, thanx Greg, that gave me a kick in the back!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">buellart</dc:creator><pubDate>Tue, 04 Aug 2009 05:05:54 -0000</pubDate></item><item><title>Re: How To Use Triggers to Track Changes in MySQL</title><link>http://codespatter.com/2008/05/06/how-to-use-triggers-to-track-changes-in-mysql/#comment-13543404</link><description>Thank you very much!!! it saved my day</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">abhinavzone</dc:creator><pubDate>Wed, 29 Jul 2009 12:57:23 -0000</pubDate></item><item><title>Re: Quick Thumbnails in Django</title><link>http://codespatter.com/2008/09/13/quick-thumbnails-in-django/#comment-13345958</link><description>Great post, thanks.  I especially liked learning about StringIO as I didn't know about it before now.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">wkoorts</dc:creator><pubDate>Sun, 26 Jul 2009 03:17:19 -0000</pubDate></item><item><title>Re: Python Projects in Users&amp;#8217; Home Directories with wsgi</title><link>http://codespatter.com/2009/07/08/python-projects-in-users-home-directories-with-wsgi/#comment-13127848</link><description>I like the AddHandler approach more than what I was trying in this post. It is better since AddHandler will work in an .htaccess file. Which means this doesn't require a new public_python folder and doesn't require /p/ to be added to the url. &lt;br&gt;&lt;br&gt;Before arriving at the solution in my post I tried using an .htaccess file and the directives I tried weren't supported in .htaccess. I didn't read the part about AddHandler so I missed that.&lt;br&gt;&lt;br&gt;Something with either WSGIDaemonProcess or WSGIProcessGroup from the code in the blog post is making those applications work in daemon mode. It seems like any wsgi file that is touched will result in the code being reloaded for that project.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gallard</dc:creator><pubDate>Wed, 22 Jul 2009 15:47:58 -0000</pubDate></item><item><title>Re: A Django Model Manager for Soft Deleting Records and How to Customize the Django Admin</title><link>http://codespatter.com/2009/07/01/django-model-manager-soft-delete-how-to-customize-admin/#comment-13127248</link><description>I tested this out with a simple many to many example and I am not getting the soft deleted objects returned. With objects = SoftDeleteManager the many to many queries will be using get_query_set() which won't return the soft deleted records. I might need to see an example of how you are getting the deleted results to be able to figure out what is going on. I tried it with some_object.related_things.all() and the returned set won't have deleted related_things.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gallard</dc:creator><pubDate>Wed, 22 Jul 2009 15:37:32 -0000</pubDate></item><item><title>Re: A Django Model Manager for Soft Deleting Records and How to Customize the Django Admin</title><link>http://codespatter.com/2009/07/01/django-model-manager-soft-delete-how-to-customize-admin/#comment-13120467</link><description>Awesome tutorial... this has been really useful. One thing I've had an issue with is related fields (specifically with to M2M relationships).&lt;br&gt;&lt;br&gt;A simplified version of my issue works kind of like this: I have a lot of models that all derive from a base content class (articles, images, galleries, etc.). Articles are able to have related content (via a many to many field), but when I soft delete content, it'll still show up in related content queries on my articles. Is there a good way to get this method working for inherited classes and/or m2m fields?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">sjstelmach</dc:creator><pubDate>Wed, 22 Jul 2009 13:55:52 -0000</pubDate></item><item><title>Re: Python Projects in Users&amp;#8217; Home Directories with wsgi</title><link>http://codespatter.com/2009/07/08/python-projects-in-users-home-directories-with-wsgi/#comment-12530933</link><description>Sorry, I have been busy. For a start, look at latter part of section 'The Apache Alias Directive' in:&lt;br&gt;&lt;br&gt;&lt;a href="http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines#The_Apache_Alias_Directive" rel="nofollow"&gt;http://code.google.com/p/modwsgi/wiki/Configura...&lt;/a&gt;&lt;br&gt;&lt;br&gt;The approach here, using AddHandler and multiviews matching, is to overlay, or insert, the WSGI application into the directories containing the static files. It results in a slighter cleaner configuration that using WSGIScriptAlias and then trying to overlay static resources on top of the WSGI application. Using AddHandler means you can add both WSGI applications and static files without needing to change Apache configuration and restart Apache.&lt;br&gt;&lt;br&gt;I have ignored daemon process groups for the moment, but can still be used in conjunction with this approach.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Graham Dumpleton</dc:creator><pubDate>Sun, 12 Jul 2009 02:01:49 -0000</pubDate></item><item><title>Re: Python Projects in Users&amp;#8217; Home Directories with wsgi</title><link>http://codespatter.com/2009/07/08/python-projects-in-users-home-directories-with-wsgi/#comment-12382867</link><description>I tried it without the LocationMatch directives and it works with just having AliasMatch in there for the static locations.&lt;br&gt;&lt;br&gt;I didn't expect that WSGIDaemonProcess wouldn't expand the python_project_name. I was doing that so that each project would have a different process so touching one wsgi file wouldn't effect another project. It seemed like it was working like that.&lt;br&gt;&lt;br&gt;If you can figure out a better way of doing this that would be awesome.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gallard</dc:creator><pubDate>Thu, 09 Jul 2009 11:06:15 -0000</pubDate></item><item><title>Re: Python Projects in Users&amp;#8217; Home Directories with wsgi</title><link>http://codespatter.com/2009/07/08/python-projects-in-users-home-directories-with-wsgi/#comment-12359458</link><description>The LocationMatch would be empty at that point and serving no purpose. The Alias and AliasMatch directives will always take precedence over WSGIScriptAlias and WSGIScriptAliasMatch, thus why you don't need the SetHandler None fiddle that mod_pythoin requires.&lt;br&gt;&lt;br&gt;BTW, am still looking and will post better configuration, but to start with, using:&lt;br&gt;&lt;br&gt;wsgi_processes.%{ENV:python_project_name}&lt;br&gt;&lt;br&gt;for argument to WSGIDaemonProcess is wrong, as that will not be expanded. Not even sure how it is working for you, as WSGIProcessGroup would be expanded and so wouldn't match the WSGIDaemonProcess and so it should give an error that you are delegating a non existent daemon process group, when request comes in and is evaluated.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Graham Dumpleton</dc:creator><pubDate>Wed, 08 Jul 2009 21:43:42 -0000</pubDate></item><item><title>Re: Python Projects in Users&amp;#8217; Home Directories with wsgi</title><link>http://codespatter.com/2009/07/08/python-projects-in-users-home-directories-with-wsgi/#comment-12337319</link><description>Thanks for taking at look at this. I'll test it without SetHandler None when I get a chance. It is probably something I was keeping around from when I was using mod_python. I'm guessing I need to keep LocationMatch in there so that the request doesn't go to the wsgi file though, right?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gallard</dc:creator><pubDate>Wed, 08 Jul 2009 18:26:33 -0000</pubDate></item><item><title>Re: Python Projects in Users&amp;#8217; Home Directories with wsgi</title><link>http://codespatter.com/2009/07/08/python-projects-in-users-home-directories-with-wsgi/#comment-12337006</link><description>You don't need 'SetHandler None' when using mod_wsgi. That nonsense should only be required for mod_python. I also suspect you have gone about this the hard way and there is easier ways which are documented in the mod_wsgi wiki. When I get a chance I will look through what you have done properly and comment again.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Graham Dumpleton</dc:creator><pubDate>Wed, 08 Jul 2009 17:09:37 -0000</pubDate></item><item><title>Re: A Django Model Manager for Soft Deleting Records and How to Customize the Django Admin</title><link>http://codespatter.com/2009/07/01/django-model-manager-soft-delete-how-to-customize-admin/#comment-12030609</link><description>You can do this.&lt;br&gt;from somewhere import SoftDeleteManager&lt;br&gt;&lt;br&gt;class NewManager(SoftDeleteManager):&lt;br&gt;    '''new stuff'''&lt;br&gt;&lt;br&gt;and in the model&lt;br&gt;objects = NewManager()</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">gallard</dc:creator><pubDate>Thu, 02 Jul 2009 09:50:13 -0000</pubDate></item><item><title>Re: A Django Model Manager for Soft Deleting Records and How to Customize the Django Admin</title><link>http://codespatter.com/2009/07/01/django-model-manager-soft-delete-how-to-customize-admin/#comment-12024597</link><description>Great writeup, thanks for that! I'll have question though.&lt;br&gt;Say I import SoftDeleteManager from an external file and use it with objects = SoftDeleteManager()&lt;br&gt;But now, I loose ability to define additional custom manager methods because objecst is already assigned, right? Is there a way to solve this other than inheriting from multiple manager classes?&lt;br&gt;&lt;br&gt;Metin</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Metin</dc:creator><pubDate>Thu, 02 Jul 2009 04:30:50 -0000</pubDate></item><item><title>Re: Static Files in Django on Production and Development</title><link>http://codespatter.com/2008/09/22/static-files-in-django-on-production-and-development/#comment-11517165</link><description>thanks, man!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Ronald</dc:creator><pubDate>Sat, 20 Jun 2009 19:13:43 -0000</pubDate></item><item><title>Re: Django Settings Site Domain example.com</title><link>http://codespatter.com/2009/01/05/django-settings-site-domain-examplecom/#comment-10380003</link><description>Yes! Finally I know where that annoying &lt;a href="http://example.com" rel="nofollow"&gt;example.com&lt;/a&gt; lives! Thank you!</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Vladimir</dc:creator><pubDate>Tue, 02 Jun 2009 04:11:16 -0000</pubDate></item></channel></rss>