[bloodhound-core] branch main updated: Add .editorconfig and license reporting

2023-04-07 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


The following commit(s) were added to refs/heads/main by this push:
 new dc29fee  Add .editorconfig and license reporting
dc29fee is described below

commit dc29feeb1ad53261ac5b5e69e862d3635f8a0c49
Author: Gary Martin 
AuthorDate: Sat Apr 8 02:08:31 2023 +0100

Add .editorconfig and license reporting

* Fix license & headers with help from Apache Rat
* Used black to fix some format inconsistencies
---
 trackers/views.py => .editorconfig|  14 ++-
 .gitignore|   1 +
 bh_core/__init__.py => .rat-ignore|   3 +
 LICENSE   | 202 ++
 Makefile  |  20 +++
 NOTICE|   5 +
 bh_core/__init__.py   |   1 -
 bh_core/settings.py   |  81 ++--
 bh_core/urls.py   |  22 +---
 docker/db/Dockerfile  |  17 +++
 docker/docker-compose.yaml|  17 +++
 functional_tests.py   |  15 ++-
 pom.xml   |  40 ++
 pyproject.toml|  17 +++
 pytest.ini|  17 +++
 trackers/api/serializers.py   | 161 +---
 trackers/api/tests/test_product_api.py|  50 
 trackers/api/tests/test_ticket_api.py | 120 +++---
 trackers/api/tests/test_ticket_api_hyp.py |  25 ++--
 trackers/api/urls.py  |  56 +
 trackers/api/views.py |  32 ++---
 trackers/apps.py  |   4 +-
 trackers/fixtures/empty.yml   |  18 +++
 trackers/models.py|  52 
 trackers/tests/__init__.py|  16 +++
 trackers/tests/test_models.py |  24 ++--
 trackers/tests/tests.py   |   8 +-
 trackers/urls.py  |   4 +-
 trackers/views.py |   2 +-
 29 files changed, 702 insertions(+), 342 deletions(-)

diff --git a/trackers/views.py b/.editorconfig
similarity index 83%
copy from trackers/views.py
copy to .editorconfig
index 0861c17..bc6be01 100644
--- a/trackers/views.py
+++ b/.editorconfig
@@ -15,8 +15,16 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-from django.http import HttpResponse
+root = true
 
+[*]
+end_of_line = lf
+insert_final_newline = true
 
-def home(request):
-return HttpResponse('Bloodhound Trackers')
+[*.{html,js,sh}]
+indent_style = space
+indent_size = 2
+
+[*.py]
+indent_style = space
+indent_size = 4
diff --git a/.gitignore b/.gitignore
index fd75ab4..17a2fea 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@ db.sqlite3
 tags
 *.log
 .hypothesis/
