Permalink
Browse files

Looks like the repository version and the live version weren't as in …

…sync as I thought.
  • Loading branch information...
Bryan Veloso
Bryan Veloso committed Jun 22, 2008
1 parent d33f803 commit 43ad076f6696e51becc348e12c2039dc4c9ef961
@@ -3,7 +3,7 @@
from django.contrib.sites.models import Site
from django.contrib.contenttypes.models import ContentType
-from models import Project, Repository, Changeset
+from models import Project, CodeRepository, CodeCommit
# Get the current site.
@@ -21,7 +21,7 @@ def description(self):
return 'The latest commits for all the projects on %s' % site.name
def items(self):
- return Changeset.objects.all()[:50]
+ return CodeCommit.objects.all()[:50]
def item_pubdate(self, item):
return item.committed
@@ -61,7 +61,7 @@ def item_link(self, item):
# class LatestCommitsByProject(Feed):
# def get_object(self, bits):
# if len(bits) != 1:
-# return Changeset.objects.all()[:50]
+# return CodeCommit.objects.all()[:50]
# else:
# return Project.objects.get(beat__exact=bits[0])
#
@@ -4,8 +4,8 @@
from django.db.models import permalink
from django.utils import text
-#from core.models import Item
-from applications.tagging.fields import TagField
+from core.models import Item
+from tagging.fields import TagField
class Developer(models.Model):
@@ -32,7 +32,7 @@ class Meta:
def __unicode__(self):
return '%s (%s)' % (self.name, self.svn_name)
-
+
@permalink
def get_absolute_url(self):
return ('developer-detail', (), {
@@ -49,17 +49,6 @@ def full_name(self):
return ' '.join(b for b in (self.first_name, self.middle_name, self.last_name, self.suffix) if b)
-class Committer(models.Model):
- """
- A class that creates a simple relationship between a person who commits
- code into a repository listed in the directory and a developer in the
- directory.
- """
-
- developer = models.ForeignKey(Developer, unique=True)
- committer_name = models.CharField(max_length=50)
-
-
class Project(models.Model):
"""
A project is a wrapper around a code repository, connecting authors and
@@ -74,7 +63,6 @@ class Project(models.Model):
members = models.ManyToManyField(Developer, related_name='members', blank=True, null=True)
slug = models.SlugField(unique=True)
url = models.URLField('project URL', verify_exists=True, help_text='The URL to the project, usually hosted at Google Code.')
- extra_urls = models.TextField('additional URLs')
tags = TagField()
active = models.BooleanField(default=True)
@@ -98,7 +86,7 @@ def save(self):
super(Project, self).save()
-class Repository(models.Model):
+class CodeRepository(models.Model):
"""
A code repository that you check code into somewhere. Currently only SVN
is supported, but other forms should be hard to support.
@@ -123,18 +111,17 @@ def __unicode__(self):
return self.project.name
def updated(self):
- commits = Changeset.objects.filter(repository=self.id)[0]
+ commits = CodeCommit.objects.filter(repository=self.id)[0]
last_commit = commits.committed
return last_commit
-class Changeset(models.Model):
+class CodeCommit(models.Model):
"""
A code change that's been checked in.
"""
- repository = models.ForeignKey(Repository, related_name='commits')
- committer = models.ForeignKey(Committer, related_name='committer')
+ repository = models.ForeignKey(CodeRepository, related_name='commits')
revision = models.PositiveSmallIntegerField()
message = models.TextField()
committed = models.DateTimeField()
@@ -150,35 +137,12 @@ def __unicode__(self):
def url(self):
if self.repository.public_changeset_template:
return self.repository.public_changeset_template % self.revision
- else:
- return ''
-
-
-class Change(models.Model):
- """
- A ``Change`` is a subset of a ``Changeset`` that displays more information
- about the instance including files that were added, deleted or modified as
- well as the changes within files that were modified.
- """
-
- ADD = 1
- MODIFY = 2
- DELETE = 3
- TYPE_CHOICES = (
- (ADD, 'Add'),
- (MODIFY, 'Modify'),
- (DELETE, 'Delete'),
- )
-
- changeset = models.ForeignKey(Changeset, related_name='change')
- type = models.PositiveSmallIntegerField(choices=TYPE_CHOICES)
- path = models.TextField()
- diff = models.TextField()
+ return ''
# Initilization
-import register
+from projects import register
del register
# Register item objects to be "followed"
-#Item.objects.follow_model(Changeset)
+Item.objects.follow_model(Changeset)
@@ -4,7 +4,7 @@
from django.views.generic.simple import direct_to_template, redirect_to
from django.contrib.syndication.views import feed
-from models import Project, Repository, Changeset, Developer
+from models import Project, CodeRepository, CodeCommit, Developer
from feeds import LatestProjects, LatestCommits#, LatestCommitsByProject
# Feeds
@@ -36,12 +36,12 @@
}
repository_list = {
- 'queryset': Repository.objects.all(),
+ 'queryset': CodeRepository.objects.all(),
'template_object_name': 'repository',
}
commit_list = {
- 'queryset': Changeset.objects.all(),
+ 'queryset': CodeCommit.objects.all(),
'template_object_name': 'commit',
'paginate_by': 50,
}
View
@@ -33,6 +33,7 @@ <h1><a href="http://network.sidebarcreative.com/">Sidebar Network</a></h1>
<li><a href="http://getsnitter.com/">Snitter</a></li>
<li><a href="http://overheard.it/">Overheard.it</a></li>
<li id="network-current"><a href="http://djangoplugables.com/">Django Plugables</a></li>
+ <li><a href="http://inthesidebar.com/">SidebarAds</a></li>
</ul>
</div><!-- end #network-nav -->
<div id="header" class="container_16 clearfix">
@@ -23,7 +23,7 @@ <h4 class="grid_3 alpha">{{ commit.grouper }}</h4>
</li>
{% endfor %}
</ul>
- <span class="clear">HOLY SHIT! IT'S EXTRA UNNECESSARY CLEARING MARKUP!</span>
+ <span class="clear">&nbsp;</span>
</div>
{% endblock %}
{% block sidebar %}
@@ -32,7 +32,7 @@ <h3>Filter!</h3>
<p>If you're feeling lazy. You can use this <strong>uber gigantic</strong> text field below to filter the repositories. <strong>Although, typing "django-" won't help you all that much.</strong></p>
<label for="phrase"></label><input type="text" name="phrase" value="" id="phrase" />
</div>
- <span class="clear">HOLY SHIT! IT'S EXTRA UNNECESSARY CLEARING MARKUP!</span>
+ <span class="clear">&nbsp;</span>
<table>
<thead>
<tr><th>Project Name</th><th>Repository URL</th><th>Last Updated</th></tr>
@@ -28,7 +28,7 @@ <h4><a href="{{ project.get_absolute_url }}">{{ project.name }}</a></h4>
{% endfor %}
</ul>
{% endif %}
- <span class="clear">HOLY SHIT! IT'S EXTRA UNNECESSARY CLEARING MARKUP!</span>
+ <span class="clear">&nbsp;</span>
{% if developer.members.all %}
<h3>{{ developer.first_name }} is a member of...</h3>
<ul class="grid_9">
@@ -19,7 +19,7 @@ <h3>The Basics</h3>
<strong>Grab the Repository</strong> &ndash; {% for repository in project.repository.all %}svn checkout {{ repository.url }}{% endfor %}
</div>
{% endif %}
- <span class="clear">HOLY SHIT! IT'S EXTRA UNNECESSARY CLEARING MARKUP!</span>
+ <span class="clear">&nbsp;</span>
<h3>Recent Commits</h3>
{% for repository in project.repository.all %}
{% ifequal repository.type "svn" %}

0 comments on commit 43ad076

Please sign in to comment.