Welcome to the new
py
Forum.org
.
A message board system written in pure python using the web2py framework.
pyForum is sporting a new, completely re-designed interface and back-end
Download pyForum from
https://bitbucket.org/speedbird/pyforum
Home
/
pyForum Issues (Official)
/
Optimisation of 1st run prepopulate
Back
Optimisation of 1st run prepopulate
By:
francisboon
Rank: Starfleet Ensign
Postings: 7
From:
Unknown
Posted
: Mon, 21 November, 2011 - 07:42 AM
Report as inappropriate
I see that models/db.py has a bunch of checks to ensure that the relevant startup data is loaded into the database:
https://bitbucket.org/speedbird/pyforum/src/654855c9cc71/models/db.py#cl-225
(1) Doing a select(table.id, limitby=(0, 1)).first() is faster than a .count()
(2) Better to wrap all these behind a single check for a value which can be set at the top of the file? (like 'migrate')
You can see how I do this here:
http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/models/zzz_1st_roles.py
http://bazaar.launchpad.net/~flavour/sahana-eden/trunk/view/head:/models/zzz_1st_run.py
F
This topic contains no responses.
Welcome
·
Forum Home
·
Log In
·
Contact the Forum Administrator
Search:
System Announcements
· 30/11/11
Welcome to i-Track ..
· 21/11/11
pyForum 1.1 Released ..
· 24/03/11
QA-Stack Beta 4 Released ..
· 07/12/10
Welcome to pyForum ..
· 26/05/09
How to change the default foru ..
Latest Posts
· 20/05/13
Add Slide Notes & Images as ..
· 05/05/13
Aspose Newsletter for May 2013 ..
· 09/04/13
Dell XPS 12 Akku Beschreibung ..
· 03/04/13
Download Selected or All Attac ..
· 01/04/13
Saaspose.Newsletter for April ..
· 27/03/13
Convert Presentations to Many ..
· 25/03/13
Saaspose.PDF SDK is now availa ..
· 24/03/13
Convert Locally Stored Files t ..
· 13/03/13
Read & Recognize Barcode fro ..
· 05/03/13
Set, Get or Remove Single or A ..
· 04/03/13
Saaspose Newsletter for March ..
· 03/03/13
C# and .Net code for selecting ..
· 27/02/13
Acheter Pointeur Laser 100mW P ..
· 26/02/13
Tips to maximise hp compaq lap ..
· 26/02/13
Batterij HP Pavilion dv6000 ..
Support pyForum