#!/usr/bin/python
# -*- encoding: utf-8 -*-

##
## models.py
## Created on Sat Dec 23 00:02:58 2006
## by Antti Kaihola <antti.kaihola@linux-aktivaattori.org>
## 
## Copyright (C) 2006 Antti Kaihola
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
## 
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##

from django.db import models


class TracSite(models.Model):
    name = models.CharField(
        maxlength=40,
        help_text=_('The name of the Trac project as used inside Djac.'))
    baseurl = models.URLField(
        verify_exists=False,
        help_text=_('Base URL of the Trac site, e.g. www.mysite.com/trac/myproject') )
    report_number = models.IntegerField(
        help_text=_('Number of the Trac report to use. Create a custom report with the Djac-specific SQL query and use its number here.') )
    username = models.CharField(
        maxlength=40,
        blank=True,
        null=True,
        help_text=_('User login to use on the Trac site if logging in is required to view tickets. Leave empty otherwise.'))
    password = models.CharField(
        maxlength=40,
        blank=True,
        null=True,
        help_text=_('Password for the Trac user login'))

    def __str__(self):
        return self.name
    
    class Admin:
        list_display = 'name', 'baseurl', 'report_number', 'username',
    
