I'm learning Django (Ubuntu 13.04, Python 2.7, Django 1.5, Postgres 9.2, Bootstrap 3.0). As my first effort I got the Polls app going from the
Django 1.5 tutorial. I then installed
django-registration 1.0 and
these templates to make it work. I chose that package for authentication as opposed to
django-allauth as a
result of my question on StackOverflow.
What I want to do now is to integrate these two apps so that the polls are not anonymous. After the poll results have been collected, a script is run to analyse the results and send an email to each user about how they did as compared to total or average. The script and the emailing could be done via Python, but even better should really be initialised via the Admin interface by site admin.
At first pass I was thinking roughly the following. The poll & choice could be simplified down to just a numeric answer to a question. At database level we would need a separate table. The primary key would be the userid. Each column would store one answer per. I'm guessing this would need a class PollsResults in model.py that would include defining the primary key as "User", which should exist via django-registration. Exactly how to do that and what follows gets a bit hazy to me at the moment.
At the moment my knowledge of Django is so light that I'm struggling to put two and two together in an elegant way. I have briefly looked at
Light Bird's Questionnaire, but decided it was too complicated using his own library of modular class based views. I'd like to keep it as simple as possible, using as much of out-of-the-box Django 1.5 functionality as possible.
I also looked at Pinax, but it seems to be stuck in dark ages with
latest stuff supporting Django 1.4 and Bootstrap 2.x. Documentation looks poor too. It looks like a great concept -
half-way house between a web framework and a CMS. But if only it had a
larger following and be more up-to-date with a variety of starter
projects (e.g. a Questionnaire/Polls type starter project where users enter data and then some processing happens etc).
I'm sure it's a simple exercise for any good Django dev to essentially combine django-registration with a result against each user, which can then be processed/emailed/etc.
Could anyone give any hints or maybe even point me to an example of something similar that could give me a starting point of modifying things rather than creating from scratch?