Django UUID primary key
Just use the default parameter for a field:
import uuid
class ExampleModel(models.Model):
id = models.CharField(max_length=255, primary_key=True, default=uuid.uuid4)
Just use the default parameter for a field:
import uuid
class ExampleModel(models.Model):
id = models.CharField(max_length=255, primary_key=True, default=uuid.uuid4)
Since I’ve been looking for this more than once:
import django
django.VERSION
I use Droid Sans Mono as my font for coding and in Putty and nearly everywhere. You can read and download it over at damieng.com.
If you want code and fixed-width text to appear nice in Firefox, what’s a better idea than using Droid Sans Mono there, too?
Go to Options > Content. Under Fonts & Colors click Advanced and choose Droid Sans Mono as monospaced font. It’s as easy as that. It will now affect every fixed-width text that is not formatted by CSS or something else. It will even change fonts in Firebug. I like it, it looks beautiful!
© Copyright Julian Bez 2012. All rights reserved, unless otherwise mentioned.
For your convenience: All times are GMT.
Built with valid things such as XHTML and CSS.
PLEASE NOTE: This site will look much better in a browser that supports web standards, but it is accessible to any browser or Internet device. more info...