3 |
3 |
4 Start with downloading the `source <../index.html#files>`_. |
4 Start with downloading the `source <../index.html#files>`_. |
5 Afterwards install the module via ``setup.py install`` und ran ``iro-install``. That will create a sample configuration file named ``iro.conf``. |
5 Afterwards install the module via ``setup.py install`` und ran ``iro-install``. That will create a sample configuration file named ``iro.conf``. |
6 Update the configuration file and run ``iro-install install`` afterwards. That will create the Database and Offers for you. |
6 Update the configuration file and run ``iro-install install`` afterwards. That will create the Database and Offers for you. |
7 After that you have to :ref:`adding_user`. |
7 After that you have to :ref:`adding_user`. |
8 Now you are ready to start Iro ``twisted -ny extras/iro.tac``. |
8 Now you are ready to start Iro ``twisted iro``. |
9 |
9 |
10 |
10 |
11 .. _adding_user: |
11 .. _adding_user: |
12 |
12 |
13 Add User and Userrights |
13 Add User and Userrights |
22 INSERT INTO userrights (user,offer,default) VALUES ("test",OFFERNAME,NULL); |
22 INSERT INTO userrights (user,offer,default) VALUES ("test",OFFERNAME,NULL); |
23 |
23 |
24 or use python/ipython:: |
24 or use python/ipython:: |
25 |
25 |
26 >>> import iro.model.schema |
26 >>> import iro.model.schema |
27 >>> from iro.model import schema |
27 >>> from iro.model.schema import * |
28 >>> from sqlalchemy import create_engine |
28 >>> from sqlalchemy import create_engine |
29 >>> from iro.model.utils import WithSession |
29 >>> from iro.model.utils import WithSession |
30 >>> engine = create_engine(DBURL) |
30 >>> engine = create_engine(DBURL) |
31 >>> with WithSession(engine) as session: |
31 >>> with WithSession(engine) as session: |
32 ... u = schema.User(name="test",apikey="a1a2c3") |
32 ... u = User(name="test",apikey="a1a2c3") |
33 ... session.add(u) |
33 ... session.add(u) |
34 ... o = session.query(Offer).filter_by(name=OFFERNAME).first() |
34 ... o = session.query(Offer).filter_by(name=OFFERNAME).first() |
35 ... u.rights.append(Userright(o, default=None)) |
35 ... u.rights.append(Userright(o, default=None)) |
36 ... session.commit() |
36 ... session.commit() |
37 >>> |
37 >>> |