+.pytest_cache/
diff --git a/bh_core/__init__.py b/.rat-ignore
similarity index 96%
copy from bh_core/__init__.py
copy to .rat-ignore
index 534df97..aaad8b7 100644
--- a/bh_core/__init__.py
+++ b/.rat-ignore
@@ -15,3 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+**/*.pyc
+README.md
+poetry.lock
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 000..d645695
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+   Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+  "License" shall mean the terms and conditions for use, reproduction,
+  and distribution as defined by Sections 1 through 9 of this document.
+
+  "Licensor" shall mean the copyright owner or entity authorized by
+  the copyright owner that is granting the License.
+
+  "Legal Entity" shall mean the union of the acting entity and all
+  other entities that control, are controlled by, or are under common
+  control with that entity. For the purposes of this definition,
+  "control" means (i) the power, direct or indirect, to cause the
+  direction or management of such entity, whether by contract or
+  otherwise, or (ii) ownership of fifty percent (50%) or more of the
+  outstanding shares, or (iii) beneficial ownership of such entity.
+
+  "You" (or "Your") shall mean an individual or Legal Entity
+  exercising permissions granted by this License.
+
+  "Source" form shall mean the preferred form for making modifications,
+  including but not limited to software source code, documentation
+  source, and configuration files.
+
+  "Object" form shall mean any form resulting from mechanic

svn commit: r1906109 - in /bloodhound/site: download.html index.html

2022-12-20 Thread gjm
Author: gjm
Date: Tue Dec 20 14:23:28 2022
New Revision: 1906109

URL: http://svn.apache.org/viewvc?rev=1906109=rev
Log:
Fix insecure urls (thanks engelen); fix footer

Modified:
bloodhound/site/download.html
bloodhound/site/index.html

Modified: bloodhound/site/download.html
URL: 
http://svn.apache.org/viewvc/bloodhound/site/download.html?rev=1906109=1906108=1906109=diff
==
--- bloodhound/site/download.html (original)
+++ bloodhound/site/download.html Tue Dec 20 14:23:28 2022
@@ -46,7 +46,7 @@
 
   
   
-You may also consult the http://www.apache.org/mirrors/;>complete list of mirrors.
+You may also consult the https://www.apache.org/dyn/closer.cgi;>complete list of mirrors.
   
 
 
@@ -79,12 +79,12 @@
   Verifying the Integrity of Downloaded Files
   It is essential that you verify the integrity of the downloaded
   files using the PGP signatures and/or file checksums. Please read
-  http://httpd.apache.org/dev/verification.html;>Verifying 
Apache HTTP Server Releases for
+  https://httpd.apache.org/dev/verification.html;>Verifying 
Apache HTTP Server Releases for
   more information on why you should verify our releases.
   The PGP signatures can be verified using PGP or GPG. First
   download the https://people.apache.org/keys/group/bloodhound.asc;>KEYS
   as well as the asc signature file for the particular distribution.
-  Make sure you get these files from the http://www.apache.org/dist/bloodhound/;>main distribution directory,
+  Make sure you get these files from the https://www.apache.org/dist/bloodhound/;>main distribution directory,
   rather that from a mirror. Using GPG you can verify the signatures
   as follows:
 
@@ -96,11 +96,12 @@ $ gpg --verify apache-bloodhound-[versio
   
 
   
-http://www.apache.org/licenses/;>License
-http://www.apache.org/foundation/sponsorship.html;>Sponsorship
-http://www.apache.org/foundation/thanks.html;>Thanks
-http://www.apache.org/security/;>Security
-http://www.apache.org/;>Apache Software 
Foundation
+   https://www.apache.org/licenses/;>License
+   https://www.apache.org/foundation/sponsorship.html;>Sponsorship
+   https://www.apache.org/foundation/thanks.html;>Thanks
+   https://www.apache.org/security/;>Security
+   https://privacy.apache.org/policies/privacy-policy-public.html;>Privacy 
Policy
+   https://www.apache.org/;>Apache Software Foundation
   
   Apache Bloodhound, Bloodhound, Apache, the Apache feather logo, 
and the Apache Bloodhound project logo are trademarks of The Apache Software 
Foundation.
   All other marks mentioned may be trademarks or registered 
trademarks of their respective owners.

Modified: bloodhound/site/index.html
URL: 
http://svn.apache.org/viewvc/bloodhound/site/index.html?rev=1906109=1906108=1906109=diff
==
--- bloodhound/site/index.html (original)
+++ bloodhound/site/index.html Tue Dec 20 14:23:28 2022
@@ -18,7 +18,7 @@
Keep track of features, tasks and 
bugs

2014-12-11 - Version 0.8 has been released. https://www.apache.org/dyn/closer.cgi/bloodhound/apache-bloodhound-0.8.tar.gz;>Download
 now
-   Standing on the shoulders of http://trac.edgewall.org/;>Trac, Apache Bloodhound is a free and open 
source project hosted by the http://www.apache.org;>Apache Software 
Foundation.
+   Standing on the shoulders of https://trac.edgewall.org/;>Trac, Apache Bloodhound is a free and 
open source project hosted by the https://www.apache.org;>Apache 
Software Foundation.


@@ -60,12 +60,12 @@



-   http://www.apache.org/licenses/;>License
-   http://www.apache.org/foundation/sponsorship.html;>Sponsorship
-   http://www.apache.org/foundation/thanks.html;>Thanks
-   http://www.apache.org/security/;>Security
+   https://www.apache.org/licenses/;>License
+   https://www.apache.org/foundation/sponsorship.html;>Sponsorship
+   https://www.apache.org/foundation/thanks.html;>Thanks
+   https://www

[bloodhound-core] 02/02: Add show-urls make command to help with discovery

2022-12-20 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 3e8288f60a341dab1e997d6fd732525ba26c120d
Author: Gary Martin 
AuthorDate: Sat Dec 17 15:09:33 2022 +

Add show-urls make command to help with discovery
---
 Makefile|  5 -
 bh_core/settings.py |  1 +
 trackers/models.py  | 24 ++--
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 1d80d0e..c446a69 100644
--- a/Makefile
+++ b/Makefile
@@ -63,7 +63,7 @@ endif
 .PHONY: selenium-clean
 
 functional-test: selenium-start
-   poetry run python functional_tests.py
+   $(PYTHON) functional_tests.py
 .PHONY: functional-test
 
 clean-deplock:
@@ -86,3 +86,6 @@ endif
 
 full-clean: clean-deplock clean-venv clean-db selenium-clean
 .PHONY: full-clean
+
+show-urls: manage-show_urls
+.PHONY: show-urls
diff --git a/bh_core/settings.py b/bh_core/settings.py
index 37ac64b..a6de119 100644
--- a/bh_core/settings.py
+++ b/bh_core/settings.py
@@ -60,6 +60,7 @@ INSTALLED_APPS = [
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'rest_framework',
+'django_extensions',
 'drf_yasg',
 ]
 
diff --git a/trackers/models.py b/trackers/models.py
index 373235a..443e92c 100644
--- a/trackers/models.py
+++ b/trackers/models.py
@@ -15,6 +15,8 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+"""Main DB models for Apache Bloodhound."""
+
 import logging
 
 from django.db import models
@@ -23,6 +25,8 @@ logger = logging.getLogger(__name__)
 
 
 class Product(models.Model):
+"""Product table."""
+
 prefix = models.TextField(primary_key=True)
 name = models.TextField()
 description = models.TextField(blank=True, null=True)
@@ -33,7 +37,7 @@ class Product(models.Model):
 
 
 class ProductConfig(models.Model):
-"""Possibly legacy table - keeping for now"""
+"""Possibly legacy table - keeping for now."""
 
 product = models.ForeignKey(Product, on_delete=models.CASCADE)
 section = models.TextField()
@@ -46,7 +50,7 @@ class ProductConfig(models.Model):
 
 
 class ProductResourceMap(models.Model):
-"""Possibly legacy model - keeping for now"""
+"""Possibly legacy model - keeping for now."""
 
 product_id = models.ForeignKey(Product, on_delete=models.CASCADE)
 resource_type = models.TextField(blank=True, null=True)
@@ -57,6 +61,8 @@ class ProductResourceMap(models.Model):
 
 
 class Component(models.Model):
+"""Component table."""
+
 name = models.TextField(primary_key=True)
 owner = models.TextField(blank=True, null=True)
 description = models.TextField(blank=True, null=True)
@@ -72,6 +78,8 @@ class Component(models.Model):
 
 
 class Enum(models.Model):
+"""Enum table."""
+
 type = models.TextField(primary_key=True)
 name = models.TextField()
 value = models.TextField(blank=True, null=True)
@@ -83,6 +91,8 @@ class Enum(models.Model):
 
 
 class Milestone(models.Model):
+"""Milestone table."""
+
 name = models.TextField(primary_key=True)
 due = models.BigIntegerField(blank=True, null=True)
 completed = models.BigIntegerField(blank=True, null=True)
@@ -99,6 +109,8 @@ class Milestone(models.Model):
 
 
 class Version(models.Model):
+"""Version table."""
+
 name = models.TextField(primary_key=True)
 time = models.BigIntegerField(blank=True, null=True)
 description = models.TextField(blank=True, null=True)
@@ -114,6 +126,8 @@ class Version(models.Model):
 
 
 class Ticket(models.Model):
+"""Ticket table."""
+
 uid = models.AutoField(primary_key=True)
 type = models.ForeignKey(
 Enum,
@@ -188,6 +202,8 @@ class Ticket(models.Model):
 
 
 class TicketChange(models.Model):
+"""TicketChange table."""
+
 ticket = models.ForeignKey(
 Ticket,
 on_delete=models.PROTECT,
@@ -211,6 +227,8 @@ class TicketChange(models.Model):
 
 
 class TicketCustom(models.Model):
+"""TicketCustom table."""
+
 ticket = models.ForeignKey(Ticket, on_delete=models.PROTECT)
 name = models.TextField()
 value = models.TextField(blank=True, null=True)
@@ -222,6 +240,8 @@ class TicketCustom(models.Model):
 
 
 class Report(models.Model):
+"""Report table - potentially legacy."""
+
 author = models.TextField(blank=True, null=True)
 title = models.TextField(blank=True, null=True)
 query = models.TextField(blank=True, null=True)



[bloodhound-core] branch main updated (a3c95e3 -> 3e8288f)

2022-12-20 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


from a3c95e3  Update to Django 4 and minimum python 3.8
 new 8ba4dfd  Introduce Makefile for common operations
 new 3e8288f  Add show-urls make command to help with discovery

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Makefile| 91 +
 bh_core/settings.py |  1 +
 pyproject.toml  | 12 +++
 trackers/models.py  | 24 --
 4 files changed, 120 insertions(+), 8 deletions(-)
 create mode 100644 Makefile



[bloodhound-core] 01/02: Introduce Makefile for common operations

2022-12-20 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 8ba4dfd7ecc55ce80cbe93039fa7a0df6ecff8d2
Author: Gary Martin 
AuthorDate: Sat Nov 5 01:14:44 2022 +

Introduce Makefile for common operations

 * Add targets for various django commands to reduce need for running
   through `poetry run`
 * Adds targets to help with running selenium for testing via docker;
   expected to be particularly useful for someone running their
   development environment from a podman based "toolbox"
---
 Makefile   | 88 ++
 pyproject.toml | 12 
 2 files changed, 94 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
new file mode 100644
index 000..1d80d0e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,88 @@
+DOCKER_BIN := $(shell command -v docker || command -v podman)
+SELENIUM_CONTAINER ?= selenium-server
+
+ifneq (,$(wildcard /run/.containerenv))
+   DOCKER_HOST := unix:///run/user/$(UID)/podman/podman.sock
+   DOCKER_CMD := flatpak-spawn --host podman
+else
+   DOCKER_CMD := $(DOCKER_BIN)
+endif
+
+PYTHON = poetry run python
+MANAGE = $(PYTHON) manage.py
+
+install:
+   poetry install
+.PHONY: install
+
+manage-%:
+   $(MANAGE) $*
+.PHONY: manage-%
+
+makemigrations: manage-makemigrations
+   $(MANAGE) makemigrations trackers
+.PHONY: makemigrations
+
+migrate: makemigrations manage-migrate
+createsuperuser: manage-createsuperuser
+shell: manage-shell
+runserver: manage-runserver
+test: manage-test
+
+CONTAINER_FILTER = -f name=$(SELENIUM_CONTAINER)
+EXITED_CONTAINER_FILTER = -f status=exited $(CONTAINER_FILTER)
+
+selenium-start:
+ifneq (,$(shell $(DOCKER_CMD) ps -q $(EXITED_CONTAINER_FILTER)))
+   $(DOCKER_CMD) start $(SELENIUM_CONTAINER)
+else ifneq (,$(shell $(DOCKER_CMD) ps -q $(CONTAINER_FILTER)))
+else
+   $(DOCKER_CMD) run -d --network host --privileged --name 
$(SELENIUM_CONTAINER) \
+   docker.io/selenium/standalone-firefox
+endif
+   $(DOCKER_CMD) ps $(CONTAINER_FILTER)
+   sleep 10
+.PHONY: selenium-start
+
+selenium-stop:
+ifneq (,$(shell $(DOCKER_CMD) ps -q $(CONTAINER_FILTER)))
+   $(DOCKER_CMD) stop $(SELENIUM_CONTAINER)
+   $(DOCKER_CMD) ps $(EXITED_CONTAINER_FILTER)
+endif
+.PHONY: selenium-stop
+
+selenium-clean:
+ifneq (,$(shell $(DOCKER_CMD) ps -q $(CONTAINER_FILTER)))
+   $(DOCKER_CMD) stop $(SELENIUM_CONTAINER)
+   sleep 1
+endif
+ifneq (,$(shell $(DOCKER_CMD) ps -q $(EXITED_CONTAINER_FILTER)))
+   $(DOCKER_CMD) container rm $(SELENIUM_CONTAINER)
+   @echo $(SELENIUM_CONTAINER) Removed
+endif
+.PHONY: selenium-clean
+
+functional-test: selenium-start
+   poetry run python functional_tests.py
+.PHONY: functional-test
+
+clean-deplock:
+ifeq (haslock,$(shell [ -f poetry.lock ] && echo haslock ))
+   rm poetry.lock
+endif
+.PHONY: clean-deplock
+
+clean-venv:
+ifeq (hasvenv,$(shell [ -d .venv ] && echo hasvenv ))
+   rm -r .venv
+endif
+.PHONY: clean-venv
+
+clean-db:
+ifeq (hasdb,$(shell [ -f db.sqlite3 ] && echo hasdb ))
+   rm db.sqlite3
+endif
+.PHONY: clean-db
+
+full-clean: clean-deplock clean-venv clean-db selenium-clean
+.PHONY: full-clean
diff --git a/pyproject.toml b/pyproject.toml
index 94367d4..83135ca 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -7,10 +7,10 @@ license = "Apache-2.0"
 
 [tool.poetry.dependencies]
 python = "^3.8"
-Django = "^4.0.3"
-djangorestframework = "^3.13.1"
-Markdown = "^3.3.6"
-drf-yasg = "^1.20.0"
+Django = "^4.1.2"
+djangorestframework = "^3.14.0"
+Markdown = "^3.4.1"
+drf-yasg = "^1.21.4"
 drf-nested-routers = "^0.93.4"
 PyYAML = "^6.0"
 psycopg2 = { version = "^2.9", optional = true }
@@ -18,8 +18,8 @@ psycopg2-binary = { version = "^2.9", optional = true }
 
 [tool.poetry.dev-dependencies]
 selenium = "^3.141.0"
-django-extensions = "^3.1.3"
-hypothesis = "^6.21.0"
+django-extensions = "^3.2.1"
+hypothesis = "^6.56.4"
 
 [tool.poetry.extras]
 postgres = ["psycopg2"]



svn commit: r1904060 - /bloodhound/site/index.html

2022-09-14 Thread gjm
Author: gjm
Date: Wed Sep 14 08:08:53 2022
New Revision: 1904060

URL: http://svn.apache.org/viewvc?rev=1904060=rev
Log:
Add privacy policy link to site

Modified:
bloodhound/site/index.html

Modified: bloodhound/site/index.html
URL: 
http://svn.apache.org/viewvc/bloodhound/site/index.html?rev=1904060=1904059=1904060=diff
==
--- bloodhound/site/index.html (original)
+++ bloodhound/site/index.html Wed Sep 14 08:08:53 2022
@@ -17,11 +17,11 @@
Manage software products
Keep track of features, tasks and 
bugs

-   2014-12-11 - Version 0.8 has been released. http://goo.gl/HDqpE5;>Download now
+   2014-12-11 - Version 0.8 has been released. https://www.apache.org/dyn/closer.cgi/bloodhound/apache-bloodhound-0.8.tar.gz;>Download
 now
Standing on the shoulders of http://trac.edgewall.org/;>Trac, Apache Bloodhound is a free and open 
source project hosted by the http://www.apache.org;>Apache Software 
Foundation.
-   https://twitter.com/apbloodhound; 
class="twitter-follow-button" data-show-count="false" data-dnt="true">Follow 
@apbloodhound
-   http://ghbtns.com/github-btn.html?user=apache=bloodhound=watch=true;
-  allowtransparency="true" frameborder="0" scrolling="0" width="110" 
height="20">
+   
+   


Multiple Products
@@ -42,7 +42,7 @@

Download, try, contribute
 
-   http://goo.gl/y5ICQQ;>Download now
+   https://www.apache.org/dyn/closer.lua/bloodhound/apache-bloodhound-0.8.tar.gz;>Download
 now
 https://live.bloodhound.apache.org/bloodhound/products/BHD/wiki/BloodhoundInstall;>Installation
 instructions
https://live.bloodhound.apache.org/bloodhound/;>Wiki + Issue tracker

@@ -64,6 +64,7 @@
http://www.apache.org/foundation/sponsorship.html;>Sponsorship
http://www.apache.org/foundation/thanks.html;>Thanks
http://www.apache.org/security/;>Security
+   https://privacy.apache.org/policies/privacy-policy-public.html;>Privacy 
Policy
http://www.apache.org/;>Apache 
Software Foundation

Apache Bloodhound, Bloodhound, Apache, the Apache 
feather logo, and the Apache Bloodhound project logo are trademarks of The 
Apache Software Foundation.
@@ -71,7 +72,7 @@



-   !function(d,s,id){var 
js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document,
 'script', 'twitter-wjs');
-   https://platform.twitter.com/widgets.js&quot</a>; 
charset="utf-8">
+   
 
 




[bloodhound-core] branch main updated: Update to Django 4 and minimum python 3.8

2022-03-14 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


The following commit(s) were added to refs/heads/main by this push:
 new a3c95e3  Update to Django 4 and minimum python 3.8
a3c95e3 is described below

commit a3c95e3258c6561dd3e4e6d483170eb869680ab6
Author: Gary Martin 
AuthorDate: Mon Mar 14 13:28:23 2022 +

Update to Django 4 and minimum python 3.8
---
 README.md  |  2 +-
 pyproject.toml | 11 ++-
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md
index eef74ec..c093bbf 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ This version of Apache Bloodhound requires Python, Poetry and 
Django.
 
 ### Installing Python
 
-The versions of Python that can be used are currently 3.6, 3.7, 3.8 and 3.9.
+The versions of Python that can be used are currently 3.8, 3.9 and 3.10.
 
 Where convenient is it sensible to go for the newest release of Python that
 you can.
diff --git a/pyproject.toml b/pyproject.toml
index 025e0d5..94367d4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -6,12 +6,13 @@ authors = ["Apache Bloodhound "]
 license = "Apache-2.0"
 
 [tool.poetry.dependencies]
-python = "^3.6"
-django = "^3.2.2"
-django-rest-framework = "^0.1.0"
+python = "^3.8"
+Django = "^4.0.3"
+djangorestframework = "^3.13.1"
+Markdown = "^3.3.6"
 drf-yasg = "^1.20.0"
-drf-nested-routers = "^0.93.3"
-pyyaml = "^5.4.1"
+drf-nested-routers = "^0.93.4"
+PyYAML = "^6.0"
 psycopg2 = { version = "^2.9", optional = true }
 psycopg2-binary = { version = "^2.9", optional = true }
 


[bloodhound-core] branch main updated (4228632 -> 31087bb)

2022-03-14 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git.


from 4228632  Relax api regex for some models allowng . in names
 new 8cede40  Fix docker-compose usage in README.md
 new 31087bb  Beginning of integrating ticketchange model

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .gitignore  |  1 +
 README.md   |  7 ---
 trackers/api/serializers.py | 36 +++-
 trackers/api/urls.py|  1 +
 trackers/api/views.py   | 10 ++
 trackers/models.py  | 15 ---
 6 files changed, 63 insertions(+), 7 deletions(-)


[bloodhound-core] 01/02: Fix docker-compose usage in README.md

2022-03-14 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 8cede40fc3e7dbb36d646ad3fa449c07e633d1d4
Author: Gary Martin 
AuthorDate: Sun Mar 13 23:47:29 2022 +

Fix docker-compose usage in README.md
---
 README.md | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 505d260..eef74ec 100644
--- a/README.md
+++ b/README.md
@@ -193,7 +193,7 @@ If you have docker-compose installed, the 
`selenium-firefox` container can be
 brought up from the `docker` directory with:
 
 ```
-docker-compose up selenium-firefox -d
+docker-compose up -d selenium-firefox
 ```
 
 Or, with just docker (from any directory):
@@ -264,7 +264,8 @@ instead follow the simplified steps:
 ```
 
 While we recommend the first option, particularly for production deployments,
-the second option may be pragmatic for setting up for development or testing.
+the simplified option may be pragmatic for setting up for development or
+testing.
 
 ### Running Postgresql
 
@@ -287,7 +288,7 @@ If you have docker-compose installed, the db container can 
be brought up from
 the `docker` directory with:
 
 ```
-docker-compose up db -d
+docker-compose up -d db
 ```
 
 ### Specifying the Postgresql Backend


[bloodhound-core] branch main updated: Relax api regex for some models allowng . in names

2021-09-14 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


The following commit(s) were added to refs/heads/main by this push:
 new 4228632  Relax api regex for some models allowng . in names
4228632 is described below

commit 4228632ce8c124e2bec1f76d83e1252ab5af064a
Author: Gary Martin 
AuthorDate: Tue Sep 14 13:36:50 2021 +0100

Relax api regex for some models allowng . in names

Default api urls do not allow '.' characters when matching the names,
presumably to ensure '.' specifications are definitely matched
properly. This patch relaxes this as we are definitely going to want to
allow for '.' for things like version names.

 - change the lookup_value_regex for Component, Milestone and Version
   models
 - add hypothesis tests for testing the values that the api is allowed
   to use for names when creating objects from each list view
---
 pyproject.toml|  2 +
 trackers/api/serializers.py   |  2 -
 trackers/api/tests/test_ticket_api.py | 10 +---
 trackers/api/tests/test_ticket_api_hyp.py | 84 +++
 trackers/api/urls.py  |  1 -
 trackers/api/views.py |  3 ++
 6 files changed, 91 insertions(+), 11 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index 1eec374..025e0d5 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -17,6 +17,8 @@ psycopg2-binary = { version = "^2.9", optional = true }
 
 [tool.poetry.dev-dependencies]
 selenium = "^3.141.0"
+django-extensions = "^3.1.3"
+hypothesis = "^6.21.0"
 
 [tool.poetry.extras]
 postgres = ["psycopg2"]
diff --git a/trackers/api/serializers.py b/trackers/api/serializers.py
index 58d9248..c8e58cd 100644
--- a/trackers/api/serializers.py
+++ b/trackers/api/serializers.py
@@ -3,8 +3,6 @@ from django.shortcuts import get_object_or_404
 from rest_framework import serializers
 from rest_framework.reverse import reverse
 from ..models import Component, Milestone, Product, Ticket, Version
-from rest_framework_nested.serializers import NestedHyperlinkedModelSerializer
-from rest_framework_nested.relations import NestedHyperlinkedIdentityField
 from functools import partial
 
 
diff --git a/trackers/api/tests/test_ticket_api.py 
b/trackers/api/tests/test_ticket_api.py
index b8afb0a..b4e30c0 100644
--- a/trackers/api/tests/test_ticket_api.py
+++ b/trackers/api/tests/test_ticket_api.py
@@ -15,7 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
-from django.contrib.auth.models import User
 from django.urls import reverse
 from rest_framework.test import APITestCase
 from rest_framework import status
@@ -27,12 +26,7 @@ from ...models import (
 Ticket,
 Version,
 )
-from ..serializers import (
-ComponentSerializer,
-MilestoneSerializer,
-TicketSerializer,
-VersionSerializer,
-)
+
 
 class TicketApiTest(APITestCase):
 """Tests for ticket API"""
@@ -313,7 +307,7 @@ class ComponentApiTest(APITestCase):
 
 
 class MilestoneApiTest(APITestCase):
-"""Tests for component API"""
+"""Tests for milestone API"""
 
 def setUp(self):
 self.product = Product.objects.create(prefix="BH", name="Bloodhound")
diff --git a/trackers/api/tests/test_ticket_api_hyp.py 
b/trackers/api/tests/test_ticket_api_hyp.py
new file mode 100644
index 000..f54fc50
--- /dev/null
+++ b/trackers/api/tests/test_ticket_api_hyp.py
@@ -0,0 +1,84 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+from django.urls import reverse
+from hypothesis import example, given, strategies as st
+from hypothesis.extra.django import TestCase
+from rest_framework.test import APIClient, APIRequestFactory
+from rest_framework import status
+
+from ...models import Product
+
+name_st = st.text(
+st.characters(
+blacklist_characters="/",
+max_codepoint=1000,
+blacklist_categories=("

[bloodhound-core] branch main updated: Simplify working with selenium with docker

2021-09-07 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


The following commit(s) were added to refs/heads/main by this push:
 new 4de51ac  Simplify working with selenium with docker
4de51ac is described below

commit 4de51aca83f4f54cf6cb6db295b6fb6c48be78e2
Author: Gary Martin 
AuthorDate: Wed Sep 8 01:04:07 2021 +0100

Simplify working with selenium with docker

With the assumption that docker can be run by the user, hopefully the
updates to the instructions will make it more convenient to run selenium
based tests with firefox in a consistent way across development
platforms.
---
 README.md  | 71 --
 docker/docker-compose.yaml |  6 
 functional_tests.py| 20 ++---
 3 files changed, 59 insertions(+), 38 deletions(-)

diff --git a/README.md b/README.md
index 50d021b..505d260 100644
--- a/README.md
+++ b/README.md
@@ -179,29 +179,37 @@ This may be replaced with pytest.
 Unit tests are run with the following command:
 
 ```
-poetry run python manage.py test
+poetry run python manage.py test trackers
 ```
 
 ## Integration Tests
 
-The [Selenium] tests currently require that Firefox is installed and
-[geckodriver] is also on the path. If you do not already have geckodriver,
-the following shows one method to get it for linux:
+The integration tests are based on [Selenium] and Firefox. For convenience of
+setup, these tests currently expect to connect to Selenium at
 
+  http://127.0.0.1:/wd/hub
+
+If you have docker-compose installed, the `selenium-firefox` container can be
+brought up from the `docker` directory with:
+
+```
+docker-compose up selenium-firefox -d
+```
+
+Or, with just docker (from any directory):
+
+```
+docker run -d --network host --privileged --name server \
+docker.io/selenium/standalone-firefox
 ```
-PLATFORM_EXT="linux64.tar.gz"
-BIN_LOCATION="$HOME/.local/bin"
-TMP_DIR=/tmp/geckodriver_download
-mkdir -p "$BIN_LOCATION" "$TMP_DIR"
 
-LATEST=$(wget -O - https://github.com/mozilla/geckodriver/releases/latest 2>&1 
| awk 'match($0, /geckodriver-(v.*)-'"$PLATFORM_EXT"'/, a) {print a[1]; exit}')
-wget -N -P "$TMP_DIR" 
"https://github.com/mozilla/geckodriver/releases/download/$LATEST/geckodriver-$LATEST-$PLATFORM_EXT;
-tar -x geckodriver -zf "$TMP_DIR/geckodriver-$LATEST-$PLATFORM_EXT" -O > 
"$BIN_LOCATION"/geckodriver
-chmod +x "$BIN_LOCATION"/geckodriver
+Running the functional tests directly requires a running server and so run
+
+```
+poetry run python manage.py runserver
 ```
 
-If `$BIN_LOCATION` is on the system path, and the development server is
-running, it should be possible to run the integration tests.
+in one terminal and in a second:
 
 ```
 poetry run python functional_tests.py
@@ -211,7 +219,6 @@ There are currently not many tests - those that are there 
are in place to test
 the setup above and assume that there will be useful tests in due course.
 
 [Selenium]: https://selenium.dev/
-[geckodriver]: https://firefox-source-docs.mozilla.org/testing/geckodriver/
 
 ## Development notes:
 
@@ -276,23 +283,13 @@ The docker/db/scripts directory allows for the provision 
of valid sql commands
 in *sql files that will be copied into the container and used to initialize
 the database if required.
 
-If you have docker-compose installed, the db container can be brought up with:
+If you have docker-compose installed, the db container can be brought up from
+the `docker` directory with:
 
 ```
-docker-compose up -d
+docker-compose up db -d
 ```
 
-If you have podman instead of docker, it is possible to use docker-compose in
-a similar way. Consult [this article][Use docker-compose with podman] for the
-details but note that, at the time of writing, there is an error in the
-article and you need to use
-
-```
-export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock
-```
-
-[Use docker-compose with podman]: 
https://fedoramagazine.org/use-docker-compose-with-podman-to-orchestrate-containers-on-fedora/
-
 ### Specifying the Postgresql Backend
 
 Finally you will need to specify the database to connect to. At the moment
@@ -315,3 +312,21 @@ DATABASES = {
 
 Note that this aspect of the setup should be expected to change to smooth over
 some of the difficulties around editing a file that is in source control.
+
+## Notes on using podman instead of docker
+
+If you have podman instead of docker, the `podman` command should work as a
+drop-in replacement for `docker` commands where these are used in this README.
+
+It should also now be possible to use `docker-compose` commands directly with
+a little preparation. Consult [this article][Use docker-compose with podman]
+for details but note that, at the time of writing, there is an error in 

[bloodhound-core] branch main updated: Add initial help for postgresql setup

2021-08-31 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


The following commit(s) were added to refs/heads/main by this push:
 new ded2c22  Add initial help for postgresql setup
ded2c22 is described below

commit ded2c229466f50f57081d5e7d4062e1618ac85c7
Author: Gary Martin 
AuthorDate: Tue Aug 31 22:08:37 2021 +0100

Add initial help for postgresql setup
---
 README.md| 95 
 docker/db/Dockerfile |  5 +++
 docker/db/scripts/.gitignore |  1 +
 docker/docker-compose.yaml   | 11 +
 pyproject.toml   |  6 +++
 5 files changed, 118 insertions(+)

diff --git a/README.md b/README.md
index 746e4d4..50d021b 100644
--- a/README.md
+++ b/README.md
@@ -220,3 +220,98 @@ Fixtures for tests when required can be generated with:
 ```
 poetry run python manage.py dumpdata trackers --format=yaml --indent=2 > 
trackers/fixtures/[fixture-name].yaml
 ```
+
+## Postgresql Support
+
+While the sqlite database backend is convenient to reduce the complexity of
+setting up development environments, Django provides us with options to use a
+range of database backends.
+
+Initially we will concentrate on making it easier to support the Postgresql
+backend.
+
+### Requirements for connecting to a Postgresql database
+
+There are a number of options available to satisfy the dependencies for
+Postgresql support. For convenience we provide two alternatives through our
+poetry setup.
+
+Full installation for production like installation should use the following
+steps:
+
+ 1. Provide build dependencies (example for Fedora):
+```
+sudo dnf install gcc python3-devel libpq-devel
+```
+ 2. Use poetry to install the python dependencies from pypi:
+```
+poetry install --extras=postgres
+```
+
+Alternatively it is possible to avoid providing the build dependencies and
+instead follow the simplified steps:
+
+ 1. Use poetry to install the simplified python dependencies:
+```
+poetry install --extras=postgres-binary
+```
+
+While we recommend the first option, particularly for production deployments,
+the second option may be pragmatic for setting up for development or testing.
+
+### Running Postgresql
+
+Although at this point we should have the ability to connect to a database
+through python, we have not addressed actually running a Postgresql database.
+
+For convenience, for development and testing purposes we are going to use
+containers (docker/podman) to address this. Other possibilities for this exist
+including installing and configuring postgresql-server but that is currently
+beyond the scope of this document.
+
+There is a docker folder at the base of the repo that, with a suitable docker
+host environment can be used to start up a postgresql database container.
+
+The docker/db/scripts directory allows for the provision of valid sql commands
+in *sql files that will be copied into the container and used to initialize
+the database if required.
+
+If you have docker-compose installed, the db container can be brought up with:
+
+```
+docker-compose up -d
+```
+
+If you have podman instead of docker, it is possible to use docker-compose in
+a similar way. Consult [this article][Use docker-compose with podman] for the
+details but note that, at the time of writing, there is an error in the
+article and you need to use
+
+```
+export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock
+```
+
+[Use docker-compose with podman]: 
https://fedoramagazine.org/use-docker-compose-with-podman-to-orchestrate-containers-on-fedora/
+
+### Specifying the Postgresql Backend
+
+Finally you will need to specify the database to connect to. At the moment
+this can be achieved by editing the bh_core/settings.py file to change the
+DATABASES to look something like this, depending on the actual connection
+details.
+
+```
+DATABASES = {
+'default': {
+'ENGINE': 'django.db.backends.postgresql',
+'NAME': 'bloodhound',
+'USER': 'bloodhound',
+'PASSWORD': 'postgres',
+'HOST': '127.0.0.1',
+'PORT': '5432',
+ }
+ }
+ ```
+
+Note that this aspect of the setup should be expected to change to smooth over
+some of the difficulties around editing a file that is in source control.
diff --git a/docker/db/Dockerfile b/docker/db/Dockerfile
new file mode 100644
index 000..a0fd219
--- /dev/null
+++ b/docker/db/Dockerfile
@@ -0,0 +1,5 @@
+FROM docker.io/postgres:latest
+ENV LANG en_US.UTF-8
+
+ADD scripts/*sql /docker-entrypoint-initdb.d
+RUN chmod a+r /docker-entrypoint-initdb.d/*
diff --git a/docker/db/scripts/.gitignore b/docker/db/scripts/.gitignore
new file mode 100644
index 000..d1b811b
--- /dev/null
+++ b/docker/db/scripts/.gitignore
@@ -0,0 +1 @@
+*.sql
diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml
new file mode 100644
index 

[bloodhound-core] branch main updated: Adds components, milestones and versions to api

2021-05-27 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


The following commit(s) were added to refs/heads/main by this push:
 new f1162c0  Adds components, milestones and versions to api
f1162c0 is described below

commit f1162c0b6f464071d812a856e68a9640262a8f42
Author: Gary Martin 
AuthorDate: Thu May 27 22:00:31 2021 +0100

Adds components, milestones and versions to api
---
 pyproject.toml |   1 +
 trackers/api/serializers.py| 157 -
 trackers/api/tests/test_product_api.py |  34 +-
 trackers/api/tests/test_ticket_api.py  | 589 +
 trackers/api/urls.py   |   9 +
 trackers/api/views.py  |  30 ++
 trackers/models.py |   3 -
 7 files changed, 792 insertions(+), 31 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index fee9aad..30f3d7f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,6 +11,7 @@ django = "^3.2.2"
 django-rest-framework = "^0.1.0"
 drf-yasg = "^1.20.0"
 drf-nested-routers = "^0.93.3"
+pyyaml = "^5.4.1"
 
 [tool.poetry.dev-dependencies]
 selenium = "^3.141.0"
diff --git a/trackers/api/serializers.py b/trackers/api/serializers.py
index a48abee..58d9248 100644
--- a/trackers/api/serializers.py
+++ b/trackers/api/serializers.py
@@ -1,7 +1,48 @@
 from django.contrib.auth.models import User, Group
 from django.shortcuts import get_object_or_404
 from rest_framework import serializers
-from ..models import Product, Ticket
+from rest_framework.reverse import reverse
+from ..models import Component, Milestone, Product, Ticket, Version
+from rest_framework_nested.serializers import NestedHyperlinkedModelSerializer
+from rest_framework_nested.relations import NestedHyperlinkedIdentityField
+from functools import partial
+
+
+def get_self_url(obj, context, obj_type):
+keywords = {
+'product_prefix': obj.product.prefix,
+}
+if obj_type == 'ticket':
+keywords['product_ticket_id'] = obj.product_ticket_id
+else:
+keywords['name'] = obj.name
+
+return reverse(
+f'product-{obj_type}s-detail',
+kwargs=keywords,
+request=context['request'],
+)
+
+
+class ProductChildSerializer(serializers.HyperlinkedModelSerializer):
+product_url = serializers.SerializerMethodField()
+
+def get_product_url(self, obj):
+keywords = {
+'prefix': obj.product.prefix,
+}
+return reverse(
+'product-detail',
+kwargs=keywords,
+request=self.context['request']
+)
+
+def create(self, validated_data):
+if 'prefix' not in self.context['view'].kwargs.keys():
+prefix = self.context['view'].kwargs['product_prefix']
+product = get_object_or_404(Product.objects.all(), prefix=prefix)
+validated_data['product'] = product
+return super().create(validated_data)
 
 
 class UserSerializer(serializers.HyperlinkedModelSerializer):
@@ -16,25 +57,113 @@ class 
GroupSerializer(serializers.HyperlinkedModelSerializer):
 fields = ('url', 'name')
 
 
-class ProductSerializer(serializers.ModelSerializer):
-class Meta:
-model = Product
-fields = '__all__'
-
+class TicketSerializer(ProductChildSerializer):
+url = serializers.SerializerMethodField()
 
-class TicketSerializer(serializers.ModelSerializer):
 class Meta:
 model = Ticket
 fields = (
+'product_url',
+'url',
 'product_ticket_id',
 'summary',
 'description',
 )
-extra_kwargs = {'product_ticket_id': {'required': False}}
+extra_kwargs = {
+'product_ticket_id': {'required': False},
+}
 
-def create(self, validated_data):
-if 'prefix' not in self.context['view'].kwargs.keys():
-prefix = self.context['view'].kwargs['product_prefix']
-product = get_object_or_404(Product.objects.all(), prefix=prefix)
-validated_data['product'] = product
-return super().create(validated_data)
+def get_url(self, obj):
+return get_self_url(obj, self.context, 'ticket')
+
+
+class ComponentSerializer(ProductChildSerializer):
+url = serializers.SerializerMethodField()
+
+class Meta:
+model = Component
+fields = (
+'product_url',
+'url',
+'name',
+'description',
+'owner',
+)
+
+def get_url(self, obj):
+return get_self_url(obj, self.context, 'component')
+
+
+class MilestoneSerializer(ProductChildSerializer):
+url = serializers.SerializerMethodField()
+
+class Meta:
+model = Milestone
+fields = (
+'product_url',
+'url',
+ 

[bloodhound-core] branch main updated (a840d8e -> e3c1baa)

2021-05-17 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git.


from a840d8e  Change over to poetry; fix swagger; update README
 new dc439b7  Add product model and api tests
 new e3c1baa  Add new ticket system models and more api work

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bh_core/settings.py|   3 +-
 bh_core/urls.py|   1 +
 functional_tests.py|  18 ++-
 pyproject.toml |   1 +
 trackers/admin.py  |   5 +-
 trackers/{ => api}/__init__.py |   0
 trackers/api/serializers.py|  40 ++
 trackers/{ => api/tests}/__init__.py   |   0
 trackers/api/tests/test_product_api.py | 112 
 trackers/{ => api}/urls.py |  32 +++--
 trackers/{ => api}/views.py|  26 ++--
 trackers/apps.py   |   1 +
 trackers/models.py | 197 ++---
 trackers/serializers.py|  56 
 trackers/tests.py  |  93 --
 trackers/tests/__init__.py |   0
 trackers/tests/test_models.py  |  82 
 bh_core/wsgi.py => trackers/tests/tests.py |  26 ++--
 trackers/urls.py   |  16 +--
 trackers/views.py  |  41 --
 20 files changed, 457 insertions(+), 293 deletions(-)
 copy trackers/{ => api}/__init__.py (100%)
 create mode 100644 trackers/api/serializers.py
 copy trackers/{ => api/tests}/__init__.py (100%)
 create mode 100644 trackers/api/tests/test_product_api.py
 copy trackers/{ => api}/urls.py (58%)
 copy trackers/{ => api}/views.py (74%)
 delete mode 100644 trackers/serializers.py
 delete mode 100644 trackers/tests.py
 create mode 100644 trackers/tests/__init__.py
 create mode 100644 trackers/tests/test_models.py
 copy bh_core/wsgi.py => trackers/tests/tests.py (56%)


[bloodhound-core] 02/02: Add new ticket system models and more api work

2021-05-17 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit e3c1baadd8d9b6dd09bc0f3e355aaf70c5f4f49e
Author: Gary Martin 
AuthorDate: Sun May 16 23:44:36 2021 +0100

Add new ticket system models and more api work

 - nests ticket under correct product
 - ticket creation and update take product context into account
---
 pyproject.toml|   1 +
 trackers/admin.py |   5 +-
 trackers/api/serializers.py   |  55 --
 trackers/api/urls.py  |  27 +--
 trackers/api/views.py |  23 +++---
 trackers/models.py| 169 ++
 trackers/tests/test_models.py |  45 ++-
 trackers/tests/tests.py   |  58 ---
 8 files changed, 214 insertions(+), 169 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index c0671f9..fee9aad 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,6 +10,7 @@ python = "^3.6"
 django = "^3.2.2"
 django-rest-framework = "^0.1.0"
 drf-yasg = "^1.20.0"
+drf-nested-routers = "^0.93.3"
 
 [tool.poetry.dev-dependencies]
 selenium = "^3.141.0"
diff --git a/trackers/admin.py b/trackers/admin.py
index 2a4a378..8634528 100644
--- a/trackers/admin.py
+++ b/trackers/admin.py
@@ -19,7 +19,6 @@
 from django.contrib import admin
 
 # Register your models here.
-from trackers.models import Ticket, ChangeEvent
+from trackers.models import Product
 
-admin.site.register(Ticket)
-admin.site.register(ChangeEvent)
+admin.site.register(Product)
diff --git a/trackers/api/serializers.py b/trackers/api/serializers.py
index 92db9c6..a48abee 100644
--- a/trackers/api/serializers.py
+++ b/trackers/api/serializers.py
@@ -1,7 +1,7 @@
 from django.contrib.auth.models import User, Group
+from django.shortcuts import get_object_or_404
 from rest_framework import serializers
-from trackers import models
-from ..models import Product
+from ..models import Product, Ticket
 
 
 class UserSerializer(serializers.HyperlinkedModelSerializer):
@@ -23,41 +23,18 @@ class ProductSerializer(serializers.ModelSerializer):
 
 
 class TicketSerializer(serializers.ModelSerializer):
-api_url = serializers.SerializerMethodField()
-api_events_url = serializers.SerializerMethodField()
-
 class Meta:
-model = models.Ticket
-fields = '__all__'
-
-def get_api_url(self, obj):
-return self.context['request'].build_absolute_uri(obj.api_url())
-
-def get_api_events_url(self, obj):
-return self.context['request'].build_absolute_uri(obj.api_events_url())
-
-
-class TicketFieldSerializer(serializers.ModelSerializer):
-api_url = serializers.SerializerMethodField()
-
-class Meta:
-model = models.TicketField
-fields = '__all__'
-
-def get_api_url(self, obj):
-return self.context['request'].build_absolute_uri(obj.api_url())
-
-
-class ChangeEventSerializer(serializers.ModelSerializer):
-api_url = serializers.SerializerMethodField()
-api_ticket_url = serializers.SerializerMethodField()
-
-class Meta:
-model = models.ChangeEvent
-fields = '__all__'
-
-def get_api_url(self, obj):
-return self.context['request'].build_absolute_uri(obj.api_url())
-
-def get_api_ticket_url(self, obj):
-return self.context['request'].build_absolute_uri(obj.api_ticket_url())
+model = Ticket
+fields = (
+'product_ticket_id',
+'summary',
+'description',
+)
+extra_kwargs = {'product_ticket_id': {'required': False}}
+
+def create(self, validated_data):
+if 'prefix' not in self.context['view'].kwargs.keys():
+prefix = self.context['view'].kwargs['product_prefix']
+product = get_object_or_404(Product.objects.all(), prefix=prefix)
+validated_data['product'] = product
+return super().create(validated_data)
diff --git a/trackers/api/urls.py b/trackers/api/urls.py
index c9ccf2f..1ca3741 100644
--- a/trackers/api/urls.py
+++ b/trackers/api/urls.py
@@ -17,22 +17,33 @@
 
 from django.urls import path
 from django.conf.urls import include
-from rest_framework import routers
+from rest_framework_nested import routers
 from . import views
 
 router = routers.DefaultRouter()
 router.register('users', views.UserViewSet)
 router.register('groups', views.GroupViewSet)
 router.register('products', views.ProductViewSet)
-router.register('tickets', views.TicketViewSet)
 
-ticket_router = routers.DefaultRouter()
-ticket_router.register('ticketevents', views.ChangeEventViewSet)
+products_router = routers.NestedDefaultRouter(router, 'products', 
lookup='product')
+products_router.register('tickets', views.TicketViewSet, 
basename='product-tickets')
 
 urlpatterns = [
 path('', include(router.urls)),
-path('

[bloodhound-core] 01/02: Add product model and api tests

2021-05-17 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit dc439b7433ae52367099f2f4c4ab7a7ba47ec4f0
Author: Gary Martin 
AuthorDate: Sat May 15 16:38:53 2021 +0100

Add product model and api tests

 - added product model
 - adds basic api and api tests for product
---
 bh_core/settings.py|   3 +-
 bh_core/urls.py|   1 +
 functional_tests.py|  18 +++-
 trackers/{apps.py => api/__init__.py}  |   6 --
 trackers/{ => api}/serializers.py  |   7 ++
 trackers/{apps.py => api/tests/__init__.py}|   6 --
 trackers/api/tests/test_product_api.py | 112 +
 trackers/{ => api}/urls.py |   7 +-
 trackers/{ => api}/views.py|  13 +--
 trackers/apps.py   |   1 +
 trackers/models.py |  32 ++
 trackers/tests/__init__.py |   0
 .../tests/test_models.py   |  40 
 trackers/{ => tests}/tests.py  |   4 +-
 trackers/urls.py   |  16 +--
 trackers/views.py  |  41 
 16 files changed, 204 insertions(+), 103 deletions(-)

diff --git a/bh_core/settings.py b/bh_core/settings.py
index f0db01a..37ac64b 100644
--- a/bh_core/settings.py
+++ b/bh_core/settings.py
@@ -145,6 +145,5 @@ STATIC_URL = '/static/'
 
 REST_FRAMEWORK = {
 'DEFAULT_PERMISSION_CLASSES': [
-'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
-]
+],
 }
diff --git a/bh_core/urls.py b/bh_core/urls.py
index 408612b..a285126 100644
--- a/bh_core/urls.py
+++ b/bh_core/urls.py
@@ -36,5 +36,6 @@ from django.urls import include, path
 
 urlpatterns = [
 path('', include('trackers.urls')),
+path('api-auth/', include('rest_framework.urls')),
 path('admin/', admin.site.urls),
 ]
diff --git a/functional_tests.py b/functional_tests.py
index df49437..50e22fb 100644
--- a/functional_tests.py
+++ b/functional_tests.py
@@ -21,7 +21,7 @@ from selenium import webdriver
 import unittest
 
 
-class TicketViewTest(unittest.TestCase):
+class HomePageViewTest(unittest.TestCase):
 def setUp(self):
 self.browser = webdriver.Firefox()
 self.browser.implicitly_wait(3)
@@ -29,11 +29,25 @@ class TicketViewTest(unittest.TestCase):
 def tearDown(self):
 self.browser.quit()
 
-def test_user_can_add_view_and_delete_ticket(self):
+def test_user_can_see_homepage(self):
 self.browser.get('http://localhost:8000')
 
 self.assertIn('Bloodhound', self.browser.title)
 
 
+class ApiHomePageViewTest(unittest.TestCase):
+def setUp(self):
+self.browser = webdriver.Firefox()
+self.browser.implicitly_wait(3)
+
+def tearDown(self):
+self.browser.quit()
+
+def test_user_can_see_api_homepage(self):
+self.browser.get('http://localhost:8000/api')
+
+self.assertIn('Api Root', self.browser.title)
+
+
 if __name__ == '__main__':
 unittest.main(warnings='ignore')
diff --git a/trackers/apps.py b/trackers/api/__init__.py
similarity index 89%
copy from trackers/apps.py
copy to trackers/api/__init__.py
index 7b9d013..084b296 100644
--- a/trackers/apps.py
+++ b/trackers/api/__init__.py
@@ -14,9 +14,3 @@
 #  KIND, either express or implied.  See the License for the
 #  specific language governing permissions and limitations
 #  under the License.
-
-from django.apps import AppConfig
-
-
-class TrackersConfig(AppConfig):
-name = 'trackers'
diff --git a/trackers/serializers.py b/trackers/api/serializers.py
similarity index 91%
rename from trackers/serializers.py
rename to trackers/api/serializers.py
index 2616ff1..92db9c6 100644
--- a/trackers/serializers.py
+++ b/trackers/api/serializers.py
@@ -1,6 +1,7 @@
 from django.contrib.auth.models import User, Group
 from rest_framework import serializers
 from trackers import models
+from ..models import Product
 
 
 class UserSerializer(serializers.HyperlinkedModelSerializer):
@@ -15,6 +16,12 @@ class 
GroupSerializer(serializers.HyperlinkedModelSerializer):
 fields = ('url', 'name')
 
 
+class ProductSerializer(serializers.ModelSerializer):
+class Meta:
+model = Product
+fields = '__all__'
+
+
 class TicketSerializer(serializers.ModelSerializer):
 api_url = serializers.SerializerMethodField()
 api_events_url = serializers.SerializerMethodField()
diff --git a/trackers/apps.py b/trackers/api/tests/__init__.py
similarity index 89%
copy from trackers/apps.py
copy to trackers/api/tests/__init__.py
index 7b9d013..084b296 100644
--- a/trackers/apps.py
+++ b/trackers/api/tests/__init__.py
@@ -14,9 +14,3 @@
 #  KIND, either 

[bloodhound-core] branch main updated: Change over to poetry; fix swagger; update README

2021-05-09 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git


The following commit(s) were added to refs/heads/main by this push:
 new a840d8e  Change over to poetry; fix swagger; update README
a840d8e is described below

commit a840d8e1b6ca3d417428f1aeb45a01f83eebb769
Author: Gary Martin 
AuthorDate: Mon May 10 01:24:47 2021 +0100

Change over to poetry; fix swagger; update README

The old swagger was not working so switched to drf_yasg for now.

 * Swapped to poetry from pipenv
 * Old swagger was not working so switched to drf_yasg as a quick fix
   ahead of deciding how to continue
 * Updated README.md to reflect poetry usage and generally improve the
   text
---
 .gitignore  |   5 +
 Pipfile |  16 
 Pipfile.lock| 267 
 README.md   | 166 
 bh_core/settings.py |   2 +-
 pyproject.toml  |  19 
 trackers/urls.py|   4 +-
 trackers/views.py   |  14 ++-
 8 files changed, 146 insertions(+), 347 deletions(-)

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000..e0db8ba
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+__pycache__/
+.venv/
+db.sqlite3
+tags
+*.log
diff --git a/Pipfile b/Pipfile
deleted file mode 100644
index 114750c..000
--- a/Pipfile
+++ /dev/null
@@ -1,16 +0,0 @@
-[[source]]
-url = "https://pypi.python.org/simple;
-verify_ssl = true
-name = "pypi"
-
-[dev-packages]
-selenium = "*"
-pytest-django = "*"
-PyYAML = "*"
-
-[packages]
-django = ">=2.0.0"
-djangorestframework = "*"
-django-rest-swagger = "*"
-
-[requires]
diff --git a/Pipfile.lock b/Pipfile.lock
deleted file mode 100644
index 4929a85..000
--- a/Pipfile.lock
+++ /dev/null
@@ -1,267 +0,0 @@
-{
-"_meta": {
-"hash": {
-"sha256": 
"32e23ea6222c95881c6e0ea71ead44b51d710f950c012a4c125dec779388bf69"
-},
-"pipfile-spec": 6,
-"requires": {},
-"sources": [
-{
-"name": "pypi",
-"url": "https://pypi.python.org/simple;,
-"verify_ssl": true
-}
-]
-},
-"default": {
-"certifi": {
-"hashes": [
-
"sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7",
-
"sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033"
-],
-"version": "==2018.11.29"
-},
-"chardet": {
-"hashes": [
-
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
-
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
-],
-"version": "==3.0.4"
-},
-"coreapi": {
-"hashes": [
-
"sha256:46145fcc1f7017c076a2ef684969b641d18a2991051fddec9458ad3f78ffc1cb",
-
"sha256:bf39d118d6d3e171f10df9ede5666f63ad80bba9a29a8ec17726a66cf52ee6f3"
-],
-"version": "==2.3.3"
-},
-"coreschema": {
-"hashes": [
-
"sha256:5e6ef7bf38c1525d5e55a895934ab4273548629f16aed5c0a6caa74ebf45551f",
-
"sha256:9503506007d482ab0867ba14724b93c18a33b22b6d19fb419ef2d239dd4a1607"
-],
-"version": "==0.0.4"
-},
-"django": {
-"hashes": [
-
"sha256:275bec66fd2588dd517ada59b8bfb23d4a9abc5a362349139ddda3c7ff6f5ade",
-
"sha256:939652e9d34d7d53d74d5d8ef82a19e5f8bb2de75618f7e5360691b6e9667963"
-],
-"index": "pypi",
-"version": "==2.1.7"
-},
-"django-rest-swagger": {
-"hashes": [
-
"sha256:48f6aded9937e90ae7cbe9e6c932b9744b8af80cc4e010088b3278c700e0685b",
-
"sha256:b039b0288bab4665cd45dc5d16f94b13911bc4ad0ed55f74ad3b90aa31c87c17"
-],
-"index": "pypi",
-"version": "==2.2.0"
-},
-"djangorestframework": {
-"hashes": [
-
"sha256:79c6efbb2514bc50cf25906d7c0a5cfead714c7af667ff4bd110312cd380ae66",
-
"sha256:a4138613b67e3a223be6c97f5

[bloodhound-core] 04/14: Add djangorestframework and register admin pages

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit d3dc9d90cd70508e7c6898ae69b572a04aab47ef
Author: Gary Martin 
AuthorDate: Sun Oct 14 00:21:39 2018 +

Add djangorestframework and register admin pages

git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1843801
 13f79535-47bb-0310-9956-ffa450edef68
---
 Pipfile |   1 +
 Pipfile.lock| 107 ++--
 bh_core/urls.py |   2 +-
 trackers/admin.py   |   4 ++
 trackers/models.py  |   2 +
 trackers/serializers.py |   8 
 trackers/views.py   |  10 +
 7 files changed, 85 insertions(+), 49 deletions(-)

diff --git a/Pipfile b/Pipfile
index 33c6799..056c071 100644
--- a/Pipfile
+++ b/Pipfile
@@ -10,6 +10,7 @@ PyYAML = "*"
 
 [packages]
 django = ">=2.0.0"
+djangorestframework = "*"
 
 [requires]
 python_version = "3.6"
diff --git a/Pipfile.lock b/Pipfile.lock
index 1f1f2aa..7d244b5 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"5ba6eeb95fa58896eba1e3528bdea3ae2430c5424239bef1345adc500dc53fcd"
+"sha256": 
"f70363525f7fd7a95075f66854bc135a3c1d45142d1e02ebe126442621614be9"
 },
 "pipfile-spec": 6,
 "requires": {
@@ -18,100 +18,104 @@
 "default": {
 "django": {
 "hashes": [
-
"sha256:3eb25c99df1523446ec2dc1b00e25eb2ecbdf42c9d8b0b8b32a204a8db9011f8",
-
"sha256:69ff89fa3c3a8337015478a1a0744f52a9fef5d12c1efa01a01f99bcce9bf10c"
+
"sha256:acdcc1f61fdb0a0c82a1d3bf1879a414e7732ea894a7632af7f6d66ec7ab5bb3",
+
"sha256:efbcad7ebb47daafbcead109b38a5bd519a3c3cd92c6ed0f691ff97fcdd16b45"
 ],
 "index": "pypi",
-"version": "==2.0.6"
+"version": "==2.1.2"
+},
+"djangorestframework": {
+"hashes": [
+
"sha256:b6714c3e4b0f8d524f193c91ecf5f5450092c2145439ac2769711f7eba89a9d9",
+
"sha256:c375e4f95a3a64fccac412e36fb42ba36881e52313ec021ef410b40f67cddca4"
+],
+"index": "pypi",
+"version": "==3.8.2"
 },
 "pytz": {
 "hashes": [
-
"sha256:65ae0c8101309c45772196b21b74c46b2e5d11b6275c45d251b150d5da334555",
-
"sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
+
"sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053",
+
"sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277"
 ],
-"version": "==2018.4"
+"version": "==2018.5"
 }
 },
 "develop": {
 "atomicwrites": {
 "hashes": [
-
"sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585",
-
"sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6"
+
"sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0",
+
"sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee"
 ],
-"version": "==1.1.5"
+"version": "==1.2.1"
 },
 "attrs": {
 "hashes": [
-
"sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265",
-
"sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"
+
"sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69",
+
"sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb"
 ],
-"version": "==18.1.0"
+"version": "==18.2.0"
 },
 "more-itertools": {
 "hashes": [
-
"sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8",
-
"sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3",
-
"sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0"
+
"sha256

[bloodhound-core] 13/14: Updates to setup advice

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit d5f0a61e2836ce8b1c8aa6b7bce134264ae8c003
Author: Gary Martin 
AuthorDate: Tue Jan 14 02:06:28 2020 +

Updates to setup advice
---
 README.md | 112 --
 1 file changed, 65 insertions(+), 47 deletions(-)

diff --git a/README.md b/README.md
index d3f6549..f0b6e39 100644
--- a/README.md
+++ b/README.md
@@ -1,61 +1,67 @@
 # New Bloodhound
 
-## Requirements
+## Getting the Bloodhound Code:
 
-### Python
+There is a reasonable chance that you are reading these instructions from a
+copy of the source code that you have already placed on the computer that you
+wish to install on. If this is the case you can skip on to the next section.
 
-Bloodhound core is currently written in Python3. It should be possible to
-install and run the core successfully with Python 3.6 or newer. You may
-find that versions from Python 3.4 work but this is not currently tested
-and it is possible that Python features from newer versions may sneak in.
+While in early development, the alternatives for getting the code include
+checking out from [Subversion] with the following command:
 
-If you do not already have an appropriate version of Python installed, you
-may wish to follow instructions for your platform here:
+```
+svn checkout 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental/ 
bloodhound
+```
 
-  https://docs.python-guide.org/starting/installation/
+or cloning with [Git] from the [Apache Bloodhound Github mirror] - the command
+below should also check out the appropriate branch:
 
-### Pipenv
+```
+git clone --branch bh_core_experimental 
https://github.com/apache/bloodhound.git
+```
 
-Pipenv is used for looking after Python package dependencies and virtual
-environment management.
+With the commands as specified, both will place the code in the `bloodhound`
+directory.
 
-If you already have the `pip` program installed already, installation of
-pipenv can be as simple as
+[Subversion]: https://subversion.apache.org/
+[Git]: https://git-scm.com/
+[Apache Bloodhound mirror]: https://github.com/apache/bloodhound
+[Github]: https://github.com/
 
-```
-pip install --user pipenv
-```
+## Installing Python and Pipenv
 
-For more information on installing and usage of pipenv, see
-https://docs.pipenv.org/.
+Bloodhound core is currently written in [Python 3] and uses [Pipenv] for
+looking after the python based dependencies.
 
-Once pipenv is installed, the final bit of setup ahead of installing the
-rest of the project dependencies is to ensure that you have picked out the
-appropriate version of Python for your environment. For the same directory
-as the `Pipfile` for the project, you should run:
+It should be possible to install and run the core successfully with Python 3.6
+or newer. You may find that versions from Python 3.4 work but this is not
+currently tested and it is possible that Python features from newer versions
+may sneak in.
 
-```
-pipenv --python 3
-```
+The guide at <https://docs.python-guide.org/> gives good instructions for
+installing Python on [Linux][Python on Linux], [MacOS][Python on MacOS] and
+[Windows][Python on Windows].
 
-If you have multiple versions of Python 3 installed, you may need to be
-more specific about the version.
+Further information about pipenv is available at <https://docs.pipenv.org/>.
 
-### Pipfile Specified Requirements
+[Python 3]: https://docs.python.org/3/
+[Pipenv]: https://pipenv.readthedocs.io/en/latest/
+[Python on Linux]: 
https://docs.python-guide.org/starting/install3/linux/#install3-linux
+[Python on MacOS]: 
https://docs.python-guide.org/starting/install3/osx/#install3-osx
+[Python on Windows]: 
https://docs.python-guide.org/starting/install3/win/#install3-windows
 
-With pipenv installed and the Python version selected, the rest of the
-Python based requrements can be installed with the following command from
-the same director as the `Pipfile` for the project:
+## Preparing the Python environment
 
-```
-pipenv install
-```
+It should now be possible to use pipenv to install the rest of the project
+dependencies and bloodhound itself. Note that the exactly required command may
+depend on details like whether you have multiple versions of python available
+but for most cases, the following should work. If in doubt, just be more
+specific about the python version that you intend to use.
 
-Additionally, to run tests described later, you should install the
-development dependencies:
+For the same directory as the `Pipfile` for the project run:
 
 ```
-pipenv install --dev
+pipenv --python 3 install
 ```
 
 ## Setup
@@ -104,27 +110,28 @@ These paths are subject to change.
 Unit tests are currently being written with the standard unittest framework.
 This may be replaced with pytest.
 
-T

[bloodhound-core] 06/14: Adds a basic ticket view and update api

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 31f1b1d58d196cf91d04a794a04f31bb83bb58f2
Author: Gary Martin 
AuthorDate: Sun Oct 14 00:23:26 2018 +

Adds a basic ticket view and update api

git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1843803
 13f79535-47bb-0310-9956-ffa450edef68
---
 trackers/serializers.py |  5 +
 trackers/urls.py|  3 ++-
 trackers/views.py   | 10 +++---
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/trackers/serializers.py b/trackers/serializers.py
index 37c14f6..8d0a8d6 100644
--- a/trackers/serializers.py
+++ b/trackers/serializers.py
@@ -6,3 +6,8 @@ class TicketSerializer(serializers.ModelSerializer):
 class Meta:
 model = Ticket
 fields = '__all__'
+
+class ChangeEventSerializer(serializers.ModelSerializer):
+class Meta:
+model = ChangeEvent
+fields = '__all__'
diff --git a/trackers/urls.py b/trackers/urls.py
index 7537b32..3987dd5 100644
--- a/trackers/urls.py
+++ b/trackers/urls.py
@@ -20,5 +20,6 @@ from . import views
 
 urlpatterns = [
 path('', views.home, name='home'),
-path('ticket', views.TicketList.as_view()),
+path('ticket/', views.TicketListCreate.as_view()),
+path('ticket/', views.TicketViewUpdate.as_view()),
 ]
diff --git a/trackers/views.py b/trackers/views.py
index 64d3c34..8aa474e 100644
--- a/trackers/views.py
+++ b/trackers/views.py
@@ -18,15 +18,19 @@
 from django.http import HttpResponse
 from django.shortcuts import render
 from rest_framework import generics
+from trackers.serializers import TicketSerializer
+from trackers.models import Ticket
 
 def home(request):
 return HttpResponse('Bloodhound Trackers')
 
 
-from trackers.serializers import TicketSerializer
-from trackers.models import Ticket
+class TicketListCreate(generics.ListCreateAPIView):
+queryset = Ticket.objects.all()
+serializer_class = TicketSerializer
 
 
-class TicketList(generics.ListCreateAPIView):
+class TicketViewUpdate(generics.RetrieveUpdateAPIView):
 queryset = Ticket.objects.all()
 serializer_class = TicketSerializer
+lookup_field = 'id'



[bloodhound-core] branch main created (now 104011c)

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git.


  at 104011c  Correct path in README.md; add superuser creation

This branch includes the following new commits:

 new 0394b68  add branch for new bh_core experiment
 new 3854c5d  Improving README.md accuracy; adjusting Pipfile
 new 367f219  Extract common model enforcing id & created fields
 new d3dc9d9  Add djangorestframework and register admin pages
 new 73249fa  Complete adding django rest framework example code
 new 31f1b1d  Adds a basic ticket view and update api
 new e810572  Add swagger for api viewing and more api endpoints
 new 5ff4a05  Attempt to add links to api output for ticket list
 new a9d5a3c  Remove strict Python requirement; update README
 new c862c4a  Update to README for some more useful information
 new ae3966a  Remove python version dependency
 new ac3d187  Refactor api
 new d5f0a61  Updates to setup advice
 new 104011c  Correct path in README.md; add superuser creation

The 14 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[bloodhound-core] 03/14: Extract common model enforcing id & created fields

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 367f2190b9ca1e79cb8bdb707b0a473446ce7250
Author: Gary Martin 
AuthorDate: Wed Jun 6 15:19:29 2018 +

Extract common model enforcing id & created fields


git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1833042
 13f79535-47bb-0310-9956-ffa450edef68
---
 trackers/models.py | 27 +++
 1 file changed, 11 insertions(+), 16 deletions(-)

diff --git a/trackers/models.py b/trackers/models.py
index 1887e4e..2a2513c 100644
--- a/trackers/models.py
+++ b/trackers/models.py
@@ -24,14 +24,18 @@ from django.db import models
 
 logger = logging.getLogger(__name__)
 
-
-class Ticket(models.Model):
+class ModelCommon(models.Model):
 id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
 created = models.DateTimeField(auto_now_add=True, editable=False)
 
+class Meta:
+abstract = True
+
+class Ticket(ModelCommon):
+
 def last_update(self):
-last_event = self.changeevent_set.order_by('event_time').last()
-return self.created if last_event is None else last_event.event_time
+last_event = self.changeevent_set.order_by('created').last()
+return self.created if last_event is None else last_event.created
 
 def add_field_event(self, field, newvalue):
 current_lines = self.get_field_value(field).splitlines(keepends=True)
@@ -48,25 +52,16 @@ class Ticket(models.Model):
 except TicketField.DoesNotExist as e:
 return ''
 
-event = 
self.changeevent_set.filter(field=tfield).order_by('event_time').last()
+event = 
self.changeevent_set.filter(field=tfield).order_by('created').last()
 return '' if event is None else event.value()
 
 
-class TicketField(models.Model):
-id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+class TicketField(ModelCommon):
 name = models.CharField(max_length=32)
 
-class Label(TicketField):
-pass
-
-class SharedField(TicketField):
-pass
-
-class ChangeEvent(models.Model):
-id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+class ChangeEvent(ModelCommon):
 ticket = models.ForeignKey(Ticket, models.CASCADE, editable=False, 
null=False)
 field = models.ForeignKey(TicketField, models.CASCADE, editable=False, 
null=False)
-event_time = models.DateTimeField(auto_now_add=True, editable=False)
 diff = models.TextField(editable=False)
 
 def value(self, which=2):



[bloodhound-core] 07/14: Add swagger for api viewing and more api endpoints

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit e810572d83da6650d2cbbe0367a79134d005f385
Author: Gary Martin 
AuthorDate: Sun Oct 14 00:23:29 2018 +

Add swagger for api viewing and more api endpoints

git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1843804
 13f79535-47bb-0310-9956-ffa450edef68
---
 Pipfile |   1 +
 Pipfile.lock| 118 +++-
 bh_core/settings.py |   1 +
 trackers/models.py  |  10 ++--
 trackers/serializers.py |   9 +++-
 trackers/urls.py|   3 ++
 trackers/views.py   |  29 +---
 7 files changed, 159 insertions(+), 12 deletions(-)

diff --git a/Pipfile b/Pipfile
index 056c071..fe4fd91 100644
--- a/Pipfile
+++ b/Pipfile
@@ -11,6 +11,7 @@ PyYAML = "*"
 [packages]
 django = ">=2.0.0"
 djangorestframework = "*"
+django-rest-swagger = "*"
 
 [requires]
 python_version = "3.6"
diff --git a/Pipfile.lock b/Pipfile.lock
index 7d244b5..c681e5e 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"f70363525f7fd7a95075f66854bc135a3c1d45142d1e02ebe126442621614be9"
+"sha256": 
"9d8b5c33b68a3c95ceadb2fa4e343ea79a7739d9711887ae9562f774b830d49d"
 },
 "pipfile-spec": 6,
 "requires": {
@@ -16,6 +16,34 @@
 ]
 },
 "default": {
+"certifi": {
+"hashes": [
+
"sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638",
+
"sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a"
+],
+"version": "==2018.8.24"
+},
+"chardet": {
+"hashes": [
+
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
+
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
+],
+"version": "==3.0.4"
+},
+"coreapi": {
+"hashes": [
+
"sha256:46145fcc1f7017c076a2ef684969b641d18a2991051fddec9458ad3f78ffc1cb",
+
"sha256:bf39d118d6d3e171f10df9ede5666f63ad80bba9a29a8ec17726a66cf52ee6f3"
+],
+"version": "==2.3.3"
+},
+"coreschema": {
+"hashes": [
+
"sha256:5e6ef7bf38c1525d5e55a895934ab4273548629f16aed5c0a6caa74ebf45551f",
+
"sha256:9503506007d482ab0867ba14724b93c18a33b22b6d19fb419ef2d239dd4a1607"
+],
+"version": "==0.0.4"
+},
 "django": {
 "hashes": [
 
"sha256:acdcc1f61fdb0a0c82a1d3bf1879a414e7732ea894a7632af7f6d66ec7ab5bb3",
@@ -24,6 +52,14 @@
 "index": "pypi",
 "version": "==2.1.2"
 },
+"django-rest-swagger": {
+"hashes": [
+
"sha256:48f6aded9937e90ae7cbe9e6c932b9744b8af80cc4e010088b3278c700e0685b",
+
"sha256:b039b0288bab4665cd45dc5d16f94b13911bc4ad0ed55f74ad3b90aa31c87c17"
+],
+"index": "pypi",
+"version": "==2.2.0"
+},
 "djangorestframework": {
 "hashes": [
 
"sha256:b6714c3e4b0f8d524f193c91ecf5f5450092c2145439ac2769711f7eba89a9d9",
@@ -32,12 +68,92 @@
 "index": "pypi",
 "version": "==3.8.2"
 },
+"idna": {
+"hashes": [
+
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
+
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
+],
+"version": "==2.7"
+},
+"itypes": {
+"hashes": [
+
"sha256:c6e77bb9fd68a4bfeb9d958fea421802282451a25bac4913ec94db82a899c073"
+],
+"version": "==1.1.0"
+},
+"jinja2": {
+"hashes": [
+
"sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd",
+
"sha256:f84be1bb0040cac

[bloodhound-core] 02/14: Improving README.md accuracy; adjusting Pipfile

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 3854c5dbf450bcb110fc1a0922b0d2567bf6
Author: Gary Martin 
AuthorDate: Tue Jun 5 21:26:50 2018 +

Improving README.md accuracy; adjusting Pipfile


git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1832975
 13f79535-47bb-0310-9956-ffa450edef68
---
 Pipfile  |  1 -
 Pipfile.lock | 28 
 README.md| 14 ++
 3 files changed, 14 insertions(+), 29 deletions(-)

diff --git a/Pipfile b/Pipfile
index e912a7b..33c6799 100644
--- a/Pipfile
+++ b/Pipfile
@@ -10,7 +10,6 @@ PyYAML = "*"
 
 [packages]
 django = ">=2.0.0"
-pyyaml = "*"
 
 [requires]
 python_version = "3.6"
diff --git a/Pipfile.lock b/Pipfile.lock
index 4836a5b..1f1f2aa 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"4e791c7fd7b1d7f8749e94bcf56e4f78fb6514b5cf0d3174fe26d91f92cb672d"
+"sha256": 
"5ba6eeb95fa58896eba1e3528bdea3ae2430c5424239bef1345adc500dc53fcd"
 },
 "pipfile-spec": 6,
 "requires": {
@@ -30,26 +30,6 @@
 
"sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
 ],
 "version": "==2018.4"
-},
-"pyyaml": {
-"hashes": [
-
"sha256:0c507b7f74b3d2dd4d1322ec8a94794927305ab4cebbe89cc47fe5e81541e6e8",
-
"sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736",
-
"sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f",
-
"sha256:326420cbb492172dec84b0f65c80942de6cedb5233c413dd824483989c000608",
-
"sha256:4474f8ea030b5127225b8894d626bb66c01cda098d47a2b0d3429b6700af9fd8",
-
"sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab",
-
"sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7",
-
"sha256:5f84523c076ad14ff5e6c037fe1c89a7f73a3e04cf0377cb4d017014976433f3",
-
"sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1",
-
"sha256:b4c423ab23291d3945ac61346feeb9a0dc4184999ede5e7c43e1ffb975130ae6",
-
"sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8",
-
"sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4",
-
"sha256:ca233c64c6e40eaa6c66ef97058cdc80e8d0157a443655baa1b2966e812807ca",
-
"sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269"
-],
-"index": "pypi",
-"version": "==3.12"
 }
 },
 "develop": {
@@ -92,10 +72,10 @@
 },
 "pytest": {
 "hashes": [
-
"sha256:39555d023af3200d004d09e51b4dd9fdd828baa863cded3fd6ba2f29f757ae2d",
-
"sha256:c76e93f3145a44812955e8d46cdd302d8a45fbfc7bf22be24fe231f9d8d8853a"
+
"sha256:26838b2bc58620e01675485491504c3aa7ee0faf335c37fcd5f8731ca4319591",
+
"sha256:32c49a69566aa7c333188149ad48b58ac11a426d5352ea3d8f6ce843f88199cb"
 ],
-"version": "==3.6.0"
+"version": "==3.6.1"
 },
 "pytest-django": {
 "hashes": [
diff --git a/README.md b/README.md
index fd17d1d..9c30a36 100644
--- a/README.md
+++ b/README.md
@@ -23,6 +23,13 @@ pipenv install
 If this doesn't work, it should be done from the same directory as the
 `Pipenv` file.
 
+Additionally, to run tests described later, you'll also need to install the
+development dependencies:
+
+```
+pipenv install --dev
+```
+
 Though possibly annoying, the commands in this file will assume the use of
 `pipenv` but not that the pipenv shell has been activated.
 
@@ -61,7 +68,7 @@ pipenv run python manage.py test
 Fixtures for tests when required can be generated with:
 
 ```
-pipenv python manage.py dumpdata bh-core --format=yaml --indent=2 > 
bh-core/fixtures/[fixture-name].yaml
+pipenv run python manage.py dumpdata trackers --format=yaml --indent=2 > 
trackers/fixtures/[fixture-name].yaml
 ```
 
 ## Integration Tests
@@ -79,9 +86,8 @@ tar -x geckodriver -zf 
"$TMP_DIR/geckodriver-$LATEST-$PLATFORM_EXT" -O > "$BIN_L
 chmod +x "$BIN_LOCATION"/geckodriver
 ```
 
-If `$BIN_LOCATION` is on the system path, it should be possible to run the 
integration tests.
-
-So, assuming the use of pipenv:
+If `$BIN_LOCATION` is on the system path, and the development server is
+running, it should be possible to run the integration tests.
 
 ```
 pipenv run python functional_tests.py



[bloodhound-core] 11/14: Remove python version dependency

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit ae3966a937e5b90cbdb5b60998d6590d53d71c43
Author: Gary Martin 
AuthorDate: Tue Feb 19 13:28:43 2019 +

Remove python version dependency

 * at the moment setting a python version is being slightly
   counterproductive as we are really developing for a range
 * additionally updated the Pipfile.lock

git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1853878
 13f79535-47bb-0310-9956-ffa450edef68
---
 Pipfile  |  2 ++
 Pipfile.lock | 50 +-
 2 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/Pipfile b/Pipfile
index 105e3db..114750c 100644
--- a/Pipfile
+++ b/Pipfile
@@ -12,3 +12,5 @@ PyYAML = "*"
 django = ">=2.0.0"
 djangorestframework = "*"
 django-rest-swagger = "*"
+
+[requires]
diff --git a/Pipfile.lock b/Pipfile.lock
index c4f4c8d..4929a85 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -44,11 +44,11 @@
 },
 "django": {
 "hashes": [
-
"sha256:068d51054083d06ceb32ce02b7203f1854256047a0d58682677dd4f81bceabd7",
-
"sha256:55409a056b27e6d1246f19ede41c6c610e4cab549c005b62cbeefabc6433356b"
+
"sha256:275bec66fd2588dd517ada59b8bfb23d4a9abc5a362349139ddda3c7ff6f5ade",
+
"sha256:939652e9d34d7d53d74d5d8ef82a19e5f8bb2de75618f7e5360691b6e9667963"
 ],
 "index": "pypi",
-"version": "==2.1.4"
+"version": "==2.1.7"
 },
 "django-rest-swagger": {
 "hashes": [
@@ -60,11 +60,11 @@
 },
 "djangorestframework": {
 "hashes": [
-
"sha256:607865b0bb1598b153793892101d881466bd5a991de12bd6229abb18b1c86136",
-
"sha256:63f76cbe1e7d12b94c357d7e54401103b2e52aef0f7c1650d6c820ad708776e5"
+
"sha256:79c6efbb2514bc50cf25906d7c0a5cfead714c7af667ff4bd110312cd380ae66",
+
"sha256:a4138613b67e3a223be6c97f53b13d759c5b90d2b433bad670b8ebf95402075f"
 ],
 "index": "pypi",
-"version": "==3.9.0"
+"version": "==3.9.1"
 },
 "idna": {
 "hashes": [
@@ -127,10 +127,10 @@
 },
 "pytz": {
 "hashes": [
-
"sha256:31cb35c89bd7d333cd32c5f278fca91b523b0834369e757f4c5641ea252236ca",
-
"sha256:8e0f8568c118d3077b46be7d654cc8167fa916092e28320cde048e54bfc9f1e6"
+
"sha256:32b0891edff07e28efe91284ed9c31e123d84bea3fd98e1f72be2508f43ef8d9",
+
"sha256:d5f05e487007e29e03409f9398d074e158d920d36eb82eaf66fb1136b0c5374c"
 ],
-"version": "==2018.7"
+"version": "==2018.9"
 },
 "requests": {
 "hashes": [
@@ -175,10 +175,10 @@
 "develop": {
 "atomicwrites": {
 "hashes": [
-
"sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0",
-
"sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee"
+
"sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4",
+
"sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"
 ],
-"version": "==1.2.1"
+"version": "==1.3.0"
 },
 "attrs": {
 "hashes": [
@@ -189,18 +189,18 @@
 },
 "more-itertools": {
 "hashes": [
-
"sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092",
-
"sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e",
-
"sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d"
+
"sha256:0125e8f60e9e031347105eb1682cef932f5e97d7b9a1a28d9bf00c22a5daef40",
+
"sha256:590044e3942351a1bdb1de960b739ff4ce277960f2425ad4509446dbace8d9d1"
 ],
-"version": "==4.3.0"
+"markers": "python_version > '2.7'",
+"version": "==6.0.0"
 },
 "plu

[bloodhound-core] 12/14: Refactor api

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit ac3d18794ac0566a8f28f2fb19bac0843d3c8c29
Author: Gary Martin 
AuthorDate: Tue Feb 19 13:29:30 2019 +

Refactor api

 * move api under its own path
 * add urls to model views to help with api navigation
 * add user and group to api
 * experiment with change events as a subpath of tickets

git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1853879
 13f79535-47bb-0310-9956-ffa450edef68
---
 bh_core/settings.py |  6 ++
 trackers/models.py  | 16 +---
 trackers/serializers.py | 31 +++
 trackers/urls.py| 17 +
 trackers/views.py   | 28 +++-
 5 files changed, 78 insertions(+), 20 deletions(-)

diff --git a/bh_core/settings.py b/bh_core/settings.py
index 1cf7328..67148b7 100644
--- a/bh_core/settings.py
+++ b/bh_core/settings.py
@@ -142,3 +142,9 @@ USE_TZ = True
 # https://docs.djangoproject.com/en/2.0/howto/static-files/
 
 STATIC_URL = '/static/'
+
+REST_FRAMEWORK = {
+'DEFAULT_PERMISSION_CLASSES': [
+'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
+]
+}
diff --git a/trackers/models.py b/trackers/models.py
index 6ddd882..7baab71 100644
--- a/trackers/models.py
+++ b/trackers/models.py
@@ -35,11 +35,12 @@ class ModelCommon(models.Model):
 
 
 class Ticket(ModelCommon):
-title = models.CharField(max_length=200, null=True)
-description = models.TextField(null=True)
 
 def api_url(self):
-return reverse('ticket_view', args=(self.id,))
+return reverse('ticket-detail', args=(self.id,))
+
+def api_events_url(self):
+return reverse('changeevent-list', args=(self.id,))
 
 def last_update(self):
 last_event = self.changeevent_set.order_by('created').last()
@@ -67,6 +68,9 @@ class Ticket(ModelCommon):
 class TicketField(ModelCommon):
 name = models.CharField(max_length=32)
 
+def api_url(self):
+return reverse('ticketfield-detail', args=(self.id,))
+
 
 class ChangeEvent(ModelCommon):
 ticket = models.ForeignKey(Ticket, models.CASCADE, null=False)
@@ -81,3 +85,9 @@ class ChangeEvent(ModelCommon):
 def __str__(self):
 return "Change to: {}; Field: {}; Diff: {}".format(
 self.ticket, self.field, self.diff)
+
+def api_url(self):
+return reverse('changeevent-detail', args=(self.ticket.id, self.id,))
+
+def api_ticket_url(self):
+return reverse('ticket-detail', args=(self.ticket.id,))
diff --git a/trackers/serializers.py b/trackers/serializers.py
index b38dcdb..2616ff1 100644
--- a/trackers/serializers.py
+++ b/trackers/serializers.py
@@ -1,9 +1,23 @@
+from django.contrib.auth.models import User, Group
 from rest_framework import serializers
 from trackers import models
 
 
+class UserSerializer(serializers.HyperlinkedModelSerializer):
+class Meta:
+model = User
+fields = ('url', 'username', 'email', 'is_staff')
+
+
+class GroupSerializer(serializers.HyperlinkedModelSerializer):
+class Meta:
+model = Group
+fields = ('url', 'name')
+
+
 class TicketSerializer(serializers.ModelSerializer):
 api_url = serializers.SerializerMethodField()
+api_events_url = serializers.SerializerMethodField()
 
 class Meta:
 model = models.Ticket
@@ -12,14 +26,31 @@ class TicketSerializer(serializers.ModelSerializer):
 def get_api_url(self, obj):
 return self.context['request'].build_absolute_uri(obj.api_url())
 
+def get_api_events_url(self, obj):
+return self.context['request'].build_absolute_uri(obj.api_events_url())
+
 
 class TicketFieldSerializer(serializers.ModelSerializer):
+api_url = serializers.SerializerMethodField()
+
 class Meta:
 model = models.TicketField
 fields = '__all__'
 
+def get_api_url(self, obj):
+return self.context['request'].build_absolute_uri(obj.api_url())
+
 
 class ChangeEventSerializer(serializers.ModelSerializer):
+api_url = serializers.SerializerMethodField()
+api_ticket_url = serializers.SerializerMethodField()
+
 class Meta:
 model = models.ChangeEvent
 fields = '__all__'
+
+def get_api_url(self, obj):
+return self.context['request'].build_absolute_uri(obj.api_url())
+
+def get_api_ticket_url(self, obj):
+return self.context['request'].build_absolute_uri(obj.api_ticket_url())
diff --git a/trackers/urls.py b/trackers/urls.py
index d211bb4..bebc31c 100644
--- a/trackers/urls.py
+++ b/trackers/urls.py
@@ -16,13 +16,22 @@
 #  under the License.
 
 from django.urls import path
+from django.conf.urls import include
+from rest_framework import routers
 from . import views
 
+router = routers.DefaultRouter()
+router.register('users', views.U

[bloodhound-core] 09/14: Remove strict Python requirement; update README

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit a9d5a3c6db80fae178a50d105fa5a4e7d1aeff7f
Author: Gary Martin 
AuthorDate: Tue Dec 18 01:12:17 2018 +

Remove strict Python requirement; update README


git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1849137
 13f79535-47bb-0310-9956-ffa450edef68
---
 Pipfile  |   3 --
 Pipfile.lock | 126 +--
 README.md|  51 ++--
 3 files changed, 111 insertions(+), 69 deletions(-)

diff --git a/Pipfile b/Pipfile
index fe4fd91..105e3db 100644
--- a/Pipfile
+++ b/Pipfile
@@ -12,6 +12,3 @@ PyYAML = "*"
 django = ">=2.0.0"
 djangorestframework = "*"
 django-rest-swagger = "*"
-
-[requires]
-python_version = "3.6"
diff --git a/Pipfile.lock b/Pipfile.lock
index c681e5e..c4f4c8d 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,12 +1,10 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"9d8b5c33b68a3c95ceadb2fa4e343ea79a7739d9711887ae9562f774b830d49d"
+"sha256": 
"32e23ea6222c95881c6e0ea71ead44b51d710f950c012a4c125dec779388bf69"
 },
 "pipfile-spec": 6,
-"requires": {
-"python_version": "3.6"
-},
+"requires": {},
 "sources": [
 {
 "name": "pypi",
@@ -18,10 +16,10 @@
 "default": {
 "certifi": {
 "hashes": [
-
"sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638",
-
"sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a"
+
"sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7",
+
"sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033"
 ],
-"version": "==2018.8.24"
+"version": "==2018.11.29"
 },
 "chardet": {
 "hashes": [
@@ -46,11 +44,11 @@
 },
 "django": {
 "hashes": [
-
"sha256:acdcc1f61fdb0a0c82a1d3bf1879a414e7732ea894a7632af7f6d66ec7ab5bb3",
-
"sha256:efbcad7ebb47daafbcead109b38a5bd519a3c3cd92c6ed0f691ff97fcdd16b45"
+
"sha256:068d51054083d06ceb32ce02b7203f1854256047a0d58682677dd4f81bceabd7",
+
"sha256:55409a056b27e6d1246f19ede41c6c610e4cab549c005b62cbeefabc6433356b"
 ],
 "index": "pypi",
-"version": "==2.1.2"
+"version": "==2.1.4"
 },
 "django-rest-swagger": {
 "hashes": [
@@ -62,18 +60,18 @@
 },
 "djangorestframework": {
 "hashes": [
-
"sha256:b6714c3e4b0f8d524f193c91ecf5f5450092c2145439ac2769711f7eba89a9d9",
-
"sha256:c375e4f95a3a64fccac412e36fb42ba36881e52313ec021ef410b40f67cddca4"
+
"sha256:607865b0bb1598b153793892101d881466bd5a991de12bd6229abb18b1c86136",
+
"sha256:63f76cbe1e7d12b94c357d7e54401103b2e52aef0f7c1650d6c820ad708776e5"
 ],
 "index": "pypi",
-"version": "==3.8.2"
+"version": "==3.9.0"
 },
 "idna": {
 "hashes": [
-
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
-
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
+
"sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407",
+
"sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"
 ],
-"version": "==2.7"
+"version": "==2.8"
 },
 "itypes": {
 "hashes": [
@@ -90,9 +88,36 @@
 },
 "markupsafe": {
 "hashes": [
-
"sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665"
+
"sha256:048ef924c1623740e70204aa7143ec592504045ae4429b59c30054cb31e3c432",
+
"sha256:130f844e7f5bdd8e9f3f42e7102ef1d49b2e6fdf0d7526df3f87281a532d8c8b",
+   

[bloodhound-core] 05/14: Complete adding django rest framework example code

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 73249fa33262a0a3cf53dd8481e51fe58f43bd2a
Author: Gary Martin 
AuthorDate: Sun Oct 14 00:23:25 2018 +

Complete adding django rest framework example code

git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1843802
 13f79535-47bb-0310-9956-ffa450edef68
---
 bh_core/settings.py | 1 +
 trackers/urls.py| 1 +
 trackers/views.py   | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/bh_core/settings.py b/bh_core/settings.py
index 579b660..7482fd8 100644
--- a/bh_core/settings.py
+++ b/bh_core/settings.py
@@ -59,6 +59,7 @@ INSTALLED_APPS = [
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
+'rest_framework',
 ]
 
 MIDDLEWARE = [
diff --git a/trackers/urls.py b/trackers/urls.py
index a7a1c75..7537b32 100644
--- a/trackers/urls.py
+++ b/trackers/urls.py
@@ -20,4 +20,5 @@ from . import views
 
 urlpatterns = [
 path('', views.home, name='home'),
+path('ticket', views.TicketList.as_view()),
 ]
diff --git a/trackers/views.py b/trackers/views.py
index 3483c9f..64d3c34 100644
--- a/trackers/views.py
+++ b/trackers/views.py
@@ -27,6 +27,6 @@ from trackers.serializers import TicketSerializer
 from trackers.models import Ticket
 
 
-class PlanetList(generics.ListCreateAPIView):
+class TicketList(generics.ListCreateAPIView):
 queryset = Ticket.objects.all()
 serializer_class = TicketSerializer



[bloodhound-core] 14/14: Correct path in README.md; add superuser creation

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit 104011c39fc8165a59faf49709fa51b1a7cded9c
Author: Gary Martin 
AuthorDate: Tue Sep 22 15:40:30 2020 +0100

Correct path in README.md; add superuser creation
---
 README.md | 16 +++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index f0b6e39..ee10622 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,20 @@ Note that currently models are in flux and, for the moment, 
no support should
 be expected for migrations as models change. This will change when basic
 models gain stability.
 
+## Setting up a superuser
+
+For certain operations it will be useful to have accounts and superusers to
+work with. There are a few ways to add a superuser. For interactive use, the
+`createsuperuser` action is usually straightforward enough:
+
+```
+pipenv run python manage.py createsuperuser --email ad...@example.com 
--username admin
+```
+
+Entering the password twice on prompting is currently required. If the options
+for `--username` and `--email` are skipped, the command will request these
+details first.
+
 ## Running the development server:
 
 ```
@@ -100,8 +114,8 @@ Currently there is not much to see at the specified 
location. More work has
 been done on the core API. The following views may be of interest as you
 explore:
 
- * http://127.0.0.1:8000/ticket/
  * http://127.0.0.1:8000/schema_view/
+ * http://127.0.0.1:8000/api/
 
 These paths are subject to change.
 



[bloodhound-core] 10/14: Update to README for some more useful information

2020-09-23 Thread gjm
This is an automated email from the ASF dual-hosted git repository.

gjm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bloodhound-core.git

commit c862c4ae7eb3984044c9f87b9417a23a66132ab2
Author: Gary Martin 
AuthorDate: Tue Dec 18 01:22:19 2018 +

Update to README for some more useful information


git-svn-id: 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental@1849138
 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 16 
 1 file changed, 16 insertions(+)

diff --git a/README.md b/README.md
index b159963..d3f6549 100644
--- a/README.md
+++ b/README.md
@@ -83,6 +83,22 @@ models gain stability.
 pipenv run python manage.py runserver
 ```
 
+Amongst the initial output of that command will be something like:
+
+```
+Starting development server at http://127.0.0.1:8000/
+Quit the server with CONTROL-C.
+```
+
+Currently there is not much to see at the specified location. More work has
+been done on the core API. The following views may be of interest as you
+explore:
+
+ * http://127.0.0.1:8000/ticket/
+ * http://127.0.0.1:8000/schema_view/
+
+These paths are subject to change.
+
 ## Unit Tests
 
 Unit tests are currently being written with the standard unittest framework.



svn commit: r1881933 - /bloodhound/branches/bh_core_experimental/README.md

2020-09-22 Thread gjm
Author: gjm
Date: Tue Sep 22 14:40:30 2020
New Revision: 1881933

URL: http://svn.apache.org/viewvc?rev=1881933=rev
Log:
Correct path in README.md; add superuser creation

Modified:
bloodhound/branches/bh_core_experimental/README.md

Modified: bloodhound/branches/bh_core_experimental/README.md
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/README.md?rev=1881933=1881932=1881933=diff
==
--- bloodhound/branches/bh_core_experimental/README.md (original)
+++ bloodhound/branches/bh_core_experimental/README.md Tue Sep 22 14:40:30 2020
@@ -83,6 +83,20 @@ Note that currently models are in flux a
 be expected for migrations as models change. This will change when basic
 models gain stability.
 
+## Setting up a superuser
+
+For certain operations it will be useful to have accounts and superusers to
+work with. There are a few ways to add a superuser. For interactive use, the
+`createsuperuser` action is usually straightforward enough:
+
+```
+pipenv run python manage.py createsuperuser --email ad...@example.com 
--username admin
+```
+
+Entering the password twice on prompting is currently required. If the options
+for `--username` and `--email` are skipped, the command will request these
+details first.
+
 ## Running the development server:
 
 ```
@@ -100,8 +114,8 @@ Currently there is not much to see at th
 been done on the core API. The following views may be of interest as you
 explore:
 
- * http://127.0.0.1:8000/ticket/
  * http://127.0.0.1:8000/schema_view/
+ * http://127.0.0.1:8000/api/
 
 These paths are subject to change.
 




svn commit: r1872744 - /bloodhound/branches/bh_core_experimental/README.md

2020-01-13 Thread gjm
Author: gjm
Date: Tue Jan 14 02:06:28 2020
New Revision: 1872744

URL: http://svn.apache.org/viewvc?rev=1872744=rev
Log:
Updates to setup advice

Modified:
bloodhound/branches/bh_core_experimental/README.md

Modified: bloodhound/branches/bh_core_experimental/README.md
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/README.md?rev=1872744=1872743=1872744=diff
==
--- bloodhound/branches/bh_core_experimental/README.md (original)
+++ bloodhound/branches/bh_core_experimental/README.md Tue Jan 14 02:06:28 2020
@@ -1,61 +1,67 @@
 # New Bloodhound
 
-## Requirements
+## Getting the Bloodhound Code:
 
-### Python
+There is a reasonable chance that you are reading these instructions from a
+copy of the source code that you have already placed on the computer that you
+wish to install on. If this is the case you can skip on to the next section.
 
-Bloodhound core is currently written in Python3. It should be possible to
-install and run the core successfully with Python 3.6 or newer. You may
-find that versions from Python 3.4 work but this is not currently tested
-and it is possible that Python features from newer versions may sneak in.
+While in early development, the alternatives for getting the code include
+checking out from [Subversion] with the following command:
 
-If you do not already have an appropriate version of Python installed, you
-may wish to follow instructions for your platform here:
+```
+svn checkout 
https://svn.apache.org/repos/asf/bloodhound/branches/bh_core_experimental/ 
bloodhound
+```
 
-  https://docs.python-guide.org/starting/installation/
+or cloning with [Git] from the [Apache Bloodhound Github mirror] - the command
+below should also check out the appropriate branch:
 
-### Pipenv
+```
+git clone --branch bh_core_experimental 
https://github.com/apache/bloodhound.git
+```
 
-Pipenv is used for looking after Python package dependencies and virtual
-environment management.
+With the commands as specified, both will place the code in the `bloodhound`
+directory.
 
-If you already have the `pip` program installed already, installation of
-pipenv can be as simple as
+[Subversion]: https://subversion.apache.org/
+[Git]: https://git-scm.com/
+[Apache Bloodhound mirror]: https://github.com/apache/bloodhound
+[Github]: https://github.com/
 
-```
-pip install --user pipenv
-```
+## Installing Python and Pipenv
 
-For more information on installing and usage of pipenv, see
-https://docs.pipenv.org/.
+Bloodhound core is currently written in [Python 3] and uses [Pipenv] for
+looking after the python based dependencies.
 
-Once pipenv is installed, the final bit of setup ahead of installing the
-rest of the project dependencies is to ensure that you have picked out the
-appropriate version of Python for your environment. For the same directory
-as the `Pipfile` for the project, you should run:
+It should be possible to install and run the core successfully with Python 3.6
+or newer. You may find that versions from Python 3.4 work but this is not
+currently tested and it is possible that Python features from newer versions
+may sneak in.
 
-```
-pipenv --python 3
-```
+The guide at <https://docs.python-guide.org/> gives good instructions for
+installing Python on [Linux][Python on Linux], [MacOS][Python on MacOS] and
+[Windows][Python on Windows].
 
-If you have multiple versions of Python 3 installed, you may need to be
-more specific about the version.
+Further information about pipenv is available at <https://docs.pipenv.org/>.
 
-### Pipfile Specified Requirements
+[Python 3]: https://docs.python.org/3/
+[Pipenv]: https://pipenv.readthedocs.io/en/latest/
+[Python on Linux]: 
https://docs.python-guide.org/starting/install3/linux/#install3-linux
+[Python on MacOS]: 
https://docs.python-guide.org/starting/install3/osx/#install3-osx
+[Python on Windows]: 
https://docs.python-guide.org/starting/install3/win/#install3-windows
 
-With pipenv installed and the Python version selected, the rest of the
-Python based requrements can be installed with the following command from
-the same director as the `Pipfile` for the project:
+## Preparing the Python environment
 
-```
-pipenv install
-```
+It should now be possible to use pipenv to install the rest of the project
+dependencies and bloodhound itself. Note that the exactly required command may
+depend on details like whether you have multiple versions of python available
+but for most cases, the following should work. If in doubt, just be more
+specific about the python version that you intend to use.
 
-Additionally, to run tests described later, you should install the
-development dependencies:
+For the same directory as the `Pipfile` for the project run:
 
 ```
-pipenv install --dev
+pipenv --python 3 install
 ```
 
 ## Setup
@@ -104,27 +110,28 @@ These paths are subject to change.
 Unit tests are currently being written with 

svn commit: r1853879 - in /bloodhound/branches/bh_core_experimental: bh_core/settings.py trackers/models.py trackers/serializers.py trackers/urls.py trackers/views.py

2019-02-19 Thread gjm
Author: gjm
Date: Tue Feb 19 13:29:30 2019
New Revision: 1853879

URL: http://svn.apache.org/viewvc?rev=1853879=rev
Log:
Refactor api

 * move api under its own path
 * add urls to model views to help with api navigation
 * add user and group to api
 * experiment with change events as a subpath of tickets

Modified:
bloodhound/branches/bh_core_experimental/bh_core/settings.py
bloodhound/branches/bh_core_experimental/trackers/models.py
bloodhound/branches/bh_core_experimental/trackers/serializers.py
bloodhound/branches/bh_core_experimental/trackers/urls.py
bloodhound/branches/bh_core_experimental/trackers/views.py

Modified: bloodhound/branches/bh_core_experimental/bh_core/settings.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/bh_core/settings.py?rev=1853879=1853878=1853879=diff
==
--- bloodhound/branches/bh_core_experimental/bh_core/settings.py (original)
+++ bloodhound/branches/bh_core_experimental/bh_core/settings.py Tue Feb 19 
13:29:30 2019
@@ -142,3 +142,9 @@ USE_TZ = True
 # https://docs.djangoproject.com/en/2.0/howto/static-files/
 
 STATIC_URL = '/static/'
+
+REST_FRAMEWORK = {
+'DEFAULT_PERMISSION_CLASSES': [
+'rest_framework.permissions.DjangoModelPermissionsOrAnonReadOnly',
+]
+}

Modified: bloodhound/branches/bh_core_experimental/trackers/models.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/models.py?rev=1853879=1853878=1853879=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/models.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/models.py Tue Feb 19 
13:29:30 2019
@@ -35,11 +35,12 @@ class ModelCommon(models.Model):
 
 
 class Ticket(ModelCommon):
-title = models.CharField(max_length=200, null=True)
-description = models.TextField(null=True)
 
 def api_url(self):
-return reverse('ticket_view', args=(self.id,))
+return reverse('ticket-detail', args=(self.id,))
+
+def api_events_url(self):
+return reverse('changeevent-list', args=(self.id,))
 
 def last_update(self):
 last_event = self.changeevent_set.order_by('created').last()
@@ -67,6 +68,9 @@ class Ticket(ModelCommon):
 class TicketField(ModelCommon):
 name = models.CharField(max_length=32)
 
+def api_url(self):
+return reverse('ticketfield-detail', args=(self.id,))
+
 
 class ChangeEvent(ModelCommon):
 ticket = models.ForeignKey(Ticket, models.CASCADE, null=False)
@@ -81,3 +85,9 @@ class ChangeEvent(ModelCommon):
 def __str__(self):
 return "Change to: {}; Field: {}; Diff: {}".format(
 self.ticket, self.field, self.diff)
+
+def api_url(self):
+return reverse('changeevent-detail', args=(self.ticket.id, self.id,))
+
+def api_ticket_url(self):
+return reverse('ticket-detail', args=(self.ticket.id,))

Modified: bloodhound/branches/bh_core_experimental/trackers/serializers.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/serializers.py?rev=1853879=1853878=1853879=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/serializers.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/serializers.py Tue Feb 19 
13:29:30 2019
@@ -1,9 +1,23 @@
+from django.contrib.auth.models import User, Group
 from rest_framework import serializers
 from trackers import models
 
 
+class UserSerializer(serializers.HyperlinkedModelSerializer):
+class Meta:
+model = User
+fields = ('url', 'username', 'email', 'is_staff')
+
+
+class GroupSerializer(serializers.HyperlinkedModelSerializer):
+class Meta:
+model = Group
+fields = ('url', 'name')
+
+
 class TicketSerializer(serializers.ModelSerializer):
 api_url = serializers.SerializerMethodField()
+api_events_url = serializers.SerializerMethodField()
 
 class Meta:
 model = models.Ticket
@@ -12,14 +26,31 @@ class TicketSerializer(serializers.Model
 def get_api_url(self, obj):
 return self.context['request'].build_absolute_uri(obj.api_url())
 
+def get_api_events_url(self, obj):
+return self.context['request'].build_absolute_uri(obj.api_events_url())
+
 
 class TicketFieldSerializer(serializers.ModelSerializer):
+api_url = serializers.SerializerMethodField()
+
 class Meta:
 model = models.TicketField
 fields = '__all__'
 
+def get_api_url(self, obj):
+return self.context['request'].build_absolute_uri(obj.api_url())
+
 
 class ChangeEventSerializer(serializers.ModelSerializer):
+api_url = serializers.SerializerMethodField()
+api_ticket_url = serializers.SerializerMethodField()
+
 class Meta:
 model = models.ChangeEvent
 

svn commit: r1853878 - in /bloodhound/branches/bh_core_experimental: Pipfile Pipfile.lock

2019-02-19 Thread gjm
Author: gjm
Date: Tue Feb 19 13:28:43 2019
New Revision: 1853878

URL: http://svn.apache.org/viewvc?rev=1853878=rev
Log:
Remove python version dependency

 * at the moment setting a python version is being slightly
   counterproductive as we are really developing for a range
 * additionally updated the Pipfile.lock

Modified:
bloodhound/branches/bh_core_experimental/Pipfile
bloodhound/branches/bh_core_experimental/Pipfile.lock

Modified: bloodhound/branches/bh_core_experimental/Pipfile
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile?rev=1853878=1853877=1853878=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile Tue Feb 19 13:28:43 2019
@@ -12,3 +12,5 @@ PyYAML = "*"
 django = ">=2.0.0"
 djangorestframework = "*"
 django-rest-swagger = "*"
+
+[requires]

Modified: bloodhound/branches/bh_core_experimental/Pipfile.lock
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile.lock?rev=1853878=1853877=1853878=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile.lock (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile.lock Tue Feb 19 13:28:43 
2019
@@ -44,11 +44,11 @@
 },
 "django": {
 "hashes": [
-
"sha256:068d51054083d06ceb32ce02b7203f1854256047a0d58682677dd4f81bceabd7",
-
"sha256:55409a056b27e6d1246f19ede41c6c610e4cab549c005b62cbeefabc6433356b"
+
"sha256:275bec66fd2588dd517ada59b8bfb23d4a9abc5a362349139ddda3c7ff6f5ade",
+
"sha256:939652e9d34d7d53d74d5d8ef82a19e5f8bb2de75618f7e5360691b6e9667963"
 ],
 "index": "pypi",
-"version": "==2.1.4"
+"version": "==2.1.7"
 },
 "django-rest-swagger": {
 "hashes": [
@@ -60,11 +60,11 @@
 },
 "djangorestframework": {
 "hashes": [
-
"sha256:607865b0bb1598b153793892101d881466bd5a991de12bd6229abb18b1c86136",
-
"sha256:63f76cbe1e7d12b94c357d7e54401103b2e52aef0f7c1650d6c820ad708776e5"
+
"sha256:79c6efbb2514bc50cf25906d7c0a5cfead714c7af667ff4bd110312cd380ae66",
+
"sha256:a4138613b67e3a223be6c97f53b13d759c5b90d2b433bad670b8ebf95402075f"
 ],
 "index": "pypi",
-"version": "==3.9.0"
+"version": "==3.9.1"
 },
 "idna": {
 "hashes": [
@@ -127,10 +127,10 @@
 },
 "pytz": {
 "hashes": [
-
"sha256:31cb35c89bd7d333cd32c5f278fca91b523b0834369e757f4c5641ea252236ca",
-
"sha256:8e0f8568c118d3077b46be7d654cc8167fa916092e28320cde048e54bfc9f1e6"
+
"sha256:32b0891edff07e28efe91284ed9c31e123d84bea3fd98e1f72be2508f43ef8d9",
+
"sha256:d5f05e487007e29e03409f9398d074e158d920d36eb82eaf66fb1136b0c5374c"
 ],
-"version": "==2018.7"
+"version": "==2018.9"
 },
 "requests": {
 "hashes": [
@@ -175,10 +175,10 @@
 "develop": {
 "atomicwrites": {
 "hashes": [
-
"sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0",
-
"sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee"
+
"sha256:03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4",
+
"sha256:75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"
 ],
-"version": "==1.2.1"
+"version": "==1.3.0"
 },
 "attrs": {
 "hashes": [
@@ -189,18 +189,18 @@
 },
 "more-itertools": {
 "hashes": [
-
"sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092",
-
"sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e",
-
"sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d"
+
"sha256:0125e8f60e9e031347105eb1682cef932f5e97d7b9a1a28d9bf00c22a5daef40",
+
"sha256:590044e3942351a1bdb1de960b739ff4ce2779

svn commit: r1849138 - /bloodhound/branches/bh_core_experimental/README.md

2018-12-17 Thread gjm
Author: gjm
Date: Tue Dec 18 01:22:19 2018
New Revision: 1849138

URL: http://svn.apache.org/viewvc?rev=1849138=rev
Log:
Update to README for some more useful information

Modified:
bloodhound/branches/bh_core_experimental/README.md

Modified: bloodhound/branches/bh_core_experimental/README.md
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/README.md?rev=1849138=1849137=1849138=diff
==
--- bloodhound/branches/bh_core_experimental/README.md (original)
+++ bloodhound/branches/bh_core_experimental/README.md Tue Dec 18 01:22:19 2018
@@ -83,6 +83,22 @@ models gain stability.
 pipenv run python manage.py runserver
 ```
 
+Amongst the initial output of that command will be something like:
+
+```
+Starting development server at http://127.0.0.1:8000/
+Quit the server with CONTROL-C.
+```
+
+Currently there is not much to see at the specified location. More work has
+been done on the core API. The following views may be of interest as you
+explore:
+
+ * http://127.0.0.1:8000/ticket/
+ * http://127.0.0.1:8000/schema_view/
+
+These paths are subject to change.
+
 ## Unit Tests
 
 Unit tests are currently being written with the standard unittest framework.




svn commit: r1849137 - in /bloodhound/branches/bh_core_experimental: Pipfile Pipfile.lock README.md

2018-12-17 Thread gjm
Author: gjm
Date: Tue Dec 18 01:12:17 2018
New Revision: 1849137

URL: http://svn.apache.org/viewvc?rev=1849137=rev
Log:
Remove strict Python requirement; update README

Modified:
bloodhound/branches/bh_core_experimental/Pipfile
bloodhound/branches/bh_core_experimental/Pipfile.lock
bloodhound/branches/bh_core_experimental/README.md

Modified: bloodhound/branches/bh_core_experimental/Pipfile
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile?rev=1849137=1849136=1849137=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile Tue Dec 18 01:12:17 2018
@@ -12,6 +12,3 @@ PyYAML = "*"
 django = ">=2.0.0"
 djangorestframework = "*"
 django-rest-swagger = "*"
-
-[requires]
-python_version = "3.6"

Modified: bloodhound/branches/bh_core_experimental/Pipfile.lock
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile.lock?rev=1849137=1849136=1849137=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile.lock (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile.lock Tue Dec 18 01:12:17 
2018
@@ -1,12 +1,10 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"9d8b5c33b68a3c95ceadb2fa4e343ea79a7739d9711887ae9562f774b830d49d"
+"sha256": 
"32e23ea6222c95881c6e0ea71ead44b51d710f950c012a4c125dec779388bf69"
 },
 "pipfile-spec": 6,
-"requires": {
-"python_version": "3.6"
-},
+"requires": {},
 "sources": [
 {
 "name": "pypi",
@@ -18,10 +16,10 @@
 "default": {
 "certifi": {
 "hashes": [
-
"sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638",
-
"sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a"
+
"sha256:47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7",
+
"sha256:993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033"
 ],
-"version": "==2018.8.24"
+"version": "==2018.11.29"
 },
 "chardet": {
 "hashes": [
@@ -46,11 +44,11 @@
 },
 "django": {
 "hashes": [
-
"sha256:acdcc1f61fdb0a0c82a1d3bf1879a414e7732ea894a7632af7f6d66ec7ab5bb3",
-
"sha256:efbcad7ebb47daafbcead109b38a5bd519a3c3cd92c6ed0f691ff97fcdd16b45"
+
"sha256:068d51054083d06ceb32ce02b7203f1854256047a0d58682677dd4f81bceabd7",
+
"sha256:55409a056b27e6d1246f19ede41c6c610e4cab549c005b62cbeefabc6433356b"
 ],
 "index": "pypi",
-"version": "==2.1.2"
+"version": "==2.1.4"
 },
 "django-rest-swagger": {
 "hashes": [
@@ -62,18 +60,18 @@
 },
 "djangorestframework": {
 "hashes": [
-
"sha256:b6714c3e4b0f8d524f193c91ecf5f5450092c2145439ac2769711f7eba89a9d9",
-
"sha256:c375e4f95a3a64fccac412e36fb42ba36881e52313ec021ef410b40f67cddca4"
+
"sha256:607865b0bb1598b153793892101d881466bd5a991de12bd6229abb18b1c86136",
+
"sha256:63f76cbe1e7d12b94c357d7e54401103b2e52aef0f7c1650d6c820ad708776e5"
 ],
 "index": "pypi",
-"version": "==3.8.2"
+"version": "==3.9.0"
 },
 "idna": {
 "hashes": [
-
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
-
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
+
"sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407",
+
"sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"
 ],
-"version": "==2.7"
+"version": "==2.8"
 },
 "itypes": {
 "hashes": [
@@ -90,9 +88,36 @@
 },
 "markupsafe": {
 "hashes": [
-
"sha256:a6be69091dac23

svn commit: r1843802 - in /bloodhound/branches/bh_core_experimental: bh_core/settings.py trackers/urls.py trackers/views.py

2018-10-13 Thread gjm
Author: gjm
Date: Sun Oct 14 00:23:25 2018
New Revision: 1843802

URL: http://svn.apache.org/viewvc?rev=1843802=rev
Log:
Complete adding django rest framework example code

Modified:
bloodhound/branches/bh_core_experimental/bh_core/settings.py
bloodhound/branches/bh_core_experimental/trackers/urls.py
bloodhound/branches/bh_core_experimental/trackers/views.py

Modified: bloodhound/branches/bh_core_experimental/bh_core/settings.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/bh_core/settings.py?rev=1843802=1843801=1843802=diff
==
--- bloodhound/branches/bh_core_experimental/bh_core/settings.py (original)
+++ bloodhound/branches/bh_core_experimental/bh_core/settings.py Sun Oct 14 
00:23:25 2018
@@ -59,6 +59,7 @@ INSTALLED_APPS = [
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
+'rest_framework',
 ]
 
 MIDDLEWARE = [

Modified: bloodhound/branches/bh_core_experimental/trackers/urls.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/urls.py?rev=1843802=1843801=1843802=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/urls.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/urls.py Sun Oct 14 
00:23:25 2018
@@ -20,4 +20,5 @@ from . import views
 
 urlpatterns = [
 path('', views.home, name='home'),
+path('ticket', views.TicketList.as_view()),
 ]

Modified: bloodhound/branches/bh_core_experimental/trackers/views.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/views.py?rev=1843802=1843801=1843802=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/views.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/views.py Sun Oct 14 
00:23:25 2018
@@ -27,6 +27,6 @@ from trackers.serializers import TicketS
 from trackers.models import Ticket
 
 
-class PlanetList(generics.ListCreateAPIView):
+class TicketList(generics.ListCreateAPIView):
 queryset = Ticket.objects.all()
 serializer_class = TicketSerializer




svn commit: r1843804 - in /bloodhound/branches/bh_core_experimental: Pipfile Pipfile.lock bh_core/settings.py trackers/models.py trackers/serializers.py trackers/urls.py trackers/views.py

2018-10-13 Thread gjm
Author: gjm
Date: Sun Oct 14 00:23:29 2018
New Revision: 1843804

URL: http://svn.apache.org/viewvc?rev=1843804=rev
Log:
Add swagger for api viewing and more api endpoints

Modified:
bloodhound/branches/bh_core_experimental/Pipfile
bloodhound/branches/bh_core_experimental/Pipfile.lock
bloodhound/branches/bh_core_experimental/bh_core/settings.py
bloodhound/branches/bh_core_experimental/trackers/models.py
bloodhound/branches/bh_core_experimental/trackers/serializers.py
bloodhound/branches/bh_core_experimental/trackers/urls.py
bloodhound/branches/bh_core_experimental/trackers/views.py

Modified: bloodhound/branches/bh_core_experimental/Pipfile
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile?rev=1843804=1843803=1843804=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile Sun Oct 14 00:23:29 2018
@@ -11,6 +11,7 @@ PyYAML = "*"
 [packages]
 django = ">=2.0.0"
 djangorestframework = "*"
+django-rest-swagger = "*"
 
 [requires]
 python_version = "3.6"

Modified: bloodhound/branches/bh_core_experimental/Pipfile.lock
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile.lock?rev=1843804=1843803=1843804=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile.lock (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile.lock Sun Oct 14 00:23:29 
2018
@@ -1,7 +1,7 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"f70363525f7fd7a95075f66854bc135a3c1d45142d1e02ebe126442621614be9"
+"sha256": 
"9d8b5c33b68a3c95ceadb2fa4e343ea79a7739d9711887ae9562f774b830d49d"
 },
 "pipfile-spec": 6,
 "requires": {
@@ -16,6 +16,34 @@
 ]
 },
 "default": {
+"certifi": {
+"hashes": [
+
"sha256:376690d6f16d32f9d1fe8932551d80b23e9d393a8578c5633a2ed39a64861638",
+
"sha256:456048c7e371c089d0a77a5212fb37a2c2dce1e24146e3b7e0261736aaeaa22a"
+],
+"version": "==2018.8.24"
+},
+"chardet": {
+"hashes": [
+
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
+
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
+],
+"version": "==3.0.4"
+},
+"coreapi": {
+"hashes": [
+
"sha256:46145fcc1f7017c076a2ef684969b641d18a2991051fddec9458ad3f78ffc1cb",
+
"sha256:bf39d118d6d3e171f10df9ede5666f63ad80bba9a29a8ec17726a66cf52ee6f3"
+],
+"version": "==2.3.3"
+},
+"coreschema": {
+"hashes": [
+
"sha256:5e6ef7bf38c1525d5e55a895934ab4273548629f16aed5c0a6caa74ebf45551f",
+
"sha256:9503506007d482ab0867ba14724b93c18a33b22b6d19fb419ef2d239dd4a1607"
+],
+"version": "==0.0.4"
+},
 "django": {
 "hashes": [
 
"sha256:acdcc1f61fdb0a0c82a1d3bf1879a414e7732ea894a7632af7f6d66ec7ab5bb3",
@@ -24,6 +52,14 @@
 "index": "pypi",
 "version": "==2.1.2"
 },
+"django-rest-swagger": {
+"hashes": [
+
"sha256:48f6aded9937e90ae7cbe9e6c932b9744b8af80cc4e010088b3278c700e0685b",
+
"sha256:b039b0288bab4665cd45dc5d16f94b13911bc4ad0ed55f74ad3b90aa31c87c17"
+],
+"index": "pypi",
+"version": "==2.2.0"
+},
 "djangorestframework": {
 "hashes": [
 
"sha256:b6714c3e4b0f8d524f193c91ecf5f5450092c2145439ac2769711f7eba89a9d9",
@@ -32,12 +68,92 @@
 "index": "pypi",
 "version": "==3.8.2"
 },
+"idna": {
+"hashes": [
+
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
+
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
+],
+"version": "==2.7"
+},
+"itypes": {
+"hashes": [
+

svn commit: r1843805 - in /bloodhound/branches/bh_core_experimental/trackers: models.py serializers.py urls.py

2018-10-13 Thread gjm
Author: gjm
Date: Sun Oct 14 00:23:31 2018
New Revision: 1843805

URL: http://svn.apache.org/viewvc?rev=1843805=rev
Log:
Attempt to add links to api output for ticket list

Modified:
bloodhound/branches/bh_core_experimental/trackers/models.py
bloodhound/branches/bh_core_experimental/trackers/serializers.py
bloodhound/branches/bh_core_experimental/trackers/urls.py

Modified: bloodhound/branches/bh_core_experimental/trackers/models.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/models.py?rev=1843805=1843804=1843805=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/models.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/models.py Sun Oct 14 
00:23:31 2018
@@ -21,6 +21,7 @@ import logging
 import uuid
 
 from django.db import models
+from django.urls import reverse
 
 logger = logging.getLogger(__name__)
 
@@ -37,6 +38,9 @@ class Ticket(ModelCommon):
 title = models.CharField(max_length=200, null=True)
 description = models.TextField(null=True)
 
+def api_url(self):
+return reverse('ticket_view', args=(self.id,))
+
 def last_update(self):
 last_event = self.changeevent_set.order_by('created').last()
 return self.created if last_event is None else last_event.created

Modified: bloodhound/branches/bh_core_experimental/trackers/serializers.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/serializers.py?rev=1843805=1843804=1843805=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/serializers.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/serializers.py Sun Oct 14 
00:23:31 2018
@@ -1,20 +1,25 @@
 from rest_framework import serializers
-from trackers.models import Ticket, TicketField, ChangeEvent
+from trackers import models
 
 
 class TicketSerializer(serializers.ModelSerializer):
+api_url = serializers.SerializerMethodField()
+
 class Meta:
-model = Ticket
+model = models.Ticket
 fields = '__all__'
 
+def get_api_url(self, obj):
+return self.context['request'].build_absolute_uri(obj.api_url())
+
 
 class TicketFieldSerializer(serializers.ModelSerializer):
 class Meta:
-model = TicketField
+model = models.TicketField
 fields = '__all__'
 
 
 class ChangeEventSerializer(serializers.ModelSerializer):
 class Meta:
-model = ChangeEvent
+model = models.ChangeEvent
 fields = '__all__'

Modified: bloodhound/branches/bh_core_experimental/trackers/urls.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/urls.py?rev=1843805=1843804=1843805=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/urls.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/urls.py Sun Oct 14 
00:23:31 2018
@@ -23,6 +23,6 @@ urlpatterns = [
 path('schema_view/', views.schema_view),
 path('field/', views.TicketFieldListCreate.as_view()),
 path('ticket/', views.TicketListCreate.as_view()),
-path('ticket/', views.TicketViewUpdate.as_view()),
+path('ticket/', views.TicketViewUpdate.as_view(), 
name='ticket_view'),
 path('ticket//event/', views.ChangeEventListCreate.as_view()),
 ]




svn commit: r1843803 - in /bloodhound/branches/bh_core_experimental/trackers: serializers.py urls.py views.py

2018-10-13 Thread gjm
Author: gjm
Date: Sun Oct 14 00:23:26 2018
New Revision: 1843803

URL: http://svn.apache.org/viewvc?rev=1843803=rev
Log:
Adds a basic ticket view and update api

Modified:
bloodhound/branches/bh_core_experimental/trackers/serializers.py
bloodhound/branches/bh_core_experimental/trackers/urls.py
bloodhound/branches/bh_core_experimental/trackers/views.py

Modified: bloodhound/branches/bh_core_experimental/trackers/serializers.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/serializers.py?rev=1843803=1843802=1843803=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/serializers.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/serializers.py Sun Oct 14 
00:23:26 2018
@@ -6,3 +6,8 @@ class TicketSerializer(serializers.Model
 class Meta:
 model = Ticket
 fields = '__all__'
+
+class ChangeEventSerializer(serializers.ModelSerializer):
+class Meta:
+model = ChangeEvent
+fields = '__all__'

Modified: bloodhound/branches/bh_core_experimental/trackers/urls.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/urls.py?rev=1843803=1843802=1843803=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/urls.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/urls.py Sun Oct 14 
00:23:26 2018
@@ -20,5 +20,6 @@ from . import views
 
 urlpatterns = [
 path('', views.home, name='home'),
-path('ticket', views.TicketList.as_view()),
+path('ticket/', views.TicketListCreate.as_view()),
+path('ticket/', views.TicketViewUpdate.as_view()),
 ]

Modified: bloodhound/branches/bh_core_experimental/trackers/views.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/views.py?rev=1843803=1843802=1843803=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/views.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/views.py Sun Oct 14 
00:23:26 2018
@@ -18,15 +18,19 @@
 from django.http import HttpResponse
 from django.shortcuts import render
 from rest_framework import generics
+from trackers.serializers import TicketSerializer
+from trackers.models import Ticket
 
 def home(request):
 return HttpResponse('Bloodhound Trackers')
 
 
-from trackers.serializers import TicketSerializer
-from trackers.models import Ticket
+class TicketListCreate(generics.ListCreateAPIView):
+queryset = Ticket.objects.all()
+serializer_class = TicketSerializer
 
 
-class TicketList(generics.ListCreateAPIView):
+class TicketViewUpdate(generics.RetrieveUpdateAPIView):
 queryset = Ticket.objects.all()
 serializer_class = TicketSerializer
+lookup_field = 'id'




svn commit: r1843801 - in /bloodhound/branches/bh_core_experimental: Pipfile Pipfile.lock bh_core/urls.py trackers/admin.py trackers/models.py trackers/serializers.py trackers/views.py

2018-10-13 Thread gjm
Author: gjm
Date: Sun Oct 14 00:21:39 2018
New Revision: 1843801

URL: http://svn.apache.org/viewvc?rev=1843801=rev
Log:
Add djangorestframework and register admin pages

Added:
bloodhound/branches/bh_core_experimental/trackers/serializers.py
Modified:
bloodhound/branches/bh_core_experimental/Pipfile
bloodhound/branches/bh_core_experimental/Pipfile.lock
bloodhound/branches/bh_core_experimental/bh_core/urls.py
bloodhound/branches/bh_core_experimental/trackers/admin.py
bloodhound/branches/bh_core_experimental/trackers/models.py
bloodhound/branches/bh_core_experimental/trackers/views.py

Modified: bloodhound/branches/bh_core_experimental/Pipfile
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile?rev=1843801=1843800=1843801=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile Sun Oct 14 00:21:39 2018
@@ -10,6 +10,7 @@ PyYAML = "*"
 
 [packages]
 django = ">=2.0.0"
+djangorestframework = "*"
 
 [requires]
 python_version = "3.6"

Modified: bloodhound/branches/bh_core_experimental/Pipfile.lock
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile.lock?rev=1843801=1843800=1843801=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile.lock (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile.lock Sun Oct 14 00:21:39 
2018
@@ -1,7 +1,7 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"5ba6eeb95fa58896eba1e3528bdea3ae2430c5424239bef1345adc500dc53fcd"
+"sha256": 
"f70363525f7fd7a95075f66854bc135a3c1d45142d1e02ebe126442621614be9"
 },
 "pipfile-spec": 6,
 "requires": {
@@ -18,100 +18,104 @@
 "default": {
 "django": {
 "hashes": [
-
"sha256:3eb25c99df1523446ec2dc1b00e25eb2ecbdf42c9d8b0b8b32a204a8db9011f8",
-
"sha256:69ff89fa3c3a8337015478a1a0744f52a9fef5d12c1efa01a01f99bcce9bf10c"
+
"sha256:acdcc1f61fdb0a0c82a1d3bf1879a414e7732ea894a7632af7f6d66ec7ab5bb3",
+
"sha256:efbcad7ebb47daafbcead109b38a5bd519a3c3cd92c6ed0f691ff97fcdd16b45"
 ],
 "index": "pypi",
-"version": "==2.0.6"
+"version": "==2.1.2"
+},
+"djangorestframework": {
+"hashes": [
+
"sha256:b6714c3e4b0f8d524f193c91ecf5f5450092c2145439ac2769711f7eba89a9d9",
+
"sha256:c375e4f95a3a64fccac412e36fb42ba36881e52313ec021ef410b40f67cddca4"
+],
+"index": "pypi",
+"version": "==3.8.2"
 },
 "pytz": {
 "hashes": [
-
"sha256:65ae0c8101309c45772196b21b74c46b2e5d11b6275c45d251b150d5da334555",
-
"sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
+
"sha256:a061aa0a9e06881eb8b3b2b43f05b9439d6583c206d0a6c340ff72a7b6669053",
+
"sha256:ffb9ef1de172603304d9d2819af6f5ece76f2e85ec10692a524dd876e72bf277"
 ],
-"version": "==2018.4"
+"version": "==2018.5"
 }
 },
 "develop": {
 "atomicwrites": {
 "hashes": [
-
"sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585",
-
"sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6"
+
"sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0",
+
"sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee"
 ],
-"version": "==1.1.5"
+"version": "==1.2.1"
 },
 "attrs": {
 "hashes": [
-
"sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265",
-
"sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"
+
"sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69",
+
"sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb"
 ],
-"version": "==18.1.0"
+"version": "==18.2.0"
 },

svn commit: r1833042 - /bloodhound/branches/bh_core_experimental/trackers/models.py

2018-06-06 Thread gjm
Author: gjm
Date: Wed Jun  6 15:19:29 2018
New Revision: 1833042

URL: http://svn.apache.org/viewvc?rev=1833042=rev
Log:
Extract common model enforcing id & created fields

Modified:
bloodhound/branches/bh_core_experimental/trackers/models.py

Modified: bloodhound/branches/bh_core_experimental/trackers/models.py
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/trackers/models.py?rev=1833042=1833041=1833042=diff
==
--- bloodhound/branches/bh_core_experimental/trackers/models.py (original)
+++ bloodhound/branches/bh_core_experimental/trackers/models.py Wed Jun  6 
15:19:29 2018
@@ -24,14 +24,18 @@ from django.db import models
 
 logger = logging.getLogger(__name__)
 
-
-class Ticket(models.Model):
+class ModelCommon(models.Model):
 id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
 created = models.DateTimeField(auto_now_add=True, editable=False)
 
+class Meta:
+abstract = True
+
+class Ticket(ModelCommon):
+
 def last_update(self):
-last_event = self.changeevent_set.order_by('event_time').last()
-return self.created if last_event is None else last_event.event_time
+last_event = self.changeevent_set.order_by('created').last()
+return self.created if last_event is None else last_event.created
 
 def add_field_event(self, field, newvalue):
 current_lines = self.get_field_value(field).splitlines(keepends=True)
@@ -48,25 +52,16 @@ class Ticket(models.Model):
 except TicketField.DoesNotExist as e:
 return ''
 
-event = 
self.changeevent_set.filter(field=tfield).order_by('event_time').last()
+event = 
self.changeevent_set.filter(field=tfield).order_by('created').last()
 return '' if event is None else event.value()
 
 
-class TicketField(models.Model):
-id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+class TicketField(ModelCommon):
 name = models.CharField(max_length=32)
 
-class Label(TicketField):
-pass
-
-class SharedField(TicketField):
-pass
-
-class ChangeEvent(models.Model):
-id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
+class ChangeEvent(ModelCommon):
 ticket = models.ForeignKey(Ticket, models.CASCADE, editable=False, 
null=False)
 field = models.ForeignKey(TicketField, models.CASCADE, editable=False, 
null=False)
-event_time = models.DateTimeField(auto_now_add=True, editable=False)
 diff = models.TextField(editable=False)
 
 def value(self, which=2):




svn commit: r1832975 - in /bloodhound/branches/bh_core_experimental: Pipfile Pipfile.lock README.md

2018-06-05 Thread gjm
Author: gjm
Date: Tue Jun  5 21:26:50 2018
New Revision: 1832975

URL: http://svn.apache.org/viewvc?rev=1832975=rev
Log:
Improving README.md accuracy; adjusting Pipfile

Modified:
bloodhound/branches/bh_core_experimental/Pipfile
bloodhound/branches/bh_core_experimental/Pipfile.lock
bloodhound/branches/bh_core_experimental/README.md

Modified: bloodhound/branches/bh_core_experimental/Pipfile
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile?rev=1832975=1832974=1832975=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile Tue Jun  5 21:26:50 2018
@@ -10,7 +10,6 @@ PyYAML = "*"
 
 [packages]
 django = ">=2.0.0"
-pyyaml = "*"
 
 [requires]
 python_version = "3.6"

Modified: bloodhound/branches/bh_core_experimental/Pipfile.lock
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile.lock?rev=1832975=1832974=1832975=diff
==
--- bloodhound/branches/bh_core_experimental/Pipfile.lock (original)
+++ bloodhound/branches/bh_core_experimental/Pipfile.lock Tue Jun  5 21:26:50 
2018
@@ -1,7 +1,7 @@
 {
 "_meta": {
 "hash": {
-"sha256": 
"4e791c7fd7b1d7f8749e94bcf56e4f78fb6514b5cf0d3174fe26d91f92cb672d"
+"sha256": 
"5ba6eeb95fa58896eba1e3528bdea3ae2430c5424239bef1345adc500dc53fcd"
 },
 "pipfile-spec": 6,
 "requires": {
@@ -30,26 +30,6 @@
 
"sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
 ],
 "version": "==2018.4"
-},
-"pyyaml": {
-"hashes": [
-
"sha256:0c507b7f74b3d2dd4d1322ec8a94794927305ab4cebbe89cc47fe5e81541e6e8",
-
"sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736",
-
"sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f",
-
"sha256:326420cbb492172dec84b0f65c80942de6cedb5233c413dd824483989c000608",
-
"sha256:4474f8ea030b5127225b8894d626bb66c01cda098d47a2b0d3429b6700af9fd8",
-
"sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab",
-
"sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7",
-
"sha256:5f84523c076ad14ff5e6c037fe1c89a7f73a3e04cf0377cb4d017014976433f3",
-
"sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1",
-
"sha256:b4c423ab23291d3945ac61346feeb9a0dc4184999ede5e7c43e1ffb975130ae6",
-
"sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8",
-
"sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4",
-
"sha256:ca233c64c6e40eaa6c66ef97058cdc80e8d0157a443655baa1b2966e812807ca",
-
"sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269"
-],
-"index": "pypi",
-"version": "==3.12"
 }
 },
 "develop": {
@@ -92,10 +72,10 @@
 },
 "pytest": {
 "hashes": [
-
"sha256:39555d023af3200d004d09e51b4dd9fdd828baa863cded3fd6ba2f29f757ae2d",
-
"sha256:c76e93f3145a44812955e8d46cdd302d8a45fbfc7bf22be24fe231f9d8d8853a"
+
"sha256:26838b2bc58620e01675485491504c3aa7ee0faf335c37fcd5f8731ca4319591",
+
"sha256:32c49a69566aa7c333188149ad48b58ac11a426d5352ea3d8f6ce843f88199cb"
 ],
-"version": "==3.6.0"
+"version": "==3.6.1"
 },
 "pytest-django": {
 "hashes": [

Modified: bloodhound/branches/bh_core_experimental/README.md
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/README.md?rev=1832975=1832974=1832975=diff
==
--- bloodhound/branches/bh_core_experimental/README.md (original)
+++ bloodhound/branches/bh_core_experimental/README.md Tue Jun  5 21:26:50 2018
@@ -23,6 +23,13 @@ pipenv install
 If this doesn't work, it should be done from the same directory as the
 `Pipenv` file.
 
+Additionally, to run tests described later, you'll also need to install the
+development dependencies:
+
+```
+pipenv install --dev
+```
+
 Though possibly annoying, 

svn commit: r1832850 - in /bloodhound/branches/bh_core_experimental: ./ bh_core/ trackers/ trackers/fixtures/

2018-06-04 Thread gjm
Author: gjm
Date: Mon Jun  4 13:50:34 2018
New Revision: 1832850

URL: http://svn.apache.org/viewvc?rev=1832850=rev
Log:
add branch for new bh_core experiment

Added:
bloodhound/branches/bh_core_experimental/
bloodhound/branches/bh_core_experimental/Pipfile
bloodhound/branches/bh_core_experimental/Pipfile.lock
bloodhound/branches/bh_core_experimental/README.md
bloodhound/branches/bh_core_experimental/bh_core/
bloodhound/branches/bh_core_experimental/bh_core/__init__.py
bloodhound/branches/bh_core_experimental/bh_core/settings.py
bloodhound/branches/bh_core_experimental/bh_core/urls.py
bloodhound/branches/bh_core_experimental/bh_core/wsgi.py
bloodhound/branches/bh_core_experimental/functional_tests.py
bloodhound/branches/bh_core_experimental/manage.py   (with props)
bloodhound/branches/bh_core_experimental/pytest.ini
bloodhound/branches/bh_core_experimental/trackers/
bloodhound/branches/bh_core_experimental/trackers/__init__.py
bloodhound/branches/bh_core_experimental/trackers/admin.py
bloodhound/branches/bh_core_experimental/trackers/apps.py
bloodhound/branches/bh_core_experimental/trackers/fixtures/
bloodhound/branches/bh_core_experimental/trackers/fixtures/empty.yml
bloodhound/branches/bh_core_experimental/trackers/models.py
bloodhound/branches/bh_core_experimental/trackers/tests.py
bloodhound/branches/bh_core_experimental/trackers/urls.py
bloodhound/branches/bh_core_experimental/trackers/views.py

Added: bloodhound/branches/bh_core_experimental/Pipfile
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile?rev=1832850=auto
==
--- bloodhound/branches/bh_core_experimental/Pipfile (added)
+++ bloodhound/branches/bh_core_experimental/Pipfile Mon Jun  4 13:50:34 2018
@@ -0,0 +1,16 @@
+[[source]]
+url = "https://pypi.python.org/simple;
+verify_ssl = true
+name = "pypi"
+
+[dev-packages]
+selenium = "*"
+pytest-django = "*"
+PyYAML = "*"
+
+[packages]
+django = ">=2.0.0"
+pyyaml = "*"
+
+[requires]
+python_version = "3.6"

Added: bloodhound/branches/bh_core_experimental/Pipfile.lock
URL: 
http://svn.apache.org/viewvc/bloodhound/branches/bh_core_experimental/Pipfile.lock?rev=1832850=auto
==
--- bloodhound/branches/bh_core_experimental/Pipfile.lock (added)
+++ bloodhound/branches/bh_core_experimental/Pipfile.lock Mon Jun  4 13:50:34 
2018
@@ -0,0 +1,144 @@
+{
+"_meta": {
+"hash": {
+"sha256": 
"4e791c7fd7b1d7f8749e94bcf56e4f78fb6514b5cf0d3174fe26d91f92cb672d"
+},
+"pipfile-spec": 6,
+"requires": {
+"python_version": "3.6"
+},
+"sources": [
+{
+"name": "pypi",
+"url": "https://pypi.python.org/simple;,
+"verify_ssl": true
+}
+]
+},
+"default": {
+"django": {
+"hashes": [
+
"sha256:3eb25c99df1523446ec2dc1b00e25eb2ecbdf42c9d8b0b8b32a204a8db9011f8",
+
"sha256:69ff89fa3c3a8337015478a1a0744f52a9fef5d12c1efa01a01f99bcce9bf10c"
+],
+"index": "pypi",
+"version": "==2.0.6"
+},
+"pytz": {
+"hashes": [
+
"sha256:65ae0c8101309c45772196b21b74c46b2e5d11b6275c45d251b150d5da334555",
+
"sha256:c06425302f2cf668f1bba7a0a03f3c1d34d4ebeef2c72003da308b3947c7f749"
+],
+"version": "==2018.4"
+},
+"pyyaml": {
+"hashes": [
+
"sha256:0c507b7f74b3d2dd4d1322ec8a94794927305ab4cebbe89cc47fe5e81541e6e8",
+
"sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736",
+
"sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f",
+
"sha256:326420cbb492172dec84b0f65c80942de6cedb5233c413dd824483989c000608",
+
"sha256:4474f8ea030b5127225b8894d626bb66c01cda098d47a2b0d3429b6700af9fd8",
+
"sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab",
+
"sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7",
+
"sha256:5f84523c076ad14ff5e6c037fe1c89a7f73a3e04cf0377cb4d017014976433f3",
+
"sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf

svn commit: r1802348 - in /bloodhound/trunk: Vagrantfile salt/roots/pillar/settings.sls salt/roots/salt/bloodhound/init.sls salt/roots/salt/postgresql/init.sls salt/roots/salt/webserver/init.sls

2017-07-18 Thread gjm
Author: gjm
Date: Wed Jul 19 01:47:43 2017
New Revision: 1802348

URL: http://svn.apache.org/viewvc?rev=1802348=rev
Log:
towards fixing vagrant development with salt

Modified:
bloodhound/trunk/Vagrantfile
bloodhound/trunk/salt/roots/pillar/settings.sls
bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
bloodhound/trunk/salt/roots/salt/postgresql/init.sls
bloodhound/trunk/salt/roots/salt/webserver/init.sls

Modified: bloodhound/trunk/Vagrantfile
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/Vagrantfile?rev=1802348=1802347=1802348=diff
==
--- bloodhound/trunk/Vagrantfile (original)
+++ bloodhound/trunk/Vagrantfile Wed Jul 19 01:47:43 2017
@@ -21,8 +21,7 @@
 # Vagrant configuration version 2
 # Please don't change it unless you know what you're doing.
 Vagrant.configure(2) do |config|
-  config.vm.box = "precise64"
-  config.vm.box_url = "http://files.vagrantup.com/precise64.box;
+  config.vm.box = "bento/ubuntu-16.04"
 
   # Forwarded port mappings:
   # For apache served bloodhound use http://localhost:8280/

Modified: bloodhound/trunk/salt/roots/pillar/settings.sls
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/pillar/settings.sls?rev=1802348=1802347=1802348=diff
==
--- bloodhound/trunk/salt/roots/pillar/settings.sls (original)
+++ bloodhound/trunk/salt/roots/pillar/settings.sls Wed Jul 19 01:47:43 2017
@@ -26,12 +26,19 @@ enable_webserver: True
 # these settings are not tested thoroughly with many boxes so will probably
 # need correcting
 {% if grains['oscodename'] in ['lucid', 'natty', 'maverick', 'squeeze'] %}
+pg_version: 8.4
 postgresql: postgresql-8.4
-pg_hba_file: /etc/postgresql/8.4/main/pg_hba.conf
+pg_hba_file: /etc/postgresql/8.4/bhcluster/pg_hba.conf
 pg_hba_replace: pg_hba_8.4.conf
+{% elif grains['oscodename'] == 'xenial' %}
+pg_version: 9.5
+postgresql: postgresql-9.5
+pg_hba_file: /etc/postgresql/9.5/bhcluster/pg_hba.conf
+pg_hba_replace: pg_hba_9.1.conf
 {% else %}
+pg_version: 9.1
 postgresql: postgresql-9.1
-pg_hba_file: /etc/postgresql/9.1/main/pg_hba.conf
+pg_hba_file: /etc/postgresql/9.1/bhcluster/pg_hba.conf
 pg_hba_replace: pg_hba_9.1.conf
 {% endif %}
 {% if grains['oscodename'] in ['lucid', 'natty', 'maverick'] %}
@@ -48,7 +55,7 @@ projects:
 dbuser: bloodhound
 dbpassword: bloodhound
 dbhost: localhost
-dbport: 5432
+dbport: 5434
 adminuser: admin
 adminpassword: adminpass
 project: test

Modified: bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/bloodhound/init.sls?rev=1802348=1802347=1802348=diff
==
--- bloodhound/trunk/salt/roots/salt/bloodhound/init.sls (original)
+++ bloodhound/trunk/salt/roots/salt/bloodhound/init.sls Wed Jul 19 01:47:43 
2017
@@ -22,9 +22,9 @@ include:
 
 /home/vagrant/bhenv:
   virtualenv.managed:
-- no_site_packages: True
+- system_site_packages: False
 - user: vagrant
-- requirements: salt://bloodhound/requirements.txt
+- requirements: /vagrant/installer/requirements-dev.txt
 - cwd: /vagrant/installer/
 - require:
   - pkg: python-dev
@@ -36,7 +36,7 @@ project environment requirements:
 - user: vagrant
 - cwd: /vagrant/installer/
 - name: "source /home/vagrant/bhenv/bin/activate
- && pip install -r requirements-dev.txt"
+ && pip install -r pgrequirements.txt"
 - require:
   - virtualenv: /home/vagrant/bhenv
 
@@ -81,17 +81,20 @@ bloodhounduser for {{ project }}:
 - name: {{ data['dbuser'] }}
 - password: {{ data['dbpassword'] }}
 - user: postgres
+- db_port: {{ data['dbport'] }}
 - require:
   - pkg: {{ pillar['postgresql'] }}
   - service: {{ pillar['postgresql_service'] }}
 
+
 bloodhounddb for {{ project }}:
   postgres_database.present:
 - name: {{ data['dbname'] }}
-- encoding: UTF8
+- encoding: 'UTF8'
 - template: template0
 - owner: {{ data['dbuser'] }}
 - user: postgres
+- db_port: {{ data['dbport'] }}
 - require:
   - postgres_user: bloodhounduser for {{ project }}
 {% endif %}

Modified: bloodhound/trunk/salt/roots/salt/postgresql/init.sls
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/salt/postgresql/init.sls?rev=1802348=1802347=1802348=diff
==
--- bloodhound/trunk/salt/roots/salt/postgresql/init.sls (original)
+++ bloodhound/trunk/salt/roots/salt/postgresql/init.sls Wed Jul 19 01:47:43 
2017
@@ -29,6 +29,7 @@ pg_hb.conf:
 - group: postgres
 - mode: 644
 - require:
+  - postgres_cluster: bhcluster
   - pkg: {{ pillar['postgresql'] }}
 
 postgresql:
@@ -40,

svn commit: r1694890 - in /bloodhound/site: download.cgi download.html

2015-08-09 Thread gjm
Author: gjm
Date: Sun Aug  9 13:39:08 2015
New Revision: 1694890

URL: http://svn.apache.org/r1694890
Log:
first attempt at a project specific download page

Added:
bloodhound/site/download.cgi   (with props)
bloodhound/site/download.html

Added: bloodhound/site/download.cgi
URL: 
http://svn.apache.org/viewvc/bloodhound/site/download.cgi?rev=1694890view=auto
==
--- bloodhound/site/download.cgi (added)
+++ bloodhound/site/download.cgi Sun Aug  9 13:39:08 2015
@@ -0,0 +1,4 @@
+#!/bin/sh
+# Just call the standard mirrors.cgi script. It will use download.html
+# as the input template.
+exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $*

Propchange: bloodhound/site/download.cgi
--
svn:executable = *

Added: bloodhound/site/download.html
URL: 
http://svn.apache.org/viewvc/bloodhound/site/download.html?rev=1694890view=auto
==
--- bloodhound/site/download.html (added)
+++ bloodhound/site/download.html Sun Aug  9 13:39:08 2015
@@ -0,0 +1,111 @@
+html
+  head
+   titleDownload Apache Bloodhound Sources/title
+   meta name=viewport content=width=device-width, initial-scale=1.0
+   link rel=stylesheet type=text/css href=css/bootstrap.min.css 
media=screen /
+   link rel=stylesheet type=text/css 
href=css/bootstrap-responsive.min.css media=screen /
+   link rel=stylesheet type=text/css href=css/site.css 
media=screen /
+  /head
+  body
+[define version]0.8[end]
+div id=site-content class=container
+  div class=rowdiv class=container-box span8 offset2
+div align=center
+  h1 style=position: relative;Download Source Code/h1
+/div
+div
+  pApache Bloodhound [version] is the latest release and the
+  recommended version for all users. When downloading the source 
package
+  you strongmust/strong verify the integrity of the downloaded 
files using the
+  signatures which are available from our main directory./p
+/div
+
+div id=mirror
+  h2Mirror/h2
+  p
+[if-any logo]
+a href=[link]img align=right src=[logo] border=0//a
+[end]
+The currently selected mirror is strong[preferred]/strong.  If 
you
+encounter a problem with this mirror, please select another mirror.
+If all mirrors are failing, there are ibackup/i mirrors (at the
+end of the mirrors list) that should be available.
+  /p
+  form action=[location] method=get id=SelectMirror
+Other mirrors: select name=Preferred
+  [if-any http]
+  [for http]option value=[http][http]/option[end]
+  [end]
+  [if-any ftp]
+  [for ftp]option value=[ftp][ftp]/option[end]
+  [end]
+  [if-any backup]
+  [for backup]option value=[backup][backup] 
(backup)/option[end]
+  [end]
+/select
+input type=submit value=Change /
+  /form
+  p
+You may also consult the a 
href=http://www.apache.org/mirrors/;complete list of mirrors/a.
+  /p
+/div
+
+div id=releases
+  h2Releases/h2
+  p
+Apache Bloodhound releases are provided as source code
+distributions in tar.gz archive format. Windows users in
+particular may find they need to download additional software to
+extract the archive.
+  /p
+
+  div align=center
+table class=table table-bordered
+  tr
+thSource Package/th
+thSignature/th
+thChecksum (MD5)/th
+  /tr
+  tr
+tda 
href=[preferred]bloodhound/apache-bloodhound-[version].tar.gzapache-bloodhound-[version].tar.gz/a/td
+td[a 
href=https://www.apache.org/dist/bloodhound/apache-bloodhound-[version].tar.gz.asc;PGP/a]/td
+td[a 
href=https://www.apache.org/dist/bloodhound/apache-bloodhound-[version].tar.gz.md5;MD5/a]/td
+  /tr
+/table
+  /div
+/div
+
+div id=verifying
+  h2Verifying the Integrity of Downloaded Files/h2
+  pIt is essential that you verify the integrity of the downloaded
+  files using the PGP signatures and/or file checksums. Please read
+  a href=http://httpd.apache.org/dev/verification.html;Verifying 
Apache HTTP Server Releases/a for
+  more information on why you should verify our releases./p
+  pThe PGP signatures can be verified using PGP or GPG. First
+  download the a 
href=https://people.apache.org/keys/group/bloodhound.asc;KEYS/a
+  as well as the asc signature file for the particular

svn commit: r1689326 - in /bloodhound/trunk: bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html bloodhound_relations/bhrelations/web_ui.py bloodhound_theme/bhtheme/templates/bh_t

2015-07-06 Thread gjm
Author: gjm
Date: Mon Jul  6 07:26:13 2015
New Revision: 1689326

URL: http://svn.apache.org/r1689326
Log:
#813: Adjusting relations permissions so TICKET_VIEW sufficient to view.

Modified:

bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html

Modified: 
bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html?rev=1689326r1=1689325r2=1689326view=diff
==
--- 
bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
 (original)
+++ 
bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
 Mon Jul  6 07:26:13 2015
@@ -22,7 +22,14 @@
   xmlns:py=http://genshi.edgewall.org/;
   xmlns:xi=http://www.w3.org/2001/XInclude;
   xmlns:i18n=http://genshi.edgewall.org/i18n;
-  i18n:domain=bhdashboard
+  i18n:domain=bhdashboard
+  py:with=can_append = 'TICKET_APPEND' in perm(ticket.resource);
+ can_create = 'TICKET_CREATE' in perm(ticket.resource) and not 
ticket.exists;
+ can_modify = 'TICKET_CHGPROP' in perm(ticket.resource);
+ can_edit = 'TICKET_EDIT_DESCRIPTION' in perm(ticket.resource);
+ has_property_editor = not version and version != 0 and not cnum_edit
+   and (can_append or can_modify or can_edit or 
can_create);
+  
 
   py:choose test=
 py:when test=relations
@@ -64,7 +71,7 @@
 /py:otherwise
   /py:choose
 
-  div class=btn-group
+  div py:if=has_property_editor class=btn-group
 form method=get action=${href.ticket(ticket.id, 'relations')}
   button type=submit class=btn id=manage-relationsi 
class=icon-retweet/i Manage relations/button
 /form

Modified: bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py?rev=1689326r1=1689325r2=1689326view=diff
==
--- bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py Mon Jul  6 
07:26:13 2015
@@ -65,7 +65,8 @@ class RelationManagementModule(Component
 except ValueError:
 raise TracError(_('Invalid ticket id.'))
 
-req.perm.require('TICKET_VIEW')
+# For access to the relation management, TICKET_MODIFY is required.
+req.perm.require('TICKET_MODIFY')
 relsys = RelationsSystem(self.env)
 
 data = {
@@ -74,7 +75,6 @@ class RelationManagementModule(Component
 if req.method == 'POST':
 # for modifying the relations TICKET_MODIFY is required for
 # both the source and the destination tickets
-req.perm.require('TICKET_MODIFY')
 
 if 'remove' in req.args:
 rellist = req.args.get('sel')

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html?rev=1689326r1=1689325r2=1689326view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html 
(original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html Mon Jul  
6 07:26:13 2015
@@ -445,7 +445,7 @@
 /div
   /form
 
-  div py:if=bhrelations and ticket.exists and has_property_editor 
class=relations
+  div py:if=bhrelations and ticket.exists class=relations
 bh:widget urn=TicketRelations
   bh:args
 bh:arg name=tid$ticket.id/bh:arg




svn commit: r1681607 - in /bloodhound/trunk: ./ salt/ salt/roots/ salt/roots/pillar/ salt/roots/salt/ salt/roots/salt/bloodhound/ salt/roots/salt/postgresql/ salt/roots/salt/requirements/ salt/roots/s

2015-05-25 Thread gjm
Author: gjm
Date: Mon May 25 16:24:27 2015
New Revision: 1681607

URL: http://svn.apache.org/r1681607
Log:
adding a vagrant + salt dev setup

Added:
bloodhound/trunk/Vagrantfile
bloodhound/trunk/salt/
bloodhound/trunk/salt/minion
bloodhound/trunk/salt/roots/
bloodhound/trunk/salt/roots/pillar/
bloodhound/trunk/salt/roots/pillar/settings.sls
bloodhound/trunk/salt/roots/pillar/top.sls
bloodhound/trunk/salt/roots/salt/
bloodhound/trunk/salt/roots/salt/bloodhound/
bloodhound/trunk/salt/roots/salt/bloodhound/init.sls
bloodhound/trunk/salt/roots/salt/bloodhound/requirements.txt
bloodhound/trunk/salt/roots/salt/postgresql/
bloodhound/trunk/salt/roots/salt/postgresql/init.sls
bloodhound/trunk/salt/roots/salt/postgresql/pg_hba_8.4.conf
bloodhound/trunk/salt/roots/salt/postgresql/pg_hba_9.1.conf
bloodhound/trunk/salt/roots/salt/requirements/
bloodhound/trunk/salt/roots/salt/requirements/init.sls
bloodhound/trunk/salt/roots/salt/top.sls
bloodhound/trunk/salt/roots/salt/webserver/
bloodhound/trunk/salt/roots/salt/webserver/bloodhound.site
bloodhound/trunk/salt/roots/salt/webserver/init.sls

Added: bloodhound/trunk/Vagrantfile
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/Vagrantfile?rev=1681607view=auto
==
--- bloodhound/trunk/Vagrantfile (added)
+++ bloodhound/trunk/Vagrantfile Mon May 25 16:24:27 2015
@@ -0,0 +1,46 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  License); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+# Vagrant configuration version 2
+# Please don't change it unless you know what you're doing.
+Vagrant.configure(2) do |config|
+  config.vm.box = precise64
+  config.vm.box_url = http://files.vagrantup.com/precise64.box;
+
+  # Forwarded port mappings:
+  # For apache served bloodhound use http://localhost:8280/
+  config.vm.network :forwarded_port, guest: 80, host: 8280
+  # For tracd served bloodhound on port 8000, use http://localhost:8281/
+  config.vm.network :forwarded_port, guest: 8000, host: 8281
+
+  # Sharing the salt folders with the guest VM:
+  config.vm.synced_folder salt/roots/, /srv/
+
+  config.vm.provision :salt do |salt|
+# basic settings
+salt.pillar({
+  use_webserver = true
+})
+
+salt.minion_config = salt/minion
+salt.run_highstate = true
+salt.verbose = true
+  end
+end

Added: bloodhound/trunk/salt/minion
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/salt/minion?rev=1681607view=auto
==
--- bloodhound/trunk/salt/minion (added)
+++ bloodhound/trunk/salt/minion Mon May 25 16:24:27 2015
@@ -0,0 +1,19 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  License); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+master: localhost
+file_client: local

Added: bloodhound/trunk/salt/roots/pillar/settings.sls
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/salt/roots/pillar/settings.sls?rev=1681607view=auto
==
--- bloodhound/trunk/salt/roots/pillar/settings.sls (added)
+++ bloodhound/trunk/salt/roots/pillar/settings.sls Mon May 25 16:24:27 2015
@@ -0,0 +1,66 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file

svn commit: r1611921 - in /bloodhound/trunk/bloodhound_multiproduct/multiproduct: env.py hooks.py

2014-07-19 Thread gjm
Author: gjm
Date: Sat Jul 19 17:07:48 2014
New Revision: 1611921

URL: http://svn.apache.org/r1611921
Log:
clearing the lru_cache close to the beginning of a request to limit impact of 
caching errors in multi process/threaded web serving - towards #613

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py
bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py?rev=1611921r1=1611920r2=1611921view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py Sat Jul 19 
17:07:48 2014
@@ -365,6 +365,8 @@ class ProductEnvironment(Component, Comp
 g_env = env.parent if isinstance(env,
  ProductEnvironment) else env
 return f(self, g_env, *args, **kwargs)
+__call__.clear = f.clear
+
 return __call__
 
 def product_env_keymap(args, kwds, kwd_mark):
@@ -397,6 +399,10 @@ class ProductEnvironment(Component, Comp
 setup_participants = ExtensionPoint(trac.env.IEnvironmentSetupParticipant)
 multi_product_support_components = 
ExtensionPoint(ISupportMultiProductEnvironment)
 
+@classmethod
+def clear_env_cache(cls):
+cls.__metaclass__.__call__.clear()
+
 @property
 def product_setup_participants(self):
 return [

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py?rev=1611921r1=1611920r2=1611921view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py Sat Jul 19 
17:07:48 2014
@@ -37,6 +37,8 @@ PRODUCT_RE = re.compile(r'^/products(?:/
 
 class MultiProductEnvironmentFactory(EnvironmentFactoryBase):
 def open_environment(self, environ, env_path, global_env, use_cache=False):
+# clearing product environment cache - bh:ticket:613
+multiproduct.env.ProductEnvironment.clear_env_cache()
 environ.setdefault('SCRIPT_NAME', '')  # bh:ticket:594
 
 env = pid = product_path = None




svn commit: r1609909 - /bloodhound/trunk/bloodhound_multiproduct/tests/ticket/model.py

2014-07-12 Thread gjm
Author: gjm
Date: Sat Jul 12 12:22:38 2014
New Revision: 1609909

URL: http://svn.apache.org/r1609909
Log:
adding unit test for checking that adding milestones in one thread is reflected 
in other threads - possibly related to #613

Modified:
bloodhound/trunk/bloodhound_multiproduct/tests/ticket/model.py

Modified: bloodhound/trunk/bloodhound_multiproduct/tests/ticket/model.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/ticket/model.py?rev=1609909r1=1609908r2=1609909view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/tests/ticket/model.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/ticket/model.py Sat Jul 12 
12:22:38 2014
@@ -33,6 +33,13 @@ from multiproduct.model import Product
 from multiproduct.env import ProductEnvironment
 from tests.env import MultiproductTestCase
 
+try:
+import threading
+except ImportError:
+threading = None
+from Queue import Queue
+
+
 class ProductTicketTestCase(TicketTestCase, MultiproductTestCase):
 
 def setUp(self):
@@ -146,6 +153,70 @@ class ProductMilestoneTestCase(Milestone
 self.global_env.reset_db()
 self.env = self.global_env = None
 
+@unittest.skipUnless(threading, 'Threading required for test')
+def test_milestone_threads(self):
+ Ensure that in threaded (e.g. mod_wsgi) situations, we get
+an accurate list of milestones from Milestone.list
+
+The basic strategy is:
+thread-1 requests a list of milestones
+thread-2 adds a milestone
+thread-1 requests a new list of milestones
+To pass, thread-1 should have a list of milestones that matches
+those that are in the database.
+
+lock = threading.RLock()
+results = []
+# two events to coordinate the workers and ensure that the threads
+# alternate appropriately
+e1 = threading.Event()
+e2 = threading.Event()
+
+def task(add):
+the thread task - either we are discovering or adding events
+with lock:
+env = ProductEnvironment(self.global_env,
+ self.default_product)
+if add:
+name = 'milestone_from_' + threading.current_thread().name
+milestone = Milestone(env)
+milestone.name = name
+milestone.insert()
+else:
+# collect the names of milestones reported by Milestone and
+# directly from the db - as sets to ease comparison later
+results.append({
+'from_t': set([m.name for m in Milestone.select(env)]),
+'from_db': set(
+[v[0] for v in self.env.db_query(
+SELECT name FROM milestone)])})
+
+def worker1():
+ check milestones in this thread twice either side of ceding
+control to worker2
+
+task(False)
+e1.set()
+e2.wait()
+task(False)
+
+def worker2():
+ adds a milestone when worker1 allows us to then cede control
+back to worker1
+
+e1.wait()
+task(True)
+e2.set()
+
+t1, t2 = [threading.Thread(target=f) for f in (worker1, worker2)]
+t1.start()
+t2.start()
+t1.join()
+t2.join()
+
+r = results[-1]  # note we only care about the final result
+self.assertEqual(r['from_t'], r['from_db'])
+
 def test_update_milestone(self):
 
 self.env.db_transaction(INSERT INTO milestone (name) VALUES ('Test'))




svn commit: r1550449 - in /bloodhound/trunk: bloodhound_multiproduct/multiproduct/ticket/web_ui.py bloodhound_theme/bhtheme/htdocs/js/theme.js

2013-12-12 Thread gjm
Author: gjm
Date: Thu Dec 12 16:37:31 2013
New Revision: 1550449

URL: http://svn.apache.org/r1550449
Log:
adds the ability to pass fields set in the qct form to the newticket page - 
towards #617, patch from antony

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py
bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py?rev=1550449r1=1550448r2=1550449view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py 
(original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py Thu 
Dec 12 16:37:31 2013
@@ -50,13 +50,29 @@ class ProductTicketModule(TicketModule):
 def process_request(self, req):
 Override for TicketModule process_request
 ticketid = req.args.get('id')
-productid = req.args.get('productid','')
+productid = req.args.get('productid', '')
+qct_product = req.args.get('product')  # From QCT form
 if not ticketid:
 # if /newticket is executed in global scope (from QCT), redirect
 # the request to /products/first_product_in_DB/newticket
-if not productid and not isinstance(self.env, ProductEnvironment):
+#
+# If here from More fields link then pass along QCT form fields.
+# If product arg present then redirect to
+# /products/qct_product/newticket .
+
+if not productid and not qct_product and not isinstance(self.env,
+ProductEnvironment):
 products = Product.select(self.env, {'fields': ['prefix']})
-req.redirect(req.href.products(products[0].prefix, 
'newticket'))
+req.redirect(req.href.products(products[0].prefix, 'newticket',
+   req.args))
+elif qct_product:
+# Most likely arrived here via the QCT More fields link.
+# Use qct_product to redirect to the appropriate product
+# scope
+
+req.args.pop('product')  # don't reenter block on redirect.
+req.redirect(req.href.products(qct_product, 'newticket',
+   req.args))
 return self._process_newticket_request(req)
 
 if req.path_info in ('/newticket', '/products'):

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js?rev=1550449r1=1550448r2=1550449view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js Thu Dec 12 
16:37:31 2013
@@ -93,6 +93,17 @@ $( function () {
 content : function () { return qct_info.msg; }
   });
 
+/** 
+ * Pass QCT form fields to full ticket form when More fields is clicked
+ */
+$('#qct-more').click(function(e) {
+e.preventDefault();
+var href = $(this).attr('href');
+var params = $('#qct-form').serialize();
+params = params.replace(/field_/g, ''); // map to newticket querystring
+window.location = href + '?' + params;
+});
+
 $('body').on('click.close', '#qct-alert-close', 
 function (e) { qct_alert_close() });
 




