~widelands-dev/widelands-website/trunk

« back to all changes in this revision

Viewing changes to wlprofile/models.py

  • Committer: Holger Rapp
  • Date: 2011-08-24 13:09:49 UTC
  • mto: This revision was merged to the branch mainline in revision 249.
  • Revision ID: sirver@gmx.de-20110824130949-vv0yn4nq3hogq10i
Model.save() should always take args and kwargs and pass them one. Whitespace fixes. Removed dependency on Site being configured on initial run of syncdb

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
    def post_count(self):
54
54
        """
55
55
        Return the nr of posts the user has. This uses djangos filter feature
56
 
        will therefore hit the database. This should maybe be reworked when the
 
56
        will therefore hit the database. This should maybe be reworked when the 
57
57
        database grows to not be always calculated.
58
58
        """
59
59
        return Post.objects.filter(user=self.user).count()
60
 
 
 
60
  
61
61
    def user_status(self):
62
62
        nump = self.post_count()
63
 
 
 
63
       
64
64
        if nump < 6:
65
65
            return { "text":"Just found this site", "image":"rang_1.png" }
66
66
        elif nump < 50: