Code Monkey home page Code Monkey logo

django-supertagging's Introduction

Django SuperTagging

Inspired by django-tagging, this project came up when we wanted to
automate content tagging. Using OpenCalais service we are able to retrieve
a large array of data, including basic entities (tags) and relations (attributes
about the tag).

Prerequisites
	- simplejson ( http://pypi.python.org/pypi/simplejson )
	

django-supertagging's People

Contributors

coordt avatar jsoa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-supertagging's Issues

Problem with utf-8 string and opencalais

django-supertagging crash when I try to save text with accents in my database fields :

I try to save the following string u'this is a test with an accent é'

And I got the following exception

Environment:

Request Method: POST
Request URL: http://localhost:8000/admin/matchfwd_email/email/21/
Django Version: 1.2.3
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django_extensions',
'taggit',
'supertagging',
'django.contrib.admin',
'matchfwd.profiles',
'matchfwd.matchfwd_email']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')

Traceback:
File "/Library/Python/2.6/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = callback(request, _callback_args, *_callback_kwargs)
    
    File "/Library/Python/2.6/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/Library/Python/2.6/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/Library/Python/2.6/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/Library/Python/2.6/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/Library/Python/2.6/site-packages/django/utils/decorators.py" in _wrapper
  6.         return decorator(bound_func)(_args, *_kwargs)
    
    File "/Library/Python/2.6/site-packages/django/utils/decorators.py" in _wrapped_view
  7.                 response = view_func(request, _args, *_kwargs)
    
    File "/Library/Python/2.6/site-packages/django/utils/decorators.py" in bound_func
  8.             return func(self, _args2, *_kwargs2)
    
    File "/Library/Python/2.6/site-packages/django/db/transaction.py" in _commit_on_success
  9.                 res = func(_args, *_kw)
    
    File "/Library/Python/2.6/site-packages/django/contrib/admin/options.py" in change_view
  10.             self.save_model(request, new_object, form, change=True)
    
    File "/Library/Python/2.6/site-packages/django/contrib/admin/options.py" in save_model
  11.     obj.save()
    
    File "/Library/Python/2.6/site-packages/django/db/models/base.py" in save
  12.     self.save_base(using=using, force_insert=force_insert, force_update=force_update)
    
    File "/Library/Python/2.6/site-packages/django/db/models/base.py" in save_base
  13.             created=(not record_exists), raw=raw)
    
    File "/Library/Python/2.6/site-packages/django/dispatch/dispatcher.py" in send
  14.         response = receiver(signal=self, sender=sender, **named)
    
    File "/Library/Python/2.6/site-packages/supertagging/handlers.py" in save_handler
  15.         process(instance)
    
    File "/Library/Python/2.6/site-packages/supertagging/modules/init.py" in process
  16.         if settings.ST_DEBUG: raise Exception(e)
    

Exception Type: Exception at /admin/matchfwd_email/email/21/

Exception Value: ('ascii', u'this is a test with an accent \xe9', 30, 31, 'ordinal not in range(128)')

my supertagging SETTINGS :
SUPERTAGGING_DEBUG = True
SUPERTAGGING_ENABLED = True
SUPERTAGGING_AUTO_PROCESS = True
SUPERTAGGING_PROCESS_RELATIONS = True
SUPERTAGGING_PROCESS_TOPICS = True
SUPERTAGGING_RESOLVE_PROPERTY_KEYS = True
SUPERTAGGING_ONLY_NON_TAGGED_OBJECTS = False
SUPERTAGGING_MIN_RELEVANCE = 200
SUPERTAGGING_USE_FREEBASE = False
SUPERTAGGING_MARKUP = False
SUPERTAGGING_REGISTER_MODELS = False
SUPERTAGGING_MODULES = {

'matchfwd_email.email':
    {'fields':[
            {'name': 'body'},
        ],
    },

}

PickledObjectField doesn't work properly with utf-8 string

The PickledObjectField crash when trying to tag the following value : 'Java Tech Lead - Montreal' since OpenCalais detect the location Montreal/Québec/Canada. When SuperTagging try to persist the instances fields. The PickledObjectField crash because it is using the str method.

Objects that don't match the "match_kwargs" are add the process queue anyway.

Objects that doesn't match the match_kwargs setting are add to the SuperTagProcessQueue anyway.

here's my  SUPERTAGGING_MODULES

SUPERTAGGING_MODULES = {
'app.model':
{'fields':[
{'name':'title'},
{'name':'job_title'},
{'name':'description'},
],
'match_kwargs':{'source_type__in':['SOURCE_TYPE_1',]}
},
}

Now when I create object with a different source type they are add to the process queue anyway which doesn't seems right.

I am using 0.4.11

parse_tag_input missing in utils.py

I don't have the traceback, I was fixin a bug in a production server. Anyway the error is simple, 'parse_tag_input' is not avalilable in utils.py and it is called in line 65, this method can be imported from django.contrib.tagging.utils.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.