Permalink
Browse files

epytext docstring format

  • Loading branch information...
1 parent 2239dda commit 50ed21c1182859e6e1f14d08ab6539aaa9b8fad9 @d1ffuz0r committed Dec 14, 2011
Showing with 97 additions and 0 deletions.
  1. +12 −0 lulz/admin.py
  2. +9 −0 lulz/forms.py
  3. +40 −0 lulz/models.py
  4. +36 −0 lulz/views.py
View
@@ -13,6 +13,12 @@ class AdminJobs(admin.ModelAdmin):
actions = ["publish", "unpublish"]
def publish(self, request, queryset):
+ """
+ Show selected vacancies
+ @param request:
+ @param queryset: Selected vacancy
+ @return:
+ """
public = queryset.update(published=True)
if public == 1:
message_bit = u"1 вакансия была опубликована"
@@ -22,6 +28,12 @@ def publish(self, request, queryset):
publish.short_description = u"Опубликовать выбраные Вакансии"
def unpublish(self, request, queryset):
+ """
+ Hide selected vacancies
+ @param request:
+ @param queryset: Selected vacancy
+ @return:
+ """
ubpub = queryset.update(published=False)
if ubpub == 1:
message_bit = u"1 вакансия был убрана"
View
@@ -4,6 +4,9 @@
class AddJob(forms.ModelForm):
+ """
+ Form for create vacancy
+ """
class Meta:
model = Job
fields = ("name", "desc", "tags", "link", "category")
@@ -19,6 +22,9 @@ class Meta:
class AddComment(forms.ModelForm):
+ """
+ Form to add a comment for of vacancy
+ """
class Meta:
model = Comments
fields = ("text", "job")
@@ -29,6 +35,9 @@ class Meta:
class SearchForm(forms.Form):
+ """
+ Search form
+ """
query = forms.CharField(label=u'Ключевое слово')
cat = forms.IntegerField(
label=u'Категория',
View
@@ -3,6 +3,12 @@
class Image(models.Model):
+ """
+ Image model
+
+ @param name: str
+ @param image: file object
+ """
name = models.CharField(max_length=100,
verbose_name=u"Название")
image = models.ImageField(upload_to="backgrounds",
@@ -17,6 +23,12 @@ def __unicode__(self):
class Category(models.Model):
+ """
+ Category
+
+ @param name: str
+ @param image: file object
+ """
name = models.CharField(max_length=100,
blank=False,
verbose_name=u"Название")
@@ -33,6 +45,19 @@ def __unicode__(self):
class Job(models.Model):
+ """
+ Job model
+
+ @param name: str
+ @param desc: str
+ @param tags: str
+ @param likes: int
+ @param link: url
+ @param published: boolean
+ @param date: datetime
+ @param category: foreignkey Category
+ @param comments: ManyToManyField Comments
+ """
name = models.CharField(max_length=100,
verbose_name=u"Заголовок")
desc = models.TextField(max_length=1000,
@@ -62,6 +87,14 @@ def __unicode__(self):
class Comments(models.Model):
+ """
+ Comments model
+
+ @param text: str
+ @param job: foreignkey Job
+ @param agent: str
+ @param ip: str
+ """
text = models.CharField(max_length=200,
verbose_name=u"Текст комментария")
job = models.ForeignKey(Job,
@@ -79,6 +112,13 @@ def __unicode__(self):
class Likes(models.Model):
+ """
+ Likes model
+
+ @param job: foreignkey Job
+ @param agent: str
+ @param ip: str
+ """
CHOISES = (
("1", "+"),
("0", "-")
View
@@ -13,6 +13,12 @@
@render_to("jobs.html")
def home(request):
+ """
+ Home page
+
+ @param request:
+ @return json:
+ """
count = Job.objects.filter(published=True).count()
jobs = Job.objects.filter(published=True).order_by("-id").all()
categories = Category.objects.all()
@@ -27,6 +33,12 @@ def home(request):
@render_json
def fetch(request):
+ """
+ Fetch vacanciec with catecory
+
+ @param request:
+ @return json:
+ """
result = {"success": False, "jobs": []}
if request.POST and request.POST["cat"]:
@@ -57,6 +69,12 @@ def fetch(request):
@render_json
def addvacancy(request):
+ """
+ Add vacancy
+
+ @param request:
+ @return json:
+ """
result = {"success": False}
if request.POST:
form = AddJob(request.POST)
@@ -75,6 +93,12 @@ def addvacancy(request):
@render_json
def addcomment(request):
+ """
+ Create comment for vacancy
+
+ @param request:
+ @return json:
+ """
result = {"success": False}
if request.POST:
form = AddComment(request.POST)
@@ -97,6 +121,12 @@ def addcomment(request):
@render_json
def full(request):
+ """
+ Get full description for vacancy
+
+ @param request:
+ @return json:
+ """
result = {"success": False}
if request.POST:
job = Job.objects.filter(published=True).\
@@ -127,6 +157,12 @@ def full(request):
@render_json
def like(request):
+ """
+ Like or Dislike vacancy
+
+ @param request:
+ @return json:
+ """
result = {"success": False}
if request.POST:

0 comments on commit 50ed21c

Please sign in to comment.