Revision 6
Added by Matt Wheeler about 14 years ago
makeModel.php | ||
---|---|---|
64 | 64 |
print "import string\n"; |
65 | 65 |
print "import xml.dom.minidom\n"; |
66 | 66 |
print "from random import choice\n"; |
67 |
print "from django.db import models\n\n"; |
|
67 |
print "from django.contrib.gis.geos import *\n"; |
|
68 |
print "from django.contrib.gis.db import models\n\n"; |
|
68 | 69 |
print "def getRandom(length=8, chars=string.letters + string.digits):\n". |
69 | 70 |
" return ''.join([choice(chars) for i in range(length)])\n\n". |
70 | 71 |
"def getRandomString():\n". |
... | ... | |
81 | 82 |
"def getRandomDate():\n". |
82 | 83 |
" return '2007-07-16'\n\n". |
83 | 84 |
"def getRandomTime():\n". |
84 |
" return '08:30:00'\n\n"; |
|
85 |
" return '08:30:00'\n\n". |
|
86 |
"class EntryInfo(models.Model):\n". |
|
87 |
" creationDate = models.DateTimeField(auto_now_add=True)\n". |
|
88 |
" lastUpdatedDate = models.DateTimeField(auto_now=True)\n". |
|
89 |
" dataSource = models.CharField(max_length=255, db_index=True)\n\n"; |
|
85 | 90 |
|
86 | 91 |
$eList->printAll(); |
87 | 92 |
|
Also available in: Unified diff
Adding vegx definition. Current models.py building script.