Найти - Пользователи
Полная версия: вопрос по Django & Sqlite3
Начало » Центр помощи » вопрос по Django & Sqlite3
1 2
eboome
ilnur
покажи модель Tasks.
task_types = (
('1', ‘category’),
('2', ‘event’),
)

class Tasks(models.Model):
pid = models.IntegerField(default = 0)
types = models.CharField(choices=task_types, max_length=1)
name = models.CharField(max_length = 100)
created = models.DateTimeField(auto_now_add=True)
start_date = models.DateTimeField(default = 0)
end_date = models.DateTimeField(default = 0)
comment = models.CharField(max_length = 300)
user_id = models.ForeignKey(User, related_name='userid')
ilnur
def index(request):
    task_list = Tasks.objects.filter(user_id=user)
    output = ',  '.join(  p.name for p in task_list ] )
    return HttpResponse(output)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB