2012-11-20 21:10:12 -08:00
|
|
|
import markdown
|
2012-11-20 17:33:49 -08:00
|
|
|
|
2011-08-17 05:57:41 -07:00
|
|
|
from django.core.urlresolvers import reverse
|
2011-03-01 09:47:03 -08:00
|
|
|
from django.db import models
|
2011-06-29 08:52:30 -07:00
|
|
|
from django.db.models.signals import pre_save
|
2012-11-20 21:10:12 -08:00
|
|
|
from django.utils.safestring import mark_safe
|
2011-06-29 08:52:30 -07:00
|
|
|
|
|
|
|
from main.utils import set_created_field
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class IsoOption(models.Model):
|
2011-03-01 11:43:37 -08:00
|
|
|
name = models.CharField(max_length=200)
|
|
|
|
|
|
|
|
def __unicode__(self):
|
2011-04-28 15:44:43 -07:00
|
|
|
return self.name
|
isotests: various changes and updates
* isotests/fixtures/clockchoices.json: changed 'default' to 'unchanged'
* isotests/fixtures/filesystems.json: removed 'check the installed
system' line from one of the options
* isotests/fixtures/modules.json: added
'ext2','ext3','ext4','swap','xfs','jfs','reiserFS'
* isotests/models.py:
* Added RollbackOption abstract class that adds the functions
get_rollback_success_test and get_rollback_failed_test on top of
the IsoOption abstract class for use with the Filesystem and
Module classes since Test uses these both in 2 ways (regular and
rollback). This keeps them seperated.
* renamed the related names of these properties from rollback_test
to rollback_test_set (seems more in-tune with the other relations)
* isotests/views.py:
* changed the order of the fields, the automatic order makes no
sense.
* Added help texts to the fields success, filesystem,
rollback_filesystem and rollback_modules.
* Removed help text from modules (made no sense)
* Added a website field, should remain empty, a simplistic way to
hopefully reduce spambot entries.
* templates/isotests/results.html:
* Removed the rollback yes/no section
* The rollback labels should check get_rollback_success_test and
get_rollback_failed_test.
* Rollback checkbox removed.
* Clearly tell users that success must only be selected if everything
works right.
* Clearly tell users to only fill in the rollback options if they did a
rollback.
* Added a thanks page that tells people thanks.
* Added links between the pages.
* Added links to lists with tests of either a specific iso or of any
iso where a specific option was selected.
Signed-off-by: Dan McGee <dan@archlinux.org>
Conflicts:
templates/isotests/results.html
2011-04-28 11:19:42 -07:00
|
|
|
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 15:44:43 -07:00
|
|
|
class RollbackOption(IsoOption):
|
|
|
|
class Meta:
|
|
|
|
abstract = True
|
2011-03-01 11:43:37 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class Iso(models.Model):
|
2011-04-28 11:59:53 -07:00
|
|
|
name = models.CharField(max_length=255)
|
|
|
|
created = models.DateTimeField(editable=False)
|
2011-08-16 12:39:23 -07:00
|
|
|
removed = models.DateTimeField(null=True, blank=True, default=None)
|
2011-04-28 11:00:27 -07:00
|
|
|
active = models.BooleanField(default=True)
|
2011-03-01 11:43:37 -08:00
|
|
|
|
2011-08-17 05:57:41 -07:00
|
|
|
def get_absolute_url(self):
|
|
|
|
return reverse('releng-results-iso', args=[self.pk])
|
|
|
|
|
2011-03-01 11:43:37 -08:00
|
|
|
def __unicode__(self):
|
|
|
|
return self.name
|
|
|
|
|
2011-08-22 14:42:06 -07:00
|
|
|
class Meta:
|
|
|
|
verbose_name = 'ISO'
|
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class Architecture(IsoOption):
|
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class IsoType(IsoOption):
|
2011-08-22 14:42:06 -07:00
|
|
|
class Meta:
|
|
|
|
verbose_name = 'ISO type'
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class BootType(IsoOption):
|
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class HardwareType(IsoOption):
|
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class InstallType(IsoOption):
|
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class Source(IsoOption):
|
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class ClockChoice(IsoOption):
|
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
isotests: various changes and updates
* isotests/fixtures/clockchoices.json: changed 'default' to 'unchanged'
* isotests/fixtures/filesystems.json: removed 'check the installed
system' line from one of the options
* isotests/fixtures/modules.json: added
'ext2','ext3','ext4','swap','xfs','jfs','reiserFS'
* isotests/models.py:
* Added RollbackOption abstract class that adds the functions
get_rollback_success_test and get_rollback_failed_test on top of
the IsoOption abstract class for use with the Filesystem and
Module classes since Test uses these both in 2 ways (regular and
rollback). This keeps them seperated.
* renamed the related names of these properties from rollback_test
to rollback_test_set (seems more in-tune with the other relations)
* isotests/views.py:
* changed the order of the fields, the automatic order makes no
sense.
* Added help texts to the fields success, filesystem,
rollback_filesystem and rollback_modules.
* Removed help text from modules (made no sense)
* Added a website field, should remain empty, a simplistic way to
hopefully reduce spambot entries.
* templates/isotests/results.html:
* Removed the rollback yes/no section
* The rollback labels should check get_rollback_success_test and
get_rollback_failed_test.
* Rollback checkbox removed.
* Clearly tell users that success must only be selected if everything
works right.
* Clearly tell users to only fill in the rollback options if they did a
rollback.
* Added a thanks page that tells people thanks.
* Added links between the pages.
* Added links to lists with tests of either a specific iso or of any
iso where a specific option was selected.
Signed-off-by: Dan McGee <dan@archlinux.org>
Conflicts:
templates/isotests/results.html
2011-04-28 11:19:42 -07:00
|
|
|
class Filesystem(RollbackOption):
|
2011-04-28 11:00:27 -07:00
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
isotests: various changes and updates
* isotests/fixtures/clockchoices.json: changed 'default' to 'unchanged'
* isotests/fixtures/filesystems.json: removed 'check the installed
system' line from one of the options
* isotests/fixtures/modules.json: added
'ext2','ext3','ext4','swap','xfs','jfs','reiserFS'
* isotests/models.py:
* Added RollbackOption abstract class that adds the functions
get_rollback_success_test and get_rollback_failed_test on top of
the IsoOption abstract class for use with the Filesystem and
Module classes since Test uses these both in 2 ways (regular and
rollback). This keeps them seperated.
* renamed the related names of these properties from rollback_test
to rollback_test_set (seems more in-tune with the other relations)
* isotests/views.py:
* changed the order of the fields, the automatic order makes no
sense.
* Added help texts to the fields success, filesystem,
rollback_filesystem and rollback_modules.
* Removed help text from modules (made no sense)
* Added a website field, should remain empty, a simplistic way to
hopefully reduce spambot entries.
* templates/isotests/results.html:
* Removed the rollback yes/no section
* The rollback labels should check get_rollback_success_test and
get_rollback_failed_test.
* Rollback checkbox removed.
* Clearly tell users that success must only be selected if everything
works right.
* Clearly tell users to only fill in the rollback options if they did a
rollback.
* Added a thanks page that tells people thanks.
* Added links between the pages.
* Added links to lists with tests of either a specific iso or of any
iso where a specific option was selected.
Signed-off-by: Dan McGee <dan@archlinux.org>
Conflicts:
templates/isotests/results.html
2011-04-28 11:19:42 -07:00
|
|
|
class Module(RollbackOption):
|
2011-04-28 11:00:27 -07:00
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-04-28 11:00:27 -07:00
|
|
|
class Bootloader(IsoOption):
|
|
|
|
pass
|
2011-03-01 09:47:03 -08:00
|
|
|
|
2012-08-15 06:25:00 -07:00
|
|
|
|
2011-03-01 09:47:03 -08:00
|
|
|
class Test(models.Model):
|
|
|
|
user_name = models.CharField(max_length=500)
|
2012-09-04 06:37:09 -07:00
|
|
|
user_email = models.EmailField('email address')
|
|
|
|
# Great work, Django... https://code.djangoproject.com/ticket/18212
|
|
|
|
ip_address = models.GenericIPAddressField(verbose_name='IP address',
|
|
|
|
unpack_ipv4=True)
|
2011-04-28 11:59:53 -07:00
|
|
|
created = models.DateTimeField(editable=False)
|
2011-04-28 13:04:45 -07:00
|
|
|
|
2011-03-01 09:47:03 -08:00
|
|
|
iso = models.ForeignKey(Iso)
|
2011-04-28 11:00:27 -07:00
|
|
|
architecture = models.ForeignKey(Architecture)
|
|
|
|
iso_type = models.ForeignKey(IsoType)
|
|
|
|
boot_type = models.ForeignKey(BootType)
|
|
|
|
hardware_type = models.ForeignKey(HardwareType)
|
|
|
|
install_type = models.ForeignKey(InstallType)
|
2011-03-01 09:47:03 -08:00
|
|
|
source = models.ForeignKey(Source)
|
2011-04-28 11:00:27 -07:00
|
|
|
clock_choice = models.ForeignKey(ClockChoice)
|
2011-03-01 09:47:03 -08:00
|
|
|
filesystem = models.ForeignKey(Filesystem)
|
2011-04-28 11:00:27 -07:00
|
|
|
modules = models.ManyToManyField(Module, null=True, blank=True)
|
2011-04-28 15:44:43 -07:00
|
|
|
bootloader = models.ForeignKey(Bootloader)
|
2011-03-01 11:43:37 -08:00
|
|
|
rollback_filesystem = models.ForeignKey(Filesystem,
|
isotests: various changes and updates
* isotests/fixtures/clockchoices.json: changed 'default' to 'unchanged'
* isotests/fixtures/filesystems.json: removed 'check the installed
system' line from one of the options
* isotests/fixtures/modules.json: added
'ext2','ext3','ext4','swap','xfs','jfs','reiserFS'
* isotests/models.py:
* Added RollbackOption abstract class that adds the functions
get_rollback_success_test and get_rollback_failed_test on top of
the IsoOption abstract class for use with the Filesystem and
Module classes since Test uses these both in 2 ways (regular and
rollback). This keeps them seperated.
* renamed the related names of these properties from rollback_test
to rollback_test_set (seems more in-tune with the other relations)
* isotests/views.py:
* changed the order of the fields, the automatic order makes no
sense.
* Added help texts to the fields success, filesystem,
rollback_filesystem and rollback_modules.
* Removed help text from modules (made no sense)
* Added a website field, should remain empty, a simplistic way to
hopefully reduce spambot entries.
* templates/isotests/results.html:
* Removed the rollback yes/no section
* The rollback labels should check get_rollback_success_test and
get_rollback_failed_test.
* Rollback checkbox removed.
* Clearly tell users that success must only be selected if everything
works right.
* Clearly tell users to only fill in the rollback options if they did a
rollback.
* Added a thanks page that tells people thanks.
* Added links between the pages.
* Added links to lists with tests of either a specific iso or of any
iso where a specific option was selected.
Signed-off-by: Dan McGee <dan@archlinux.org>
Conflicts:
templates/isotests/results.html
2011-04-28 11:19:42 -07:00
|
|
|
related_name="rollback_test_set", null=True, blank=True)
|
2011-03-01 11:43:37 -08:00
|
|
|
rollback_modules = models.ManyToManyField(Module,
|
isotests: various changes and updates
* isotests/fixtures/clockchoices.json: changed 'default' to 'unchanged'
* isotests/fixtures/filesystems.json: removed 'check the installed
system' line from one of the options
* isotests/fixtures/modules.json: added
'ext2','ext3','ext4','swap','xfs','jfs','reiserFS'
* isotests/models.py:
* Added RollbackOption abstract class that adds the functions
get_rollback_success_test and get_rollback_failed_test on top of
the IsoOption abstract class for use with the Filesystem and
Module classes since Test uses these both in 2 ways (regular and
rollback). This keeps them seperated.
* renamed the related names of these properties from rollback_test
to rollback_test_set (seems more in-tune with the other relations)
* isotests/views.py:
* changed the order of the fields, the automatic order makes no
sense.
* Added help texts to the fields success, filesystem,
rollback_filesystem and rollback_modules.
* Removed help text from modules (made no sense)
* Added a website field, should remain empty, a simplistic way to
hopefully reduce spambot entries.
* templates/isotests/results.html:
* Removed the rollback yes/no section
* The rollback labels should check get_rollback_success_test and
get_rollback_failed_test.
* Rollback checkbox removed.
* Clearly tell users that success must only be selected if everything
works right.
* Clearly tell users to only fill in the rollback options if they did a
rollback.
* Added a thanks page that tells people thanks.
* Added links between the pages.
* Added links to lists with tests of either a specific iso or of any
iso where a specific option was selected.
Signed-off-by: Dan McGee <dan@archlinux.org>
Conflicts:
templates/isotests/results.html
2011-04-28 11:19:42 -07:00
|
|
|
related_name="rollback_test_set", null=True, blank=True)
|
2011-04-28 13:04:45 -07:00
|
|
|
|
2011-03-01 09:47:03 -08:00
|
|
|
success = models.BooleanField()
|
2011-03-01 11:43:37 -08:00
|
|
|
comments = models.TextField(null=True, blank=True)
|
2011-04-28 10:43:01 -07:00
|
|
|
|
2012-11-01 07:20:38 -07:00
|
|
|
|
2012-11-20 17:16:25 -08:00
|
|
|
class Release(models.Model):
|
|
|
|
release_date = models.DateField(db_index=True)
|
|
|
|
version = models.CharField(max_length=50)
|
|
|
|
kernel_version = models.CharField(max_length=50, blank=True)
|
|
|
|
torrent_infohash = models.CharField(max_length=64, blank=True)
|
|
|
|
created = models.DateTimeField(editable=False)
|
|
|
|
available = models.BooleanField(default=True)
|
|
|
|
info = models.TextField('Public information', blank=True)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
get_latest_by = 'release_date'
|
|
|
|
ordering = ('-release_date', '-version')
|
|
|
|
|
|
|
|
def __unicode__(self):
|
|
|
|
return self.version
|
|
|
|
|
2012-11-20 17:33:49 -08:00
|
|
|
def dir_path(self):
|
|
|
|
return "iso/%s/" % self.version
|
|
|
|
|
|
|
|
def iso_url(self):
|
|
|
|
return "iso/%s/archlinux-%s-dual.iso" % (self.version, self.version)
|
|
|
|
|
|
|
|
def magnet_uri(self):
|
2012-11-20 21:54:20 -08:00
|
|
|
query = [
|
|
|
|
('dn', "archlinux-%s-dual.iso" % self.version),
|
|
|
|
('tr', "udp://tracker.archlinux.org:6969"),
|
|
|
|
('tr', "http://tracker.archlinux.org:6969/announce"),
|
|
|
|
]
|
2012-11-20 17:33:49 -08:00
|
|
|
if self.torrent_infohash:
|
2012-11-20 21:54:20 -08:00
|
|
|
query.insert(0, ('xt', "urn:btih:%s" % self.torrent_infohash))
|
|
|
|
return "magnet:?%s" % '&'.join(['%s=%s' % (k, v) for k, v in query])
|
2012-11-20 17:33:49 -08:00
|
|
|
|
2012-11-20 21:10:12 -08:00
|
|
|
def info_html(self):
|
|
|
|
return mark_safe(markdown.markdown(
|
|
|
|
self.info, safe_mode=True, enable_attributes=False))
|
|
|
|
|
2012-11-20 17:16:25 -08:00
|
|
|
|
|
|
|
for model in (Iso, Test, Release):
|
2012-11-01 07:20:38 -07:00
|
|
|
pre_save.connect(set_created_field, sender=model,
|
|
|
|
dispatch_uid="releng.models")
|
2011-04-28 11:59:53 -07:00
|
|
|
|
2011-04-28 10:43:01 -07:00
|
|
|
# vim: set ts=4 sw=4 et:
|