Ansgar Burchardt 0bf4c90e93 silence warning "E305 expected 2 blank lines after class or function definition" 5 tahun lalu
..
queries 0bf4c90e93 silence warning "E305 expected 2 blank lines after class or function definition" 5 tahun lalu
README 5263d8982c dakweb/README: refer to mirror.ftp-master.d.o 7 tahun lalu
__init__.py c0b8ce5a99 A bit of docs for the ftpmaster api 10 tahun lalu
dakweb.wsgi 3f25f563f8 First pass at a hacky mod_wsgi version 10 tahun lalu
dakwebserver.py 0bf4c90e93 silence warning "E305 expected 2 blank lines after class or function definition" 5 tahun lalu
webregister.py 0bf4c90e93 silence warning "E305 expected 2 blank lines after class or function definition" 5 tahun lalu

README

We are happy to add features to dakweb if you have a need for them.

Here are a few tips to help you get started on creating a dakweb patch:

1. dakweb is implemented in Python, using the bottle web microframework and the
sqlalchemy ORM (object relational mapper).

In a nutshell, bottle allows us to expose Python functions via
HTTP. Parameters are automatically taken from the @bottle.route function
annotation and passed to the function.

For upstream documentation, see:
https://bottlepy.org/docs/dev/
http://www.sqlalchemy.org/

When browsing upstream documentation, keep in mind that we are using the
versions installed on mirror.ftp-master.debian.org, which is usually running
Debian stable. In other words: the latest documentation might not be
applicable yet.

2. The bulk of adding a new query is coming up with the actual database query
(as opposed to the plumbing). To get fast turn-around times while developing,
you can use the ipython REPL:

% ssh mirror.ftp-master.debian.org
mirror % cd /srv/ftp-master.debian.org/dak/
mirror % PYTHONPATH=. ipython
ipython % from daklib.dbconn import *
ipython % s = DBConn().session()

Then, to evaluate a query, construct it and call the all method, e.g.:
ipython % s.query(DBBinary.package, DBSource.source, SourceMetadata.value).join(DBSource).join(SourceMetadata).join(MetadataKey).filter(MetadataKey.key == 'Go-Import-Path').group_by(DBBinary.package, DBSource.source, SourceMetadata.value).all()