-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Following Mark's answer with more definitive statements.
On 17.05.2013 17:19, dkl13 wrote:
> I can do some basic SQL, but my overall SQL knowledge is very light.
> What SQL would return the desired results for the scenario below?
>
> * Trac 0.12
> * PostgreSQL 8.3
> * ticket-custom fields:
> o *parent*: e.g., If ticket #22 is a child ticket of ticket #14,
> ticket #22 will have 14 in this field.
> o *backlog_points*: Backlog points as numbers (e.g., 11), although
> this field is a text field (so to_number() needed?).
Trac SQL statement design principle: Do not use db back-end-specific
expressions. Ideally back-end type an version shouldn't matter at all.
> *Desired report:*
>
> * Display *only parent tickets* in the report. These parent tickets
> are identified by *parent = blank* (ticket_custom table).
Simple.
> * Sum the backlog_points (ticket_custom table) for any child tickets
> for each parent and display that on each row of the parent tickets
> report (Total Backlog Points)
Not hard.
> * Would also be great to have a column that lists all the child
> tickets as clickable ticket links, but that may not be possible.
Could be hacked by string-concatenation (not cross-db) for you
individual Trac instance. A generic approach is using the
`get_resource_url` from `trac.resource.ResourceSystem`, that does not
rely on any hard-coded URL parts.
> *Sample data:*
>
> * #14 = parent ticket
> o #22 (backlog_points = 5) = child of #14, so has 14 in parent field
> o #24 (backlog_points = 1) = child of #14, so has 14 in parent field
> o #25 (backlog_points = 7) = child of #14, so has 14 in parent field
> * #12 = parent ticket
> o #15 (backlog_points = 1) = child of #12, so has 12 in parent field
> o #17 (backlog_points = 5) = child of #12, so has 12 in parent field
>
> Report:
>
> *ID Total Backlog Points Child Tickets*
> 14 13 22, 24, 25
> 12 6 15, 17
>
> Most of the scrum/agile plugins we've tried, by the way, have
> problems. (We are on an out-dated version of Python, which is a
> situation 1) I have no control over, and 2) probably won't change for a
> year or so. This tends to limit what plugins we can use.) Thanks!
Depends on how outdated is 'outdated' in your case. Trac is always
running on an old Python version from a Python developers point. For new
projects Python3.2 or later might be fine, while Trac cut Python
compatibility to 'only' Python2.5, with some of the currently maintained
Trac plugins still caring for Python2.4. Anything older will certainly
cause issues, and you'll get sub-optimal results, if not worse.
While I know your situation only too good, it doesn't pay-off at all to
keep backwards-compatibility at all cost. As soon as developers us newer
versions themselves, support for these older versions will generally
degrade over time. And the OS is meant to serve (well) for supporting
application software, not the other way round, at least its not meant to
be like that.
Even Debian, that is often referenced for shipping rather aged software
packages, had Python2.6.6, 2.5.5 und 3.1.3 in version 6.0 ('squeeze'),
2.7.3 and 3.2.3 in current stable 1.0 (code-named 'wheezy'). Only RHEL
seems to lag behind, what becomes a real pain at times. You get the
distro you deserve. No, joking here. Better nudge you admins etc. to get
you a more recent system at any rate.
Steffen Hoffmann
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org/
iEYEARECAAYFAlGZ25kACgkQ31DJeiZFuHcNAQCcDtiB4wH3GvH6hTeNKP7aGkEf
xVEAmwb+87aCSYXKocr2xVf/oUU0F4A9
=CBHT
-----END PGP SIGNATURE-----