Transactions link missing in tutorial

0 views
Skip to first unread message

Etienne Robillard

unread,
Apr 25, 2009, 8:22:22 AM4/25/09
to sch...@googlegroups.com

Hi!

Got a 404 response trying to access this:
http://www.schevo.org/docs/schevo/3.1-dev/reference/transactions.html

I was thinking to not use paster for creating the database, can this
be done with that particular API ?

Thanks and Regards

Etienne

erob

unread,
Apr 25, 2009, 11:20:46 AM4/25/09
to Schevo


On Apr 25, 8:22 am, Etienne Robillard <robillard.etie...@gmail.com>
wrote:
> Hi!
>
> Got a 404 response trying to access this:http://www.schevo.org/docs/schevo/3.1-dev/reference/transactions.html
>
> I was thinking to not use paster for creating the database, can this
> be done with that particular API ?

never mind, I seem to have past this step. I just don't understand
fully yet why the following code
returns None:

from schevo.database import open as opener

def setUp(self):

self.db = opener('moviereviews.db')
...

def test_find_keanu_reeves(self):
keanu_reeves = self.db.Actor.findone(name="Keanu Reeves")
self.assertEqual(type(keanu_reeves) != NoneType, True)


Any ideas?

- Etienne

Etienne Robillard

unread,
Apr 25, 2009, 11:51:27 AM4/25/09
to sch...@googlegroups.com

Its working :)
Finally got a hold of it using "schevo shell moviereviews.db"
then did:
>>> db.populate()
>>> actors = db.Actor.find()
>>> for actor in actors
>>> print actors
>>> ...
>>> db.close()

But i think i must forgotten to call "db.populate()" initially,
so that must explain why I had no results on my previous attempts.

Thanks and Regards

Etienne

Matthew Scott

unread,
Apr 27, 2009, 12:46:57 PM4/27/09
to sch...@googlegroups.com
On Sat, Apr 25, 2009 at 05:22, Etienne Robillard <robillar...@gmail.com> wrote:


Hi!

Got a 404 response trying to access this:
http://www.schevo.org/docs/schevo/3.1-dev/reference/transactions.html

Do you remember which page links to that?

It is probably a placeholder for a page that I intend to create but have not yet created.  :)


--
Matthew R. Scott

Matthew Scott

unread,
Apr 27, 2009, 12:52:12 PM4/27/09
to sch...@googlegroups.com


On Sat, Apr 25, 2009 at 08:51, Etienne Robillard <robillar...@gmail.com> wrote:

Its working :)
Finally got a hold of it using "schevo shell moviereviews.db"
then did:
>>> db.populate()
>>> actors = db.Actor.find()
>>> for actor in actors
>>>  print actors
>>> ...
>>> db.close()

But i think i must forgotten to call "db.populate()" initially,
so that must explain why I had no results on my previous attempts.


Glad you got it working!

FYI, the usual way to create a new database is to use the "schevo db create" command from a shell window / command prompt.

Use "schevo db create --help" for more information.

What I usually use during development is "schevo db create -xpa mypackagename test.db"

This is short for:  "schevo db create --delete --sample --app=mypackagename test.db"

From the --help text:

  -a PATH, --app=PATH   Use application in PATH.
  -p, --sample          Create sample data.
  -x, --delete          Delete existing database file if one exists.

You can leave out the "--delete" or "-x" if you like but during development as I rapidly change a schema module, I find it helps to start with a clean database that has been populated with sample data ("--sample" or "-p").


--
Matthew R. Scott

Etienne Robillard

unread,
Apr 27, 2009, 1:25:08 PM4/27/09
to sch...@googlegroups.com


Sure, it should be in the tutorial section. The "Schevo Transactions"
link appear to be missing :

http://www.schevo.org/docs/schevo/3.1-dev/tutorial/moviereviews/part1.html#transactions

Etienne Robillard

unread,
Apr 27, 2009, 1:56:28 PM4/27/09
to sch...@googlegroups.com

Thanks for the tip! :-)

I didn't saw that "--sample" option at first since I was rather
focusing on creating the actual database file:

steiner@lisa:~/notmm-schevo/tests/schevo$ schevo db create -p -s
movie2/schema test.db
/usr/local/lib/python2.6/site-packages/schevo/field.py:9:
DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
Schevo 3.1-dev :: Database Activities :: Create Database
aps
Creating new database at version 1.
Populating with sample data...
Packing the database...
Database version is now at 1.
Database created.

Best Regards,

- Etienne

Matthew Scott

unread,
Apr 27, 2009, 2:07:16 PM4/27/09
to sch...@googlegroups.com


On Mon, Apr 27, 2009 at 10:56, Etienne Robillard <robillar...@gmail.com> wrote:
/usr/local/lib/python2.6/site-packages/schevo/field.py:9:
DeprecationWarning: the md5 module is deprecated; use hashlib instead
 import md5


Looks like I need to do some testing with Python 2.6.  I've been focusing on Python 2.5 since that's what I still use.


--
Matthew R. Scott
Reply all
Reply to author
Forward
0 new messages