This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Search features for an elasticsearch / haystack / elasticstack | |
:creationdate: 05/11/15 15:05 | |
:moduleauthor: François GUÉRIN <[email protected]> | |
:modulename: intrautils.search | |
""" | |
import base64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ELASTICSEARCH_INDEX_SETTINGS = { | |
'settings': { | |
'index': { | |
'number_of_shards': 6, | |
'analysis': { | |
'tokenizer': { | |
'haystack_ngram_tokenizer': { | |
'type': 'nGram', | |
'min_gram': 3, | |
'max_gram': 15, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2016-02-01 10:37:01,526][DEBUG][action.admin.indices.mapping.put] [intranet] failed to put mappings on indices [[intranet_dev]], type [modelresult] | |
java.lang.NullPointerException | |
at org.elasticsearch.index.mapper.attachment.AttachmentMapper$TypeParser.findMapperBuilder(AttachmentMapper.java:302) | |
at org.elasticsearch.index.mapper.attachment.AttachmentMapper$TypeParser.parse(AttachmentMapper.java:326) | |
at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseProperties(ObjectMapper.java:310) | |
at org.elasticsearch.index.mapper.object.ObjectMapper$TypeParser.parseObjectOrDocumentTypeProperties(ObjectMapper.java:223) | |
at org.elasticsearch.index.mapper.object.RootObjectMapper$TypeParser.parse(RootObjectMapper.java:139) | |
at org.elasticsearch.index.mapper.DocumentMapperParser.parse(DocumentMapperParser.java:140) | |
at org.elasticsearch.index.mapper.DocumentMapperParser.parseCompressed(DocumentMapperParser.java:121) | |
at org.elasticsearch.index.mapper.MapperService.parse(MapperService.java:391) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PUT intranet_dev/_mapping/modelresult | |
{ | |
"properties": { | |
"document_file": { | |
"fields": { | |
"content_length": { | |
"type": "integer", | |
"store": "yes" | |
}, | |
"language": "french", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Search features for : | |
* :mod:`elasticsearch.elasticsearch` | |
* :mod:`haystack:haystack` | |
* :mod:`elasticstack:elasticstack` | |
:creationdate: 05/11/15 15:05 | |
:moduleauthor: François GUÉRIN <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InlineFormsetMixin(SingleObjectTemplateResponseMixin, BaseFormsetMixin): | |
object = None | |
formset_link_field = None | |
def get_formset_kwargs(self): | |
""" | |
Gets the formset kwargs | |
:returns: dict of kwargs | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BaseFormsetMixin(TemplateResponseMixin, FormMixin): | |
""" | |
Base formset mixin, which provide the use of a (model) form with an (inline) formset. This mixin can be used vith | |
an :class:`django:django.views.UpdateView` or a :class:`django:django.views.CreateView` | |
""" | |
formset_class = None | |
formset_visible_fields = None | |
formset_continuable = False | |
template_name = "base_form.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple service unit to start / stop the scheduler. | |
# This unit has been mainly written to manage start of scheduler on reboot, | |
# but it can be used to stop / start the scheduler at any time. | |
# François GUÉRIN <[email protected]> 2016 | |
# WTFPL :) | |
[Unit] | |
Description=Phraseanet Scheduler Service | |
Documentation=https://docs.phraseanet.com/3.8/fr/Admin/MoteurDeTaches.html | |
Documentation=https://docs.phraseanet.com/3.8/en/Admin/TaskManager.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- wagtailleaflet/templates/leaflet/widget.html --> | |
{% load leaflet_tags %} | |
{% load static from staticfiles %} | |
<style type="text/css">{% block map_css %} | |
{% if map_width and map_height %}#{{ id_map }} { width: {{ map_width }}; height: {{ map_height }}; }{% endif %} | |
{% if not display_raw %}#{{ id }} { display: none; }{% endif %} | |
{% endblock map_css %} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load i18n %} | |
{% load static from staticfiles %} | |
{% if creatediv %} | |
<div id="{{ name }}" class="leaflet-container-default"></div>{% endif %} | |
<script type="text/javascript"> | |
(function () { | |
window.DEBUG_LEAFLET && console.debug('_leaflet_map.html : name = ' + '{{ name }}'); | |
function loadmap() { | |
window.DEBUG_LEAFLET && console.debug('_leaflet_map.html:loadmap()'); |
OlderNewer