Archives week 4 of 2012
Jan. 23, 2012 - Jan. 29, 2012
Watch your Django field defaults do not load objects if you use South
Written by
on
in
Snaking.
Just ran into a South migration issue. Basically we had a field that looked like this (simplified):
class MyModel( models.Model ):
hostname = models.CharField(
default = random_unique_hostname,
)
where random_unique_hostname() was written like so (again, simplified):
def random_unique_hostname():
test = generate_random()
try:
MyModel.objects.get( hostname = test )
except MyModel.DoesNotExist, err:
return test
else:
return random_unique_hostname() ...
Fake French is Fun!
Written by
on
in
Snaking.
Ran FakeLion over our current project. It's actually pretty cool just as a design tool. The text is backward and in a weird "font", so you aren't distracted by what is says, you just see the site's layout with text-where-text-will-be. With this being the third time we've used it on the project, there really wasn't ...
Bad Coder, No Cookie
Written by
on
in
Snaking.
We use globalsub and MockProc extensively in our test-suite at work. Today I wanted to look up the name of the argument in MockProc (we use globalsub in almost every test case, so I don't need to look that up). So, look up the docs... wow, whoever wrote this library really sucks, there's just some ...