Skip to content

Commit c81bc85

Browse files
committed
Rename README.md -> README.rst and update it
GitHub supports `README.rst` in organization profiles.
1 parent bb347e5 commit c81bc85

2 files changed

Lines changed: 81 additions & 71 deletions

File tree

profile/README.md

Lines changed: 0 additions & 71 deletions
This file was deleted.

profile/README.rst

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
What is SQLObject
2+
=================
3+
4+
SQLObject is an object-relational mapper. Your database tables are described
5+
as classes, and rows are instances of those classes. SQLObject is meant to be
6+
easy to use and quick to get started with.
7+
8+
SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite;
9+
connections to other backends - Firebird, Sybase, MSSQL
10+
and MaxDB (also known as SAPDB) - are lesser debugged).
11+
12+
Python 2.7 or 3.4+ is required.
13+
14+
15+
Where is SQLObject
16+
==================
17+
18+
Site:
19+
http://sqlobject.org
20+
21+
Development:
22+
http://sqlobject.org/devel/
23+
24+
Developer Guide:
25+
http://sqlobject.org/DeveloperGuide.html
26+
27+
Mailing list:
28+
https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss
29+
30+
Download:
31+
https://pypi.org/project/SQLObject/
32+
33+
News and changes:
34+
http://sqlobject.org/News.html
35+
36+
StackOverflow:
37+
https://stackoverflow.com/questions/tagged/sqlobject
38+
39+
40+
Example
41+
=======
42+
43+
Install::
44+
45+
$ pip install sqlobject
46+
47+
Create a simple class that wraps a table::
48+
49+
>>> from sqlobject import *
50+
>>>
51+
>>> sqlhub.processConnection = connectionForURI('sqlite:/:memory:')
52+
>>>
53+
>>> class Person(SQLObject):
54+
... fname = StringCol()
55+
... mi = StringCol(length=1, default=None)
56+
... lname = StringCol()
57+
...
58+
>>> Person.createTable()
59+
60+
Use the object::
61+
62+
>>> p = Person(fname="John", lname="Doe")
63+
>>> p
64+
<Person 1 fname='John' mi=None lname='Doe'>
65+
>>> p.fname
66+
'John'
67+
>>> p.mi = 'Q'
68+
>>> p2 = Person.get(1)
69+
>>> p2
70+
<Person 1 fname='John' mi='Q' lname='Doe'>
71+
>>> p is p2
72+
True
73+
74+
Queries::
75+
76+
>>> p3 = Person.selectBy(lname="Doe")[0]
77+
>>> p3
78+
<Person 1 fname='John' mi='Q' lname='Doe'>
79+
>>> pc = Person.select(Person.q.lname=="Doe").count()
80+
>>> pc
81+
1

0 commit comments

Comments
 (0)