Optimisation Models

2011-10-26 Thread Suprnaturall
Optimisation Model Hi everyone, I'm working on the optimization of the model of my app. The goal is to limit the request to the database. In this webapp every user can follow users (like twitter), and when someone you follow publish an article, each followers reveive a mail. I'm wondering what is

Problem with user.username

2011-07-12 Thread Suprnaturall
Hi, First of all, apologize me for my poor, poor english. I m new with django and i m stuck with a odd thing. I created a login form and use the default django login handlet like this : base.html : (...) {% if user.is_authenticated %} {{user.use

group by and retrieve to template date from foreinKey

2011-07-15 Thread Suprnaturall
Hi dear django users :) I m facing a stupid problem. Here is my models.py : class Video(models.Model): (...) category = models.ForeignKey('Category') (...) class Category(models.Model): name = models.CharField(max_length=250) I'm trying in a tags to make a group by on the categor

custom method in models.py

2011-07-15 Thread Suprnaturall
Hi, I'm wondering if like in play or symfony you can develop special method for each class/table in the models.py and use them in your template. I'm trying few things but it didn't work. For exemple this is my models.py : class Category(models.Model): name = models.CharField(max_length=250)

Use object (User and custom object) in a form

2011-08-12 Thread Suprnaturall
Hello everyone, I'm trying to add comment to a custom object (here Article). This is my forms.py : from django import forms from django.contrib.auth.models import User from myApp.models import Article class CommentForms (forms.Form): cf_comment = forms.CharField() cf_writer = forms.User(