svn commit: r1548821 - in /bloodhound/trunk: bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html bloodhound_theme/bhtheme/htdocs/bloodhound.css

2013-12-07 Thread gjm
Author: gjm
Date: Sat Dec  7 09:11:36 2013
New Revision: 1548821

URL: http://svn.apache.org/r1548821
Log:
relations overlap fix for #631 - patch from Antony Semonella

Modified:

bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css

Modified: 
bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html?rev=1548821r1=1548820r2=1548821view=diff
==
--- 
bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
 (original)
+++ 
bloodhound/trunk/bloodhound_dashboard/bhdashboard/widgets/templates/widget_relations.html
 Sat Dec  7 09:11:36 2013
@@ -25,6 +25,11 @@
   py:choose test=
 py:when test=relations
   table class=table table-condensed table-bordered
+colgroup
+col span=3 class=width-standard/
+col class=width-wide /
+col span=2 class=width-standard /
+/colgroup
 thead
   tr
 
thType/ththProduct/ththTicket/ththComment/ththAuthor/thth 
class=hidden-phoneChanged/th

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css?rev=1548821r1=1548820r2=1548821view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css Sat Dec  7 
09:11:36 2013
@@ -1358,3 +1358,17 @@ input[type=radio]:not(:checked) + labe
  border-top: 1px solid #dd;
 }
 
+/* @group Related tickets */
+
+.relations table {
+ table-layout: fixed;
+ word-wrap: break-word;
+}
+
+.relations table .width-standard {
+ width: 17%;
+}
+.relations table .width-wide {
+ width: 32%;
+}
+/* @end */




svn commit: r1541127 - in /bloodhound/trunk/bloodhound_theme/bhtheme: htdocs/js/theme.js templates/bloodhound_theme.html

2013-11-12 Thread gjm
Author: gjm
Date: Tue Nov 12 16:12:44 2013
New Revision: 1541127

URL: http://svn.apache.org/r1541127
Log:
qct changes to forget selections after timeout - towards #618

Modified:
bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js?rev=1541127r1=1541126r2=1541127view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/js/theme.js Tue Nov 12 
16:12:44 2013
@@ -50,6 +50,16 @@ $( function () {
 });
 */
 
+function checkSelections () {
+  return $.inArray('', $('#qct-box 
select[data-optional=false]').map(function() {
+return $(this).val();
+  })) == -1;
+}
+$('#qct-create').attr(disabled, !checkSelections());
+$('#qct-box select').change(function () {
+$('#qct-create').attr(disabled, !checkSelections());
+});
+
 $('#qct-inline-newticket').click(function() {
   $('#qct-inline-notice-success, #qct-inline-notice-error').hide();
 
@@ -100,9 +110,24 @@ $( function () {
 }
 
 // Clear input controls inside quick create box
+var timeout;
+$('#qct-newticket').click(function () {
+  if (timeout) {
+clearTimeout(timeout);
+  }
+});
 function qct_clearui() {
-  $('#qct-form input[name!=__FORM_TOKEN], #qct-form select, #qct-form 
textarea').val('');
-  $('#qct-inline-form input[name!=__FORM_TOKEN], #qct-inline-form 
select, #qct-inline-form textarea').val('');
+  $('#qct-form input[name!=__FORM_TOKEN], #qct-form textarea').val('');
+  $('#qct-inline-form input[name!=__FORM_TOKEN], #qct-inline-form 
textarea').val('');
+  $('#qct-create').attr(disabled, !checkSelections());
+  if (timeout) {
+clearTimeout(timeout);
+  }
+  timeout = setTimeout(function () {
+$('#qct-form select').val('');
+$('#qct-inline-form select').val('');
+$('#qct-create').attr(disabled, !checkSelections());
+  }, 12);
 }
 
 // We want to submit via #qct-create

Modified: 
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1541127r1=1541126r2=1541127view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html 
(original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html 
Tue Nov 12 16:12:44 2013
@@ -115,11 +115,10 @@
   !--! create ticket button + dropdown --
   py:def function=field_select(field)
 select id=field-${field.name} name=field_${field.name}
-class=input-block-level data-empty=true 
data-field=${field.name}
-  option py:if=field.optional/option
+class=input-block-level data-empty=true 
data-field=${field.name} data-optional=${'true' if field.optional else 
'false'}
+  option selected=selected value=${'' if field.optional 
else 'Choose...'}/option
   option py:for=idx,option in enumerate(field.options)
   py:with=description = field.options_desc[idx] if 
field.options_desc else option
-  selected=${field.value == option or None}
   value = $option
   py:content=description/option
   optgroup py:for=optgroup in field.optgroups




svn commit: r1529237 - in /bloodhound/trunk/bloodhound_theme/bhtheme: htdocs/bloodhound.css htdocs/img/change_history_arrow_line.png templates/bh_ticket.html templates/bh_ticket_change.html

2013-10-04 Thread gjm
Author: gjm
Date: Fri Oct  4 17:46:05 2013
New Revision: 1529237

URL: http://svn.apache.org/r1529237
Log:
updating the ticket timeline arrow of time and event grouping - towards #687

Removed:

bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/img/change_history_arrow_line.png
Modified:
bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket_change.html

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css?rev=1529237r1=1529236r2=1529237view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/htdocs/bloodhound.css Fri Oct  4 
17:46:05 2013
@@ -187,12 +187,6 @@ div.reports form {
  font-weight: normal;
 }
 
-.activityfeed {
-  background-image: url(img/change_history_arrow_line.png);
-  background-repeat: repeat-y;
-  background-position: 20px 0px;
-}
-
 .timeline .activityfeed {
   background-image: none;
 }
@@ -627,6 +621,14 @@ input[type=submit].btn.btn-micro {
  display: none !important;
 }
 
+.shade-desktop {
+ opacity: 0.2;
+}
+
+.visible-desktop-hover:hover .shade-desktop {
+ opacity: 1;
+}
+
 .hidden-desktop {
  display: none !important;
 }
@@ -1243,7 +1245,7 @@ table.wiki th {
 
 
 #changelog div.comment-box{
- border: 1px solid #ccc;
+ border: 2px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05) inset;
  padding: 13px;
@@ -1252,6 +1254,10 @@ table.wiki th {
  min-height: 20px;
 }
 
+#changelog div.change:hover div.comment-box{
+ border-color: #FFCC33;
+}
+
 #trac-add-comment fieldset{
  width: 100%;
 }
@@ -1267,13 +1273,70 @@ textarea#comment, #trac-add-comment fiel
  content: attr(placeholder-content);
 }
 
+.uparrow div.change,
+.downarrow div.change {
+  margin-bottom: 3px;
+  padding: 1px 0;
+  position: relative;
+  z-index: 1;
+}
+
+.uparrow div.change:before,
+.uparrow div.change:after,
+.downarrow div.change:before,
+.downarrow div.change:after{
+  background: none repeat scroll 0 0 #CC;
+  content: ;
+  height: 100%;
+  position: absolute;
+  top: 0;
+  width: 0.5em;
+  z-index: -1;
+}
+
+.uparrow div.change:hover:before,
+.uparrow div.change:hover:after,
+.downarrow div.change:hover:before,
+.downarrow div.change:hover:after {
+  background: none repeat scroll 0 0 #FFCC33;
+}
+
+.uparrow div.change:before,
+.downarrow div.change:before {
+  left: 20px;
+}
+
+.uparrow div.change:after,
+.downarrow div.change:after{
+  left: 15px;
+  right: 100%;
+}
+
+.uparrow div.change:before, 
+.downarrow div.change:after {
+  transform: skew(0deg, 26deg);
+  -ms-transform: skew(0deg, 26deg);
+  -webkit-transform: skew(0deg, 26deg);
+}
+
+.uparrow div.change:after, 
+.downarrow div.change:before {
+  transform: skew(0deg, -26deg);
+  -ms-transform: skew(0deg, -26deg);
+  -webkit-transform: skew(0deg, -26deg);
+}
+
 #changelog div.comment-box h4 {
   margin-top: 0px;
 }
 
 #changelog ul.changes {
-  list-style-image: url('../common/collapsed.png');
-  padding: 0px 0px 0px 11px;
+  list-style-type: none;
+  margin: 0 0 0 11px;
+}
+
+#changelog ul.changesli {
+  padding: 0 20px;
 }
 
 .ticket form#prefs input[type=radio]{

Modified: bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html?rev=1529237r1=1529236r2=1529237view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html 
(original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_ticket.html Fri Oct  
4 17:46:05 2013
@@ -288,6 +288,23 @@
   var comment = 
$(#trac-comment-editor).next(div.comment).html(reply);
   comment.toggle(comment.children().length != 0);
 }, #changelog .trac-loading);
+
+// quick hack to set arrow direction on change
+arrow_dir = {
+  'oldest': function() {
+$('div#changelog').addClass('downarrow');
+$('div#changelog').removeClass('uparrow');
+  },
+  'newest': function() {
+$('div#changelog').addClass('uparrow');
+$('div#changelog').removeClass('downarrow');
+  },
+};
+
+$('#trac-comments-newest').change(arrow_dir['newest']);
+$('#trac-comments-oldest').change(arrow_dir['oldest']);
+arrow_dir[comments_prefs.comments_order]();
+
 /*]]*/
 py:if test=preview_mode
 $(#attachments).toggleClass(collapsed);
@@ -648,7 +665,7 @@
   /div
 /div
 
-div class=$cols_activity
+div
   !--! Preview of ticket changes --
   div

svn commit: r1527743 - /bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py

2013-09-30 Thread gjm
Author: gjm
Date: Mon Sep 30 19:38:07 2013
New Revision: 1527743

URL: http://svn.apache.org/r1527743
Log:
adding a decorator to allow ProductEnvironment creation using a 
ProductEnvironment in place of it's parent - towards #676

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py?rev=1527743r1=1527742r2=1527743view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/env.py Mon Sep 30 
19:38:07 2013
@@ -362,6 +362,15 @@ class ProductEnvironment(Component, Comp
 
 class __metaclass__(ComponentMeta):
 
+def select_global_env(f):
+Replaces env with env.parent where appropriate
+# Keep the signature of __call__ method
+def __call__(self, env, *args, **kwargs):
+g_env = env.parent if isinstance(env,
+ ProductEnvironment) else env
+return f(self, g_env, *args, **kwargs)
+return __call__
+
 def product_env_keymap(args, kwds, kwd_mark):
 # Remove meta-reference to self (i.e. product env class)
 args = args[1:]
@@ -377,14 +386,15 @@ class ProductEnvironment(Component, Comp
 kwds['product'] = product.prefix
 return default_keymap(args, kwds, kwd_mark)
 
+@select_global_env
 @lru_cache(maxsize=100, keymap=product_env_keymap)
 def __call__(self, *args, **kwargs):
-Return an existing instance of there is a hit 
+Return an existing instance if there is a hit
 in the global LRU cache, otherwise create a new instance.
 
 return ComponentMeta.__call__(self, *args, **kwargs)
 
-del product_env_keymap
+del product_env_keymap, select_global_env
 
 implements(trac.env.ISystemInfoProvider, IPermissionRequestor)
 




svn commit: r1502032 - /bloodhound/trunk/bloodhound_relations/bhrelations/tests/base.py

2013-07-10 Thread gjm
Author: gjm
Date: Wed Jul 10 22:34:15 2013
New Revision: 1502032

URL: http://svn.apache.org/r1502032
Log:
fixing missing license header

Modified:
bloodhound/trunk/bloodhound_relations/bhrelations/tests/base.py

Modified: bloodhound/trunk/bloodhound_relations/bhrelations/tests/base.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_relations/bhrelations/tests/base.py?rev=1502032r1=1502031r2=1502032view=diff
==
--- bloodhound/trunk/bloodhound_relations/bhrelations/tests/base.py (original)
+++ bloodhound/trunk/bloodhound_relations/bhrelations/tests/base.py Wed Jul 10 
22:34:15 2013
@@ -1,3 +1,20 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  License); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
 from _sqlite3 import OperationalError
 from tests.env import MultiproductTestCase
 from multiproduct.env import ProductEnvironment




svn commit: r1497828 - /bloodhound/branches/bep_0007_embeddable_objects/

2013-06-28 Thread gjm
Author: gjm
Date: Fri Jun 28 16:16:06 2013
New Revision: 1497828

URL: http://svn.apache.org/r1497828
Log:
creating branch for GSoC embeddable objects project for ahorincar

Added:
bloodhound/branches/bep_0007_embeddable_objects/   (props changed)
  - copied from r1497827, bloodhound/trunk/

Propchange: bloodhound/branches/bep_0007_embeddable_objects/
--
--- svn:ignore (added)
+++ svn:ignore Fri Jun 28 16:16:06 2013
@@ -0,0 +1,7 @@
+*.DS_Store
+.idea
+.project
+.pydevproject
+.git
+.gitignore
+.hg

Propchange: bloodhound/branches/bep_0007_embeddable_objects/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Jun 28 16:16:06 2013
@@ -0,0 +1,2 @@
+/bloodhound/branches/bep_0003_multiproduct:1461360-1463488
+/incubator/bloodhound/branches/bep_0003_multiproduct:1420073-1461359




svn commit: r1497836 - /bloodhound/branches/bep_0008_time_series_reports/

2013-06-28 Thread gjm
Author: gjm
Date: Fri Jun 28 16:38:30 2013
New Revision: 1497836

URL: http://svn.apache.org/r1497836
Log:
creating branch for GSoC time series reports project for huaxiang

Added:
bloodhound/branches/bep_0008_time_series_reports/   (props changed)
  - copied from r1497835, bloodhound/trunk/

Propchange: bloodhound/branches/bep_0008_time_series_reports/
--
--- svn:ignore (added)
+++ svn:ignore Fri Jun 28 16:38:30 2013
@@ -0,0 +1,7 @@
+*.DS_Store
+.idea
+.project
+.pydevproject
+.git
+.gitignore
+.hg

Propchange: bloodhound/branches/bep_0008_time_series_reports/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Jun 28 16:38:30 2013
@@ -0,0 +1,2 @@
+/bloodhound/branches/bep_0003_multiproduct:1461360-1463488
+/incubator/bloodhound/branches/bep_0003_multiproduct:1420073-1461359




svn commit: r1497837 - /bloodhound/branches/bep_0009_customizable_time_series_report/

2013-06-28 Thread gjm
Author: gjm
Date: Fri Jun 28 16:39:39 2013
New Revision: 1497837

URL: http://svn.apache.org/r1497837
Log:
creating branch for GSoC customizable time series report project for pranayb

Added:
bloodhound/branches/bep_0009_customizable_time_series_report/   (props 
changed)
  - copied from r1497836, bloodhound/trunk/

Propchange: bloodhound/branches/bep_0009_customizable_time_series_report/
--
--- svn:ignore (added)
+++ svn:ignore Fri Jun 28 16:39:39 2013
@@ -0,0 +1,7 @@
+*.DS_Store
+.idea
+.project
+.pydevproject
+.git
+.gitignore
+.hg

Propchange: bloodhound/branches/bep_0009_customizable_time_series_report/
--
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Jun 28 16:39:39 2013
@@ -0,0 +1,2 @@
+/bloodhound/branches/bep_0003_multiproduct:1461360-1463488
+/incubator/bloodhound/branches/bep_0003_multiproduct:1420073-1461359




svn commit: r1489434 - /bloodhound/trunk/bloodhound_multiproduct/tests/web_ui.py

2013-06-04 Thread gjm
Author: gjm
Date: Tue Jun  4 13:15:40 2013
New Revision: 1489434

URL: http://svn.apache.org/r1489434
Log:
fix failing product test by providing hopefully correct product url

Modified:
bloodhound/trunk/bloodhound_multiproduct/tests/web_ui.py

Modified: bloodhound/trunk/bloodhound_multiproduct/tests/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/tests/web_ui.py?rev=1489434r1=1489433r2=1489434view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/tests/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/tests/web_ui.py Tue Jun  4 
13:15:40 2013
@@ -312,8 +312,7 @@ class ProductModuleTestCase(RequestHandl
 else:
 self.assertEquals('New description', product.description)
 
-req_base_url = Href(req._reconstruct_url())
-product_url = req_base_url.products(self.default_product)
+product_url = Href(req.base_path).products(self.default_product)
 self.assertRedirect(req, product_url)
 
 def test_product_delete(self):




svn commit: r1487879 - /bloodhound/site/doap.rdf

2013-05-30 Thread gjm
Author: gjm
Date: Thu May 30 14:56:58 2013
New Revision: 1487879

URL: http://svn.apache.org/r1487879
Log:
adding a starting point for a doap.rdf file for the project

Added:
bloodhound/site/doap.rdf   (with props)

Added: bloodhound/site/doap.rdf
URL: http://svn.apache.org/viewvc/bloodhound/site/doap.rdf?rev=1487879view=auto
==
Binary file - no diff available.

Propchange: bloodhound/site/doap.rdf
--
svn:eol-style = native

Propchange: bloodhound/site/doap.rdf
--
svn:mime-type = application/xml




svn commit: r1486103 - /bloodhound/trunk/bloodhound_relations/bhrelations/templates/relation_notify_email.txt

2013-05-24 Thread gjm
Author: gjm
Date: Fri May 24 16:11:59 2013
New Revision: 1486103

URL: http://svn.apache.org/r1486103
Log:
adding license header comment to relation notification email

Modified:

bloodhound/trunk/bloodhound_relations/bhrelations/templates/relation_notify_email.txt

Modified: 
bloodhound/trunk/bloodhound_relations/bhrelations/templates/relation_notify_email.txt
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_relations/bhrelations/templates/relation_notify_email.txt?rev=1486103r1=1486102r2=1486103view=diff
==
--- 
bloodhound/trunk/bloodhound_relations/bhrelations/templates/relation_notify_email.txt
 (original)
+++ 
bloodhound/trunk/bloodhound_relations/bhrelations/templates/relation_notify_email.txt
 Fri May 24 16:11:59 2013
@@ -1,3 +1,22 @@
+{#
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  License); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+#}\
+
 {% choose created %}\
 {% when True %}\${_('Relation %(type)s %(source)s - %(destination)s 
created.', type=relation.type, source=relation.source, 
destination=relation.destination)}{% end %}\
 {% otherwise %}${_('Relation %(type)s %(source)s - %(destination)s 
deleted.', type=relation.type, source=relation.source, 
destination=relation.destination)}{% end %}\




svn commit: r1482428 - in /bloodhound/trunk/bloodhound_search/bhsearch/tests: __init__.py base.py search_resources/base.py web_ui.py whoosh_backend.py

2013-05-14 Thread gjm
Author: gjm
Date: Tue May 14 16:27:18 2013
New Revision: 1482428

URL: http://svn.apache.org/r1482428
Log:
swapping comparison of python version to one that should work - #525

Modified:
bloodhound/trunk/bloodhound_search/bhsearch/tests/__init__.py
bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py
bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/base.py
bloodhound/trunk/bloodhound_search/bhsearch/tests/web_ui.py
bloodhound/trunk/bloodhound_search/bhsearch/tests/whoosh_backend.py

Modified: bloodhound/trunk/bloodhound_search/bhsearch/tests/__init__.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_search/bhsearch/tests/__init__.py?rev=1482428r1=1482427r2=1482428view=diff
==
--- bloodhound/trunk/bloodhound_search/bhsearch/tests/__init__.py (original)
+++ bloodhound/trunk/bloodhound_search/bhsearch/tests/__init__.py Tue May 14 
16:27:18 2013
@@ -18,7 +18,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 import sys
-if sys.version  (2, 7):
+if sys.version_info[:2]  (2, 7):
 import unittest2 as unittest
 else:
 import unittest
@@ -48,3 +48,5 @@ def suite():
 
 if __name__ == '__main__':
 unittest.main(defaultTest='suite')
+else:
+test_suite = suite()

Modified: bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py?rev=1482428r1=1482427r2=1482428view=diff
==
--- bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py (original)
+++ bloodhound/trunk/bloodhound_search/bhsearch/tests/base.py Tue May 14 
16:27:18 2013
@@ -25,7 +25,7 @@ import contextlib
 import shutil
 import sys
 import tempfile
-if sys.version  (2, 7):
+if sys.version_info[:2]  (2, 7):
 import unittest2 as unittest
 else:
 import unittest

Modified: 
bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/base.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/base.py?rev=1482428r1=1482427r2=1482428view=diff
==
--- bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/base.py 
(original)
+++ bloodhound/trunk/bloodhound_search/bhsearch/tests/search_resources/base.py 
Tue May 14 16:27:18 2013
@@ -19,7 +19,7 @@
 #  under the License.
 
 import sys
-if sys.version  (2, 7):
+if sys.version_info[:2]  (2, 7):
 import unittest2 as unittest
 else:
 import unittest

Modified: bloodhound/trunk/bloodhound_search/bhsearch/tests/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_search/bhsearch/tests/web_ui.py?rev=1482428r1=1482427r2=1482428view=diff
==
--- bloodhound/trunk/bloodhound_search/bhsearch/tests/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_search/bhsearch/tests/web_ui.py Tue May 14 
16:27:18 2013
@@ -18,7 +18,7 @@
 #  specific language governing permissions and limitations
 #  under the License.
 import sys
-if sys.version  (2, 7):
+if sys.version_info[:2]  (2, 7):
 import unittest2 as unittest
 else:
 import unittest

Modified: bloodhound/trunk/bloodhound_search/bhsearch/tests/whoosh_backend.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_search/bhsearch/tests/whoosh_backend.py?rev=1482428r1=1482427r2=1482428view=diff
==
--- bloodhound/trunk/bloodhound_search/bhsearch/tests/whoosh_backend.py 
(original)
+++ bloodhound/trunk/bloodhound_search/bhsearch/tests/whoosh_backend.py Tue May 
14 16:27:18 2013
@@ -22,7 +22,7 @@ import os
 import shutil
 import sys
 import tempfile
-if sys.version  (2, 7):
+if sys.version_info[:2]  (2, 7):
 import unittest2 as unittest
 else:
 import unittest




svn commit: r1481007 - /bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py

2013-05-10 Thread gjm
Author: gjm
Date: Fri May 10 13:26:01 2013
New Revision: 1481007

URL: http://svn.apache.org/r1481007
Log:
get_htdoc_dirs requires a prefix to be specified in the returned list - fixes 
#519

Modified:
bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py

Modified: bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py?rev=1481007r1=1481006r2=1481007view=diff
==
--- bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_relations/bhrelations/web_ui.py Fri May 10 
13:26:01 2013
@@ -64,7 +64,7 @@ class RelationManagementModule(Component
 # ITemplateProvider methods
 def get_htdocs_dirs(self):
 resource_filename = pkg_resources.resource_filename
-return [resource_filename('bhrelations', 'htdocs'), ]
+return [('relations', resource_filename('bhrelations', 'htdocs')), ]
 
 def get_templates_dirs(self):
 resource_filename = pkg_resources.resource_filename




svn commit: r1478803 - /bloodhound/trunk/bloodhound_dashboard/bhdashboard/admin.py

2013-05-03 Thread gjm
Author: gjm
Date: Fri May  3 14:16:48 2013
New Revision: 1478803

URL: http://svn.apache.org/r1478803
Log:
fixing quoting on devfixture admin commands - #511

Modified:
bloodhound/trunk/bloodhound_dashboard/bhdashboard/admin.py

Modified: bloodhound/trunk/bloodhound_dashboard/bhdashboard/admin.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_dashboard/bhdashboard/admin.py?rev=1478803r1=1478802r2=1478803view=diff
==
--- bloodhound/trunk/bloodhound_dashboard/bhdashboard/admin.py (original)
+++ bloodhound/trunk/bloodhound_dashboard/bhdashboard/admin.py Fri May  3 
14:16:48 2013
@@ -37,14 +37,15 @@ from trac.wiki.model import WikiPage
 from bhdashboard import wiki
 
 try:
-from multiproduct.model import Product, ProductResourceMap
+from multiproduct.model import Product, ProductResourceMap, ProductSetting
 except ImportError:
 Product = None
 ProductResourceMap = None
 
 schema = tracschema[:]
 if Product is not None:
-schema.extend([Product._get_schema(), ProductResourceMap._get_schema()])
+schema.extend([Product._get_schema(), ProductResourceMap._get_schema(),
+   ProductSetting._get_schema()])
 
 structure = dict([(table.name, [col.name for col in table.columns])
   for table in schema])
@@ -134,7 +135,8 @@ class BloodhoundAdmin(Component):
 
 def _get_tdump(self, db, table, fields):
 Dumps all the data from a table for a known set of fields
-return db(SELECT %s from %s %(', '.join(fields), table))
+return db(SELECT %s from %s %(','.join([db.quote(f) for f in 
fields]),
+db.quote(table)))
 
 def _dump_as_fixture(self, *args):
 Dumps database to a json fixture
@@ -167,7 +169,7 @@ class BloodhoundAdmin(Component):
 Extract fixture data from a file like object, expecting json
 # Only delete if we think it unlikely that there is data to lose
 with self.env.db_query as db:
-if db('SELECT * FROM ticket'):
+if db('SELECT * FROM ' + db.quote('ticket')):
 printout(_(This command is only intended to run on fresh 
environments as it will overwrite the database.\n
If it is safe to lose bloodhound data, delete the 
@@ -177,10 +179,13 @@ class BloodhoundAdmin(Component):
 data = json.load(fp)
 with self.env.db_transaction as db:
 for tab, cols, vals in data:
-db(DELETE FROM %s %(tab))
+db(DELETE FROM  + db.quote(tab))
 for tab, cols, vals in data:
 printout(Populating %s table % tab)
-db.executemany(INSERT INTO %s (%s) VALUES (%s) % (tab,
-','.join(cols), ','.join(['%s' for c in cols])), vals)
+db.executemany(INSERT INTO %s (%s) VALUES (%s) % (
+db.quote(tab),
+','.join([db.quote(c) for c in cols]),
+','.join(['%s']*len(cols))),
+   vals)
 printout(%d records added % len(vals))
 




svn commit: r1477773 - /bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py

2013-04-30 Thread gjm
Author: gjm
Date: Tue Apr 30 18:45:35 2013
New Revision: 143

URL: http://svn.apache.org/r143
Log:
storing super on the ProductizedHref as a workaround for TypeError on 
attempting to call a super() method - #512

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py?rev=143r1=142r2=143view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py Tue Apr 30 
18:45:35 2013
@@ -84,7 +84,8 @@ class ProductizedHref(Href):
'img/',
]
 def __init__(self, global_href, base):
-super(ProductizedHref, self).__init__(base)
+self.super = super(ProductizedHref, self)
+self.super.__init__(base)
 self._global_href = global_href
 
 def __call__(self, *args, **kwargs):
@@ -93,7 +94,7 @@ class ProductizedHref(Href):
(len(args) == 1 and args[0] == 'admin') or \
filter(lambda x: args[0].startswith(x), self.STATIC_PREFIXES):
 return self._global_href(*args, **kwargs)
-return super(ProductizedHref, self).__call__(*args, **kwargs)
+return self.super.__call__(*args, **kwargs)
 
 class ProductRequestWithSession(RequestWithSession):
 def __init__(self, env, environ, start_response):




svn commit: r1470517 - /bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html

2013-04-22 Thread gjm
Author: gjm
Date: Mon Apr 22 14:00:51 2013
New Revision: 1470517

URL: http://svn.apache.org/r1470517
Log:
moves register link from the mainnav (Apps dropdown) to metanav - #321

Modified:
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html

Modified: 
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1470517r1=1470516r2=1470517view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html 
(original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html 
Mon Apr 22 14:00:51 2013
@@ -71,6 +71,7 @@
   /py:when
   py:otherwise
 a href=${req.href.login()}${_(Login)}/a
+py:if test='register' in meta_itemsor 
${meta_items.register.label}/py:if
   /py:otherwise
 /span
 span py:if='logout' in meta_items id=nav_logout
@@ -215,7 +216,7 @@
   class=nav nav-tabs pull-right
   id=mainnav
   py:with=mainnav_show = ('wiki', 'tickets', 'browser');
-   metanav_hide = ('login', 'logout', 'prefs', 'help', 
'about')
+   metanav_hide = ('login', 'logout', 'prefs', 'help', 
'about', 'register')
 !--! TODO: Parameterize visible mainnav items in trac.ini --
 li py:if=chrome.nav.mainnav
 py:for=idx, item in enumerate(i for i in 
chrome.nav.mainnav if i.name in mainnav_show) 




svn commit: r1470535 - /bloodhound/trunk/bloodhound_search/bhsearch/web_ui.py

2013-04-22 Thread gjm
Author: gjm
Date: Mon Apr 22 14:20:04 2013
New Revision: 1470535

URL: http://svn.apache.org/r1470535
Log:
removing bhsearch from Apps (now More) menu as this is understood to be 
available as the main search - #321

Modified:
bloodhound/trunk/bloodhound_search/bhsearch/web_ui.py

Modified: bloodhound/trunk/bloodhound_search/bhsearch/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_search/bhsearch/web_ui.py?rev=1470535r1=1470534r2=1470535view=diff
==
--- bloodhound/trunk/bloodhound_search/bhsearch/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_search/bhsearch/web_ui.py Mon Apr 22 14:20:04 
2013
@@ -236,7 +236,7 @@ class RequestParameters(object):
 
 class BloodhoundSearchModule(Component):
 Main search page
-implements(INavigationContributor, IPermissionRequestor, IRequestHandler,
+implements(IPermissionRequestor, IRequestHandler,
 ITemplateProvider, IRequestFilter
 #   IWikiSyntaxProvider #todo: implement later
 )
@@ -302,17 +302,6 @@ class BloodhoundSearchModule(Component):
 doc=Display query suggestions.
 )
 
-# INavigationContributor methods
-def get_active_navigation_item(self, req):
-# pylint: disable=unused-argument
-return 'bhsearch'
-
-def get_navigation_items(self, req):
-if SEARCH_PERMISSION in req.perm:
-yield ('mainnav', 'bhsearch',
-   tag.a(_('Bloodhound Search'), href=self.env.href.bhsearch())
-)
-
 # IPermissionRequestor methods
 def get_permission_actions(self):
 return [SEARCH_PERMISSION]




svn commit: r1470540 - /bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py

2013-04-22 Thread gjm
Author: gjm
Date: Mon Apr 22 14:27:45 2013
New Revision: 1470540

URL: http://svn.apache.org/r1470540
Log:
removing products link from Apps (More) dropdown as products are available 
through the dashboard links - #321

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py?rev=1470540r1=1470539r2=1470540view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py 
(original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/web_ui.py Mon 
Apr 22 14:27:45 2013
@@ -72,10 +72,7 @@ class ProductTicketModule(TicketModule):
 
 def get_navigation_items(self, req):
 Overriding TicketModules New Ticket nav item
-if 'TICKET_CREATE' in req.perm:
-href = ProductModule.get_product_path(self.env, req, 'newticket')
-yield ('mainnav', 'newticket', 
-   tag.a(_(New Ticket), href=href, accesskey=7))
+return
 
 # ISearchSource methods
 #def get_search_filters(self, req):




svn commit: r1470547 - /bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py

2013-04-22 Thread gjm
Author: gjm
Date: Mon Apr 22 14:32:42 2013
New Revision: 1470547

URL: http://svn.apache.org/r1470547
Log:
removing product link from main navigation (r1470540 was really for the new 
ticket link) - #321

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py?rev=1470547r1=1470546r2=1470547view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/web_ui.py Mon Apr 22 
14:32:42 2013
@@ -39,15 +39,7 @@ from multiproduct.hooks import PRODUCT_R
 class ProductModule(Component):
 Base Product behaviour
 
-implements(IRequestHandler, INavigationContributor)
-
-def get_active_navigation_item(self, req):
-return 'products'
-
-def get_navigation_items(self, req):
-if 'PRODUCT_VIEW' in req.perm:
-yield ('mainnav', 'products',
-   tag.a(_('Products'), href=req.href.products(), accesskey=3))
+implements(IRequestHandler)
 
 # IRequestHandler methods
 def match_request(self, req):




svn commit: r1470612 - /bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html

2013-04-22 Thread gjm
Author: gjm
Date: Mon Apr 22 16:38:18 2013
New Revision: 1470612

URL: http://svn.apache.org/r1470612
Log:
move admin link from 'More' menu to the metanav - #321

Modified:
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html

Modified: 
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html?rev=1470612r1=1470611r2=1470612view=diff
==
--- bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html 
(original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/templates/bloodhound_theme.html 
Mon Apr 22 16:38:18 2013
@@ -62,7 +62,8 @@
 /p
   /div
   !--! top menu (login, logout...) --
-  py:with vars=meta_items = dict([i.name, i] for i in 
chrome.nav.metanav)
+  py:with vars=meta_items = dict([i.name, i] for i in 
chrome.nav.metanav);
+ main_items = dict([i.name, i] for i in 
chrome.nav.mainnav);
 div id=usermenu class=span8
   div class=metanav pull-right
 span id=nav_login py:choose=
@@ -78,6 +79,9 @@
 span py:if='logout' in meta_items id=nav_logout
   ${meta_items.logout.label}
 /span
+span py:if='admin' in main_items
+  ${main_items.admin.label}
+/span
 span py:if='help' in meta_items
   ${meta_items.help.label}
 /span
@@ -214,6 +218,7 @@
   class=nav nav-tabs pull-right
   id=mainnav
   py:with=mainnav_show = ('wiki', 'tickets', 'browser');
+   mainnav_to_meta = ('admin',);
metanav_hide = ('login', 'logout', 'prefs', 'help', 
'about', 'register')
 !--! TODO: Parameterize visible mainnav items in trac.ini --
 li py:if=chrome.nav.mainnav
@@ -221,7 +226,7 @@
 class=${classes(first_last(idx, chrome.nav.mainnav), 
active=item.active)}${item.label}/li
 li class=dropdown ${all(not i.active for i in 
chrome.nav.mainnav if i.name in mainnav_show) and 'active' or None}
 py:if=len([i for i in chrome.nav.metanav if i.name not in 
metanav_hide] +
-   [i for i in chrome.nav.mainnav if i.name not in 
mainnav_show])
+   [i for i in chrome.nav.mainnav if i.name not in 
mainnav_show + mainnav_to_meta])
   a class=dropdown-toggle data-toggle=dropdown 
href=#Moreb class=caret/b/a
   ul class=dropdown-menu
 li py:if=chrome.nav.mainnav




svn commit: r1465051 - /bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py

2013-04-05 Thread gjm
Author: gjm
Date: Fri Apr  5 17:22:18 2013
New Revision: 1465051

URL: http://svn.apache.org/r1465051
Log:
fix a missing alias for subquery appearing in dashboard widgets - towards #498

Modified:
bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py
URL: 
http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py?rev=1465051r1=1465050r2=1465051view=diff
==
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py 
(original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/ticket/query.py Fri 
Apr  5 17:22:18 2013
@@ -86,7 +86,7 @@ class ProductQuery(Query):
 self.num_items = 0
 sql, args = self.get_sql(req, cached_ids, authname, tzinfo, locale)
 if sql.startswith('SELECT ') and not sql.startswith('SELECT 
DISTINCT '):
-sql = 'SELECT DISTINCT * FROM (' + sql + ')'
+sql = 'SELECT DISTINCT * FROM (' + sql + ') AS subquery'
 self.num_items = self._count(sql, args)
 
 if self.num_items = self.max:




svn commit: r1691 - /release/incubator/bloodhound/

2013-03-31 Thread gjm
Author: gjm
Date: Sun Mar 31 10:40:54 2013
New Revision: 1691

Log:
removing old bloodhound release artefacts from incubator bloodhound release 
directory

Removed:
release/incubator/bloodhound/apache-bloodhound-incubating-0.1.0-RC1.tar.gz

release/incubator/bloodhound/apache-bloodhound-incubating-0.1.0-RC1.tar.gz.asc

release/incubator/bloodhound/apache-bloodhound-incubating-0.1.0-RC1.tar.gz.md5
release/incubator/bloodhound/apache-bloodhound-incubating-0.2.tar.gz
release/incubator/bloodhound/apache-bloodhound-incubating-0.2.tar.gz.asc
release/incubator/bloodhound/apache-bloodhound-incubating-0.2.tar.gz.md5
release/incubator/bloodhound/apache-bloodhound-incubating-0.3.tar.gz
release/incubator/bloodhound/apache-bloodhound-incubating-0.3.tar.gz.asc
release/incubator/bloodhound/apache-bloodhound-incubating-0.3.tar.gz.md5
release/incubator/bloodhound/apache-bloodhound-incubating-0.4.tar.gz
release/incubator/bloodhound/apache-bloodhound-incubating-0.4.tar.gz.asc
release/incubator/bloodhound/apache-bloodhound-incubating-0.4.tar.gz.md5
release/incubator/bloodhound/apache-bloodhound-incubating-0.5.2.tar.gz
release/incubator/bloodhound/apache-bloodhound-incubating-0.5.2.tar.gz.asc
release/incubator/bloodhound/apache-bloodhound-incubating-0.5.2.tar.gz.md5