In your models.py put:
from django.db import models
@classmethod
def model_field_exists(cls, field):
try:
cls._meta.get_field(field)
return True
In your models.py put:
from django.db import models
@classmethod
def model_field_exists(cls, field):
try:
cls._meta.get_field(field)
return True
/** | |
* Find the longest class names in Spring. | |
* Also find FactoryFactory classes. | |
* a goof-off project by @thom_nic | |
*/ | |
import java.util.jar.* | |
defaultTasks 'longest', 'factoryfactory' |
"""Test of using graphviz's "dot" layout algorithm to arrange a Nuke node-graph | |
Example: http://i.imgur.com/f1mK7.png | |
Left is dot, right is Nuke's builtin nuke.autoplace | |
""" | |
import nuke | |
# http://code.google.com/p/pydot/ | |
import pydot |