Can't get the example project to "allow_new" fruit items

101 views
Skip to first unread message

Hans Hermans

unread,
Jan 5, 2013, 7:37:46 PM1/5/13
to django-s...@googlegroups.com
Sorry for what may be a lame post; I'm a noob still learning django....

I've played with django-selectable for a while now and have had some success, but can't  get anything to happen when allow_new is set to True. I eventually downloaded the example project and it seems to be running. My problem is, I don't see anything happening when I enter a new fruit in any of the autocomplete fields that say "allows new items".

There seems (to me anyway) to be very little documentation about exactly how the 'allow_new=True' option is supposed to work; in my own project I was never able to get the create_item method to run for any of my lookup definitions. 

Could you please make some suggestions on what I should read or do next?

It's much appreciated. 

Mark Lavin

unread,
Jan 5, 2013, 8:06:50 PM1/5/13
to django-s...@googlegroups.com
I would agree that there is limited documentation on `allow_new`. The best place to see the `allow_new` in the example project is in Farm admin. The owner field allows new users to be created from the text which becomes the created user's username. Saving the newly created user is handled by the form save.

It's probably worth noting that the widget `allow_new` is only enforced on the client-side. The `AutoCompleteSelectField.to_python` is what calls the lookup `create_item`. If you are only using one of the widgets and not the field then you would never see `create_item` called.

I hope that gets you pointed in the right direction.

Best,

Mark

Sapana Kaswa-Surpuriya

unread,
Jul 23, 2013, 5:00:14 PM7/23/13
to django-s...@googlegroups.com
Hey Hans!

I am new to django development. I need to implement the django selectable + addition of new items in one of my form fields.
would you please let me know from where did you download the example project. Also were you able to implement allow_new?
Would really appreciate your help in this. Looking forward to hearing back from you at earliest. Thanks!

Mark Lavin

unread,
Jul 23, 2013, 6:15:09 PM7/23/13
to django-s...@googlegroups.com
The example project is available in the source repository for django-selectable https://bitbucket.org/mlavin/django-selectable/src/35399783605a5a1867cfb5a3c50a8efff816cfae/example?at=default


--
You received this message because you are subscribed to the Google Groups "django-selectable" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-selecta...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Hans Hermans

unread,
Jul 24, 2013, 9:01:09 AM7/24/13
to django-s...@googlegroups.com
Sapana,

Sorry, I did not get very far with allowing new entries. I am new to django as well, but I've been working on it and am hoping that one of these days I'll have learned enough to understand it better.

H


On Tue, Jul 23, 2013 at 5:00 PM, Sapana Kaswa-Surpuriya <sapan...@gmail.com> wrote:
--
You received this message because you are subscribed to a topic in the Google Groups "django-selectable" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-selectable/YwsUP0XfNfM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-selecta...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages