This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from datetime import datetime | |
import os | |
import sys | |
import gdata.projecthosting.client | |
import gdata.projecthosting.data | |
import gdata.gauth | |
import gdata.client | |
import gdata.data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"comment":{"gravatar_id":"67a1b68aca6b44984ff9b8bdb30fc6ed","created_at":"2010/09/11 23:29:15 -0700","body":"[insin](http://github.com/insin) (29 Dec 07):\n\nMaking this a blocker for the first public release, as modifying a parent currently\nleaves the tree in an invalid state.","updated_at":"2010/09/11 23:29:15 -0700","id":401907,"user":"craigds"}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@classmethod | |
def with_base_model(cls, base_model): | |
""" | |
This returns an MPTTModel CLASS with the given base model. | |
Used for linearizing inheritance chains. | |
The given model should be abstract. | |
""" | |
if cls is not MPTTModel: | |
raise RuntimeError, "with_base_model() must be called on MPTTModel" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/mptt/managers.py b/mptt/managers.py | |
index e7893af..8290443 100644 | |
--- a/mptt/managers.py | |
+++ b/mptt/managers.py | |
@@ -2,7 +2,7 @@ | |
A custom manager for working with trees of objects. | |
""" | |
from django.db import connection, models, transaction | |
-from django.db.models import F, Max | |
+from django.db.models import F, Max, Q |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: alg/gdalwarper.cpp | |
=================================================================== | |
--- alg/gdalwarper.cpp (revision 21094) | |
+++ alg/gdalwarper.cpp (working copy) | |
@@ -32,6 +32,7 @@ | |
#include "cpl_minixml.h" | |
#include "ogr_api.h" | |
#include "gdal_priv.h" | |
+#include <iostream> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Calculate and displays all possible N-ominoes for a given N. | |
(c) 2010 Craig de Stigter | |
[email protected] | |
http://flavors.me/craigds | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sample code as a suggestion for https://convore.com/django-community/how-to-make-an-automatic-status-change/ | |
from datetime import datetime | |
class MyManager(models.Manager): | |
def active(self): | |
return self.get_query_set().filter(expires_at__gt=datetime.now()) | |
class MyClass(models.Model): | |
created_at = models.DateTimeField(auto_now_add=True, db_index=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Gets search results from Google Maps for the given string. | |
Usage: | |
mapsearch.py "address" [region] | |
Regions are two-character ccTLDs: http://en.wikipedia.org/wiki/CcTLD | |
They're not validated by this script | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=== modified file 'mptt/managers.py' | |
--- mptt/managers.py 2008-12-05 01:37:34 +0000 | |
+++ mptt/managers.py 2008-12-05 19:08:24 +0000 | |
@@ -11,15 +11,11 @@ | |
qn = connection.ops.quote_name | |
COUNT_SUBQUERY = """( | |
- SELECT COUNT(*) | |
- FROM %(rel_table)s | |
- WHERE %(mptt_fk)s = %(mptt_table)s.%(mptt_pk)s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: gdal/apps/gdal_translate.cpp | |
=================================================================== | |
--- gdal/apps/gdal_translate.cpp (revision 21963) | |
+++ gdal/apps/gdal_translate.cpp (working copy) | |
@@ -991,7 +991,14 @@ | |
pfnProgress, NULL ); | |
if( hOutDS != NULL ) | |
{ | |
+ int bHasGotErr = FALSE; | |
+ CPLErrorReset(); |
OlderNewer