code_generator ImportError: cannot import name 'generate_code'

Skip to first unread message

Jan Priebe

Jan 22, 2016, 12:56:47 PM1/22/16
to rapidsms

I'm trying to setup the rapidsms-script app to which code_generator is a dependency (via rapidsms-polls). I've added code_generator to my project folder but when running syncdb it gives me the following error:

  File "C:\DjangoProjects\rapidsms_sandbox\code_generator\", line 14, in <module>
    from code_generator import generate_code, get_code_from_model, increment_base_10
ImportError: cannot import name 'generate_code'

Seems like this is a problem with code_generator itself, but since its a dependency for many apps someone should have picked that up by now? Any suggestions much appreciated!



my pip freeze in case useful:

Jan Priebe

Jan 26, 2016, 11:42:28 AM1/26/16
to rapidsms
Taking a closer look, code_generator requires you to adapt the code in that specifies the get_previous_code_function and the get_next_code_function, depending on which models it's being used with, so I realise my first post doesn't make much sense - sorry. I'm trying to understand where in simple_locations this code is being used so I can write the needed functions, but since I'm new to this it's taking it's time and some help would be greatly appreciated.

Could anyone who has used the rapidsms_polls app (and therefore also simple_locations and code_generator) share their adapted version of the file '' ?

Muchas gracias
Reply all
Reply to author
0 new messages