Skip to content

Commit

Permalink
Merge branch 'release/v1.2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Feb 3, 2014
2 parents 986b523 + 347a1a1 commit 0a7c0e9
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/detective/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def formfield_for_choice_field(self, db_field, request, **kwargs):
# Get the current topic with the ID set into the parent form
topic = Topic.objects.get(id=request.topic_id)
# Get the topic's models
models = utils.get_topic_models(topic)
models = topic.get_models()
for model in models:
model_name = getattr(model._meta, "verbose_name").title()
subset = []
Expand Down
2 changes: 1 addition & 1 deletion app/detective/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def clean(self):
def field(self):
field = None
if self.name:
topic_models = utils.get_topic_models(self.topic)
topic_models = self.topic.get_models()
for model in topic_models:
# Retreive every relationship field for this model
for f in utils.get_model_fields(model):
Expand Down
4 changes: 2 additions & 2 deletions app/detective/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def default_rules(topic):
# ModelRules is a singleton that record every model rules
rules = ModelRules()
# We cant import this early to avoid bi-directional dependancies
from app.detective.utils import get_topic_models, import_class
from app.detective.utils import import_class
# Get all registered models
models = get_topic_models(topic)
models = Topic.objects.get(module=topic).get_models()
# Set "is_searchable" to true on every model with a name
for model in models:
# If the current model has a name
Expand Down
12 changes: 6 additions & 6 deletions app/detective/templates/home.dj.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

{% compress js %}
<script type="text/javascript" src="{% static 'components/jquery/jquery.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/chroma-js/chroma.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/kartograph.js/kartograph-0.8.2.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/chroma-js/index.js' %}"></script>
<script type="text/javascript" src="{% static 'components/kartograph.js/index.js' %}"></script>
<script type="text/javascript" src="{% static 'components/raphael/raphael-min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/jquery.scrollTo/jquery.scrollTo.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/js-md5/js/md5.min.js' %}"></script>
Expand All @@ -24,10 +24,10 @@
<script type="text/javascript" src="{% static 'components/d3/d3.js' %}"></script>
{% endcompress %}

<script type="text/javascript" src="{% static 'components/unstable-angular-complete/angular.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/unstable-angular-complete/angular-cookies.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/unstable-angular-complete/angular-resource.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/unstable-angular-complete/angular-sanitize.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/angular-all-unstable/angular.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/angular-all-unstable/angular-cookies.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/angular-all-unstable/angular-resource.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/angular-all-unstable/angular-sanitize.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/angular-elastic/elastic.js' %}"></script>
<script type="text/javascript" src="{% static 'components/angular-ui-bootstrap-bower/ui-bootstrap-tpls.min.js' %}"></script>
<script type="text/javascript" src="{% static 'components/ng-file-upload/angular-file-upload.min.js' %}"></script>
Expand Down
1 change: 0 additions & 1 deletion app/detective/tests/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,5 +764,4 @@ def test_topic_has_summary_syntax_from_ontology(self):

def test_topic_has_summary_syntax_from_file(self):
resp = self.api_client.get('/api/energy/v1/summary/syntax/', format='json', authentication=self.get_super_credentials())
print resp.content
self.assertValidJSONResponse(resp)
6 changes: 3 additions & 3 deletions app/detective/topics/common/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def summary_forms(self, bundle, request):
rulesManager = topics_rules()
# Fetch every registered model
# to print out its rules
for model in utils.get_topic_models(self.topic.module):
for model in self.topic.get_models():
name = model.__name__.lower()
rules = rulesManager.model(model).all()
fields = utils.get_model_fields(model)
Expand Down Expand Up @@ -384,7 +384,7 @@ def search(self, query):
def rdf_search(self, subject, predicate, obj):
obj = obj["name"] if "name" in obj else obj
# retrieve all models in current topic
all_models = dict((model.__name__, model) for model in utils.get_topic_models(self.topic.module))
all_models = dict((model.__name__, model) for model in self.topic.get_models())
# If the received obj describe a literal value
if self.is_registered_literal(predicate["name"]):
# Get the field name into the database
Expand Down Expand Up @@ -434,7 +434,7 @@ def rdf_search(self, subject, predicate, obj):
def get_models_output(self):
# Select only some atribute
output = lambda m: {'name': m.__name__, 'label': m._meta.verbose_name.title()}
return [ output(m) for m in utils.get_topic_models(self.topic.module) ]
return [ output(m) for m in self.topic.get_models() ]

def get_relationship_search(self):
isRelationship = lambda t: t.type == "relationship"
Expand Down
8 changes: 4 additions & 4 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "detective",
"version": "1.2.2",
"version": "1.2.3",
"dependencies": {
"angular-elastic": "2.2.0",
"angular-ui-bootstrap-bower": "0.6.0",
"bootstrap": "3.0.0",
"chroma-js": "0.5.2",
"chroma-js": "https://raw.github.com/gka/chroma.js/7b06f8df0e95450fa6ed9266c3cc3efbf3e53fc9/chroma.min.js",
"jquery.scrollTo": "1.4.6",
"js-md5": "1.0.3",
"modernizr": "2.6.2",
"raphael": "2.1.2",
"typeahead.js": "0.9.3",
"underscore": "1.5.2",
"unstable-angular-complete": "1.1.5",
"kartograph.js": "git://github.com/kartograph/kartograph.js",
"angular-all-unstable": "1.1.5",
"kartograph.js": "https://raw.github.com/kartograph/kartograph.js/3d89db48d9e1ea020972e8fb9566bea1dc8aa495/kartograph-0.8.2.min.js",
"jquery": "1.9.1",
"ng-file-upload": "~1.2.3",
"ngprogress-lite": "~1.0.4",
Expand Down

0 comments on commit 0a7c0e9

Please sign in to comment.