First time here? Check out the FAQ!

shano's profile - activity

2019-03-16 22:04:25 -0500 received badge Famous Question (source)
2014-12-13 21:15:15 -0500 received badge Famous Question (source)
2013-11-19 05:30:52 -0500 received badge Enthusiast
2013-11-13 09:17:27 -0500 received badge Supporter (source)
2013-09-18 15:09:50 -0500 received badge Good Question (source)
2013-09-18 15:08:31 -0500 received badge Self-Learner ( source )
2013-09-18 15:08:31 -0500 received badge Teacher ( source )
2013-09-05 04:51:14 -0500 received badge Nice Question (source)
2013-09-03 03:48:33 -0500 answered a question Implementing custom autocompleter

These settings worked for me, make sure and bear in mind the stopCharRegex, any character here will cause the autocompleter to stop. The default setting for this stopped on spaces which was causing me most of my problems.

{%- macro location_autocomplete_js(id = '#id_location') -%}
    var locationAc = new AutoCompleter({
            url: '{% url "get_location_list" %}',
            minChars: 3,
            useCache: true,
            maxCacheLength: 100,
            matchInside: false,
            autocompleteMultiple: false,
            multipleSeparator: null,
            delay: 10,
            stopCharRegex: /\./
    });
    locationAc.decorate($("{{ id }}"));
{%- endmacro -%}
2013-08-22 09:24:00 -0500 asked a question Including other app template files

I'm trying to incorporate django-autocomplete-light into askbot, but I need to include some one of the apps template files via:

{% include 'autocomplete_light/static.html' %}

in bottom_scripts.html(after jquery is loaded).

I'm having trouble getting it to include the appropriate file. I've added

ASKBOT_EXTRA_SKINS_DIR = 'askbot/custom/skins/'

STATICFILES_DIRS = (
    ('default/media', os.path.join(ASKBOT_ROOT, 'media')),
    ASKBOT_EXTRA_SKINS_DIR,
)

to settings.py and symlinked the django_autocomplete templates to my askbot/custom/skins directory. Running collectstatic works and copies across the static files, but my include above is still returning

TemplateNotFound at /questions/autocomplete_light/static.html

Does your skins implementation have another way of including extra templates?

2013-08-20 16:18:22 -0500 received badge Student (source)
2013-08-20 10:20:09 -0500 received badge Editor (source)
2013-08-20 10:18:26 -0500 asked a question Implementing custom autocompleter

I wanted to know what autocompleter library you are using.

I'm trying to create another instance of this autocompleter that doesn't have space separated values(like how tags work), it simply needs to autocomplete only one value. I figured autocompleteMultiple=false would work as per this example.

{%- macro location_autocomplete_js(id = '#id_location') -%}
    var locationAc = new AutoCompleter({
            url: '{% url "get_location_list" %}',
            minChars: 3,
            useCache: true,
            maxCacheLength: 100,
            matchInside: false,
            autocompleteMultiple: false,
            delay: 10,
    });
    locationAc.decorate($("{{ id }}"));
{%- endmacro -%}

But I'm having no luck. Also it is possible to use this for json driven autocompletion. I wish to retrieve both names and unique ids from the server and use the unique id in the post request.

Cheers!

2013-08-15 05:35:31 -0500 commented answer adding a new text field to question

Ah, so create a separate app that maintains any thread migrations and also use add_to_class in there to maintain the class fields, instead of altering the thread model.

2013-08-15 05:12:06 -0500 commented answer adding a new text field to question

I think you're right forking might be the least painful option considering the extensions I'll need to add. Thanks for your help.

2013-08-15 04:41:30 -0500 commented answer adding a new text field to question

Woudl the unique together constraint work on ids for a many-to-one relationship? Meaning a thread can have only one location but one location can have many threads? Thanks for your help btw, it's much appreciated.

2013-08-15 04:35:16 -0500 commented answer adding a new text field to question

That could work, but it would mean a many-to-one relationship in the wrong direction. I could potentially create a m2m relationship but that's not ideal. I'm adding locations as a form of required tag and anticipated this would need a new model attached to threads, I might look into seeing if I can work this feature into tags itself.

2013-08-15 04:09:08 -0500 commented answer adding a new text field to question

Is there any painless way to link the related model to askbot.models.Thread, I'm trying to avoid hacking the source but I can't seem to be able to extend question functionality without doing so.

2013-08-13 09:14:45 -0500 received badge Scholar ( source )
2013-08-13 09:14:22 -0500 commented answer Required fields on sign-in

Will there be issues disabling your customized version of django-authopenid and simply using the existing version. The latest django-authopenid seems to have a OPENID_SREG setting that supplies user required fields that appear on completion.

2013-08-13 05:15:35 -0500 asked a question Required fields on sign-in

I'd like to add some required fields to the user in askbot that a user must fill in before sign-up is completed. Specifically location and country.

I see you guys are using django-authopenid to handle logins. Instead of automatically forwarding the successful open-id/password entry to /complete, do you guys know of a way to forward to another step and ask for country and city?