First, Hello all. This is my first post here in django-users, hope I'm 
doing it well.

This question is not django - specific but since I'm using our loved tool, 
I though it could be a good place to post it.

I am developing a business analytics like app, and I have some models like 
this:


class AccountStats(models.Model):
    """
    Model to save relevant information about the account.
    This data is going to be the relative to the graphs.
    """
    account = models.ForeignKey(Account, related_name='stats')

    fetch_date = models.DateTimeField(...)
    emails_count = models.PositiveIntegerField('...')
    friends_count = models.PositiveIntegerField(' ')
    favourites_count = models.PositiveIntegerField('''')
    listed_count = models.PositiveIntegerField(''')
    writes_count = models.PositiveIntegerField(''')

And the User model provided by Django.

So, now I can  write template files with charts embedded on them. (I'm 
using HighCharts js) doing some
ORM calls, manipulating received data in views and writing the js and html 
in templates.

My next step will be create Widgets models, in order to reuse code.
So for example, create a Widget that will be 'Friends Count', it will be a 
Line Chart and it will call the 
ORM call (pseudo)[SELECT friends_count FROM AccountStats GROUP BY 
fetch_date('Day') ].

While I'm writing this I'm realize that maybe an approach will be write 
several template .html files and then {% include them %}
with the right objects.

So how could I go with it? Any direction, approach or examples to solve 
this?
So many thanks.

PD. Sorry, not native english speaker.





-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7e58e450-7775-4801-b60e-e9f7c11f326d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to