From oi-commits at pardus.org.tr Tue Jul 1 16:50:44 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 1 Jul 2008 16:50:44 +0300 (EEST) Subject: [Oi-commits] r1510 - in trunk: forum poll templates/forum Message-ID: <20080701135044.760C11384110@liste.pardus.org.tr> Author: jnmbk Date: Tue Jul 1 16:50:44 2008 New Revision: 1510 Modified: trunk/forum/forms.py trunk/forum/views.py trunk/poll/models.py trunk/templates/forum/forum_list.html Log: latest polls Modified: trunk/forum/forms.py ================================================================= --- trunk/forum/forms.py (original) +++ trunk/forum/forms.py Tue Jul 1 16:50:44 2008 @@ -71,6 +71,7 @@ class Meta: model = Poll + exclude = ("created") def clean_end_date(self): field_data = self.cleaned_data['end_date'] Modified: trunk/forum/views.py ================================================================= --- trunk/forum/views.py (original) +++ trunk/forum/views.py Tue Jul 1 16:50:44 2008 @@ -58,6 +58,12 @@ except AttributeError, ObjectDoesNotExist: forum.is_read = True + # latest topics with polls + latest_topics_with_polls = [] + for poll in Poll.objects.order_by("-created")[:5]: + if poll.topic_set.count() >= 1: + latest_topics_with_polls.append(poll.topic_set.all()[0]) + usercount = User.objects.count() currentdate = datetime.now() latest_posts = Post.objects.filter(hidden=False).order_by("-created")[:5] Modified: trunk/poll/models.py ================================================================= --- trunk/poll/models.py (original) +++ trunk/poll/models.py Tue Jul 1 16:50:44 2008 @@ -54,6 +54,7 @@ allow_multiple_choices = models.BooleanField("?ok Se?meli Oylama", default=False, blank=True, help_text="Bir ki?inin birden fazla se?enekte oy kullanabilmesini isiyorsan?z bunu se?in. Uyar?: Bu ayar? sonradan de?i?tiremezsiniz.") date_limit = models.BooleanField("S?reli", help_text="Oylamada s?re s?n?r? olmas?n? istiyorsan?z bunu i?aretleyin.") end_date = models.DateTimeField("Biti? Tarihi", blank=True, null=True, help_text="Oylaman?n ne zaman bitece?ini belirleyin. 30/8/2008 gibi.") + created = models.DateTimeField(blank=True, null=True, auto_now_add=True, verbose_name='Olu?turulma tarihi') def __unicode__(self): if len(self.question) > 32: @@ -62,7 +63,7 @@ return self.question class Admin: - list_display = ("question", "allow_changing_vote", "date_limit", "end_date") + list_display = ("question", "allow_changing_vote", "date_limit", "end_date", "created") search_fields = ["question"] class Meta: Modified: trunk/templates/forum/forum_list.html ================================================================= --- trunk/templates/forum/forum_list.html (original) +++ trunk/templates/forum/forum_list.html Tue Jul 1 16:50:44 2008 @@ -48,6 +48,16 @@ {% endfor %} +
Son Anketler
+
+ {% for topic in latest_topics_with_polls %} +
+
[ {{ topic.forum }} ]
+
{{ topic }} iletiye git {{ topic.topic_latest_post.author }}
+ +
+ {% endfor %} +
?statistikler
From oi-commits at pardus.org.tr Tue Jul 1 17:10:07 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 1 Jul 2008 17:10:07 +0300 (EEST) Subject: [Oi-commits] r1511 - in branches/stable: forum poll templates/forum Message-ID: <20080701141007.4076C13841C2@liste.pardus.org.tr> Author: jnmbk Date: Tue Jul 1 17:10:06 2008 New Revision: 1511 Modified: branches/stable/forum/forms.py branches/stable/forum/views.py branches/stable/poll/models.py branches/stable/templates/forum/forum_list.html Log: merge Modified: branches/stable/forum/forms.py ================================================================= --- branches/stable/forum/forms.py (original) +++ branches/stable/forum/forms.py Tue Jul 1 17:10:06 2008 @@ -71,6 +71,7 @@ class Meta: model = Poll + exclude = ("created") def clean_end_date(self): field_data = self.cleaned_data['end_date'] Modified: branches/stable/forum/views.py ================================================================= --- branches/stable/forum/views.py (original) +++ branches/stable/forum/views.py Tue Jul 1 17:10:06 2008 @@ -58,6 +58,12 @@ except AttributeError, ObjectDoesNotExist: forum.is_read = True + # latest topics with polls + latest_topics_with_polls = [] + for poll in Poll.objects.order_by("-created")[:5]: + if poll.topic_set.count() >= 1: + latest_topics_with_polls.append(poll.topic_set.all()[0]) + usercount = User.objects.count() currentdate = datetime.now() latest_posts = Post.objects.filter(hidden=False).order_by("-created")[:5] Modified: branches/stable/poll/models.py ================================================================= --- branches/stable/poll/models.py (original) +++ branches/stable/poll/models.py Tue Jul 1 17:10:06 2008 @@ -54,6 +54,7 @@ allow_multiple_choices = models.BooleanField("?ok Se?meli Oylama", default=False, blank=True, help_text="Bir ki?inin birden fazla se?enekte oy kullanabilmesini isiyorsan?z bunu se?in. Uyar?: Bu ayar? sonradan de?i?tiremezsiniz.") date_limit = models.BooleanField("S?reli", help_text="Oylamada s?re s?n?r? olmas?n? istiyorsan?z bunu i?aretleyin.") end_date = models.DateTimeField("Biti? Tarihi", blank=True, null=True, help_text="Oylaman?n ne zaman bitece?ini belirleyin. 30/8/2008 gibi.") + created = models.DateTimeField(blank=True, null=True, auto_now_add=True, verbose_name='Olu?turulma tarihi') def __unicode__(self): if len(self.question) > 32: @@ -62,7 +63,7 @@ return self.question class Admin: - list_display = ("question", "allow_changing_vote", "date_limit", "end_date") + list_display = ("question", "allow_changing_vote", "date_limit", "end_date", "created") search_fields = ["question"] class Meta: Modified: branches/stable/templates/forum/forum_list.html ================================================================= --- branches/stable/templates/forum/forum_list.html (original) +++ branches/stable/templates/forum/forum_list.html Tue Jul 1 17:10:06 2008 @@ -48,6 +48,16 @@
{% endfor %}
+
Son Anketler
+
+ {% for topic in latest_topics_with_polls %} +
+
[ {{ topic.forum }} ]
+
{{ topic }} iletiye git {{ topic.topic_latest_post.author }}
+ +
+ {% endfor %} +
?statistikler
From oi-commits at pardus.org.tr Thu Jul 3 19:13:15 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 3 Jul 2008 19:13:15 +0300 (EEST) Subject: [Oi-commits] r1512 - trunk/st Message-ID: <20080703161315.B824F1384165@liste.pardus.org.tr> Author: jnmbk Date: Thu Jul 3 19:13:15 2008 New Revision: 1512 Modified: trunk/st/views.py Log: don't allow commenting to locked topics Modified: trunk/st/views.py ================================================================= --- trunk/st/views.py (original) +++ trunk/st/views.py Thu Jul 3 19:13:15 2008 @@ -208,6 +208,10 @@ tags = news.tags.all() return render_response(request,'news/news_detail.html',{'news':news,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -250,6 +254,10 @@ tags = howto.tags.all() return render_response(request,'howto/howto_detail.html',{'howto':howto,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -291,6 +299,10 @@ tags = game.tags.all() return render_response(request,'game/game_detail.html',{'game':game,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -332,6 +344,10 @@ tags = package.tags.all() return render_response(request,'package/package_detail.html',{'package':package,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -351,4 +367,3 @@ return render_response(request,'package/package_detail.html',{'package':package,'tags':tags,'form':form,'auth':True}) #do something here - From oi-commits at pardus.org.tr Thu Jul 3 19:21:27 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 3 Jul 2008 19:21:27 +0300 (EEST) Subject: [Oi-commits] r1513 - branches/stable/st Message-ID: <20080703162127.97C851384165@liste.pardus.org.tr> Author: jnmbk Date: Thu Jul 3 19:21:27 2008 New Revision: 1513 Modified: branches/stable/st/views.py Log: merge Modified: branches/stable/st/views.py ================================================================= --- branches/stable/st/views.py (original) +++ branches/stable/st/views.py Thu Jul 3 19:21:27 2008 @@ -208,6 +208,10 @@ tags = news.tags.all() return render_response(request,'news/news_detail.html',{'news':news,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -250,6 +254,10 @@ tags = howto.tags.all() return render_response(request,'howto/howto_detail.html',{'howto':howto,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -291,6 +299,10 @@ tags = game.tags.all() return render_response(request,'game/game_detail.html',{'game':game,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -332,6 +344,10 @@ tags = package.tags.all() return render_response(request,'package/package_detail.html',{'package':package,'tags':tags,'form':form,'auth':True}) + if t[0].locked: + errorMessage = 'Konu kilitli oldu?u i?in yorum g?nderemezsiniz.' + return render_response(request, 'forum/forum_error.html', {'message': errorMessage}) + post = Post(topic=t[0], author=request.user, text=form.cleaned_data['yorum']) @@ -351,4 +367,3 @@ return render_response(request,'package/package_detail.html',{'package':package,'tags':tags,'form':form,'auth':True}) #do something here - From oi-commits at pardus.org.tr Thu Jul 3 20:13:07 2008 From: oi-commits at pardus.org.tr (VIAGRA ® Official Site) Date: Thu, 3 Jul 2008 20:13:07 +0300 (EEST) Subject: [Oi-commits] Dear oi-commits@pardus.org.tr SALE 86% 0FF on Pfizer Message-ID: <20080703-41308.8467.qmail@boblaptop> An HTML attachment was scrubbed... URL: http://liste.pardus.org.tr/oi-commits/attachments/20080703/b5681da0/attachment-0001.htm From ahmet at pardusman.org Fri Jul 4 00:21:31 2008 From: ahmet at pardusman.org (Ahmet =?utf-8?q?AYG=C3=9CN?=) Date: Fri, 4 Jul 2008 00:21:31 +0300 Subject: [Oi-commits] r1512 - trunk/st In-Reply-To: <20080703161315.B824F1384165@liste.pardus.org.tr> References: <20080703161315.B824F1384165@liste.pardus.org.tr> Message-ID: <200807040021.34376.ahmet@pardusman.org> On Thursday 03 July 2008 19:13:15 oi-commits at pardus.org.tr wrote: > Author: jnmbk > Date: Thu Jul 3 19:13:15 2008 > New Revision: 1512 > > Modified: > trunk/st/views.py > Log: > don't allow commenting to locked topics Kodun bu k?sm?n? ilk defa g?r?yorum, bir ?ey fark ettim. Neden her i?erik s?n?f?m?z i?in ayr? bir yorum i?levimiz var? Daha genel bir i?levde toplayamaz m?y?z? Yeni bir oi kurulumunda forumda bir konu a?arken "poll_id can't be null" deyo ve OperationalError exception veriyor. Ve neden tek bir Topic ?zerinde i?lem yaparken t gibi garip bir dizimiz var? TypeError exception vermiyor mu? get_object_or_404 i?levi son bakt???mda tek nesne d?n?yordu :-S -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. Url : http://liste.pardus.org.tr/oi-commits/attachments/20080704/a19a0ef9/attachment.pgp From ugur.jnmbk at gmail.com Fri Jul 4 07:14:07 2008 From: ugur.jnmbk at gmail.com (=?UTF-8?Q?U=C4=9Fur_=C3=87etin?=) Date: Fri, 4 Jul 2008 07:14:07 +0300 Subject: [Oi-commits] r1512 - trunk/st In-Reply-To: <200807040021.34376.ahmet@pardusman.org> References: <20080703161315.B824F1384165@liste.pardus.org.tr> <200807040021.34376.ahmet@pardusman.org> Message-ID: <9dca79e40807032114s2c683253j682b73f00c268cef@mail.gmail.com> 04.07.2008 tarihinde Ahmet AYG?N yazm??: > Kodun bu k?sm?n? ilk defa g?r?yorum, bir ?ey fark ettim. Neden her i?erik > s?n?f?m?z i?in ayr? bir yorum i?levimiz var? Daha genel bir i?levde > toplayamaz m?y?z? Toplar?z > Yeni bir oi kurulumunda forumda bir konu a?arken "poll_id can't be null" deyo > ve OperationalError exception veriyor. > Verdirtmeyiz > Ve neden tek bir Topic ?zerinde i?lem yaparken t gibi garip bir dizimiz var? > TypeError exception vermiyor mu? get_object_or_404 i?levi son bakt???mda tek > nesne d?n?yordu :-S D?zeltiriz :D -- U?ur ?etin From akin at omeroglu.net Fri Jul 4 09:35:22 2008 From: akin at omeroglu.net (=?utf-8?q?Ak=C4=B1n_=C3=96mero=C4=9Flu?=) Date: Fri, 4 Jul 2008 09:35:22 +0300 Subject: [Oi-commits] r1512 - trunk/st In-Reply-To: <9dca79e40807032114s2c683253j682b73f00c268cef@mail.gmail.com> References: <20080703161315.B824F1384165@liste.pardus.org.tr> <200807040021.34376.ahmet@pardusman.org> <9dca79e40807032114s2c683253j682b73f00c268cef@mail.gmail.com> Message-ID: <200807040935.22732.akin@omeroglu.net> Friday 04 July 2008 Tarihinde 07:14:07 yazm??t?: > 04.07.2008 tarihinde Ahmet AYG?N yazm??: > > Kodun bu k?sm?n? ilk defa g?r?yorum, bir ?ey fark ettim. Neden her i?erik > > s?n?f?m?z i?in ayr? bir yorum i?levimiz var? Daha genel bir i?levde > > toplayamaz m?y?z? > > Toplar?z > > > Yeni bir oi kurulumunda forumda bir konu a?arken "poll_id can't be null" > > deyo ve OperationalError exception veriyor. > > Verdirtmeyiz > > > Ve neden tek bir Topic ?zerinde i?lem yaparken t gibi garip bir dizimiz > > var? TypeError exception vermiyor mu? get_object_or_404 i?levi son > > bakt???mda tek nesne d?n?yordu :-S > > D?zeltiriz > > :D ahahahhaha bu adamdan iyi siyaset?i olur -- Ak?n ?mero?lu www.ozgurlukicin.com From ahmet at pardusman.org Fri Jul 4 14:41:27 2008 From: ahmet at pardusman.org (Ahmet =?utf-8?q?AYG=C3=9CN?=) Date: Fri, 4 Jul 2008 14:41:27 +0300 Subject: [Oi-commits] r1512 - trunk/st In-Reply-To: <200807040935.22732.akin@omeroglu.net> References: <20080703161315.B824F1384165@liste.pardus.org.tr> <9dca79e40807032114s2c683253j682b73f00c268cef@mail.gmail.com> <200807040935.22732.akin@omeroglu.net> Message-ID: <200807041441.30204.ahmet@pardusman.org> On Friday 04 July 2008 09:35:22 Ak?n ?mero?lu wrote: > ahahahhaha bu adamdan iyi siyaset?i olur Benim kod?r?m i?ini bilir ? -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part. Url : http://liste.pardus.org.tr/oi-commits/attachments/20080704/46c417a3/attachment.pgp From oi-commits at pardus.org.tr Tue Jul 8 18:07:12 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 8 Jul 2008 18:07:12 +0300 (EEST) Subject: [Oi-commits] r1514 - trunk/media/dosya Message-ID: <20080708150712.2DFA613840F5@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 8 18:07:11 2008 New Revision: 1514 Added: trunk/media/dosya/ Log: add required directory From oi-commits at pardus.org.tr Fri Jul 11 17:55:20 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Fri, 11 Jul 2008 17:55:20 +0300 (EEST) Subject: [Oi-commits] r1515 - in trunk: . shop shop/templates Message-ID: <20080711145520.774551384180@liste.pardus.org.tr> Author: erenturkay Date: Fri Jul 11 17:55:20 2008 New Revision: 1515 Added: trunk/shop/ trunk/shop/__init__.py trunk/shop/models.py trunk/shop/templates/ Modified: trunk/urls.py Log: nevermind, add initial shop model, nothing have been achieved :( Modified: trunk/urls.py ================================================================= --- trunk/urls.py (original) +++ trunk/urls.py Fri Jul 11 17:55:20 2008 @@ -151,6 +151,9 @@ #Tema (r'^tema/', include('oi.tema.urls')), + # Shop + (r'^shop/', include('oi.shop.urls')), + #Petition (r'^petition/', include('oi.petition.urls')), (r'^ooxml/', 'oi.petition.views.petition_sign'), From oi-commits at pardus.org.tr Fri Jul 11 20:24:52 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Fri, 11 Jul 2008 20:24:52 +0300 (EEST) Subject: [Oi-commits] r1516 - trunk/shop Message-ID: <20080711172452.765F0247400A@liste.pardus.org.tr> Author: erenturkay Date: Fri Jul 11 20:24:51 2008 New Revision: 1516 Modified: trunk/shop/models.py Log: make tax number 15 char Modified: trunk/shop/models.py ================================================================= --- trunk/shop/models.py (original) +++ trunk/shop/models.py Fri Jul 11 20:24:51 2008 @@ -34,6 +34,5 @@ company_adress = models.TextField('?irket Adresi', blank=True) # user's title in company employee_title = models.CharField('?nvan', max_lenght=20, blank=True, help_text='?irket i?erisindeki ?nvan?n?z.') - # FIXME: Is taxnumber always 10 character? - tax_number = models.IntegerField('Vergi numaras?', max_lenght=10, blank=True) + tax_number = models.IntegerField('Vergi numaras?', max_lenght=15, blank=True) tax_department = models.CharField('Vergi dairesi ad?', max_lenght=200, blank=True, help_text='?stanbul Bak?rk?y Vergi Dairesi gibi.') From oi-commits at pardus.org.tr Sat Jul 12 00:16:39 2008 From: oi-commits at pardus.org.tr (VIAGRA ® Official Shop) Date: Sat, 12 Jul 2008 00:16:39 +0300 (EEST) Subject: [Oi-commits] If you ever wonderedhow porn starts can act so long. , oi-commits@pardus.org.tr Message-ID: <20080712074643.9347.qmail@hcl> An HTML attachment was scrubbed... URL: http://liste.pardus.org.tr/oi-commits/attachments/20080712/0730d3b9/attachment.htm From oi-commits at pardus.org.tr Sat Jul 12 10:49:26 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 12 Jul 2008 10:49:26 +0300 (EEST) Subject: [Oi-commits] r1517 - trunk/shop/shopprofile Message-ID: <20080712074927.07BDD1384172@liste.pardus.org.tr> Author: erenturkay Date: Sat Jul 12 10:49:26 2008 New Revision: 1517 Added: trunk/shop/shopprofile/ trunk/shop/shopprofile/__init__.py trunk/shop/shopprofile/models.py Log: move profile information into shopprofile From oi-commits at pardus.org.tr Sat Jul 12 11:36:41 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 12 Jul 2008 11:36:41 +0300 (EEST) Subject: [Oi-commits] r1518 - trunk/shop/shopprofile Message-ID: <20080712083641.9CAFE1384176@liste.pardus.org.tr> Author: erenturkay Date: Sat Jul 12 11:36:41 2008 New Revision: 1518 Modified: trunk/shop/shopprofile/models.py Log: * add have_company_information() shortcut. * fix max_length typo Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Sat Jul 12 11:36:41 2008 @@ -11,22 +11,34 @@ class ShopProfile(models.Model): user = models.ForeignKey(User, unique=True) - # max_lenght 18 because we want users to write "+90 0212 123 45 67" - phone = models.CharField('Telefon', max_lenght=18, help_text='Telefon numaras?. +90 ?eklinde belirtin. ?rne?in; +90 0212 123 45 67') - cellphone = models.CharField('Cep Telefonu', max_lenght=18, blank=True, help_text='Cep telefonu. +90 ?eklinde belirtin. ?rne?in; +90 512 345 67 89. (zorunlu de?il)') + # max_length 18 because we want users to write "+90 0212 123 45 67" + phone = models.CharField('Telefon', max_length=18, help_text='Telefon numaras?. +90 ?eklinde belirtin. ?rne?in; +90 0212 123 45 67') + cellphone = models.CharField('Cep Telefonu', max_length=18, blank=True, help_text='Cep telefonu. +90 ?eklinde belirtin. ?rne?in; +90 512 345 67 89. (zorunlu de?il)') adress = models.TextField('Adres', help_text='?kamet etti?iniz yer') - second_adress = models.TextField('?kinci Adres', help_text='Size ula?abilece?imiz 2. bir adres (zorunlu de?il') - postcode = models.IntegerField('Posta Kodu', max_lenght=7) + second_adress = models.TextField('?kinci Adres', blank=True, help_text='Size ula?abilece?imiz 2. bir adres (zorunlu de?il') + postcode = models.IntegerField('Posta Kodu', max_length=7) - bill = models.ForeignKey(Bill) + bill = models.ForeignKey('Bill') def __unicode__(self): return u'%s' % self.user.username + def have_company_information(self): + """ Checks if the user has company information """ + if self.bill.company_name and self.bill.tax_number: + return True + else: + return False + + #FIXME: Add some useful methods for getting user's ordered products + class Meta: verbose_name = 'Al??veri? Profili' verbose_name_plural = 'Al??veri? Profilleri' - ordering = ('user, + ordering = ('user',) + + class Admin: + list_display = ('user', 'phone', 'adress',) # Bill Class @@ -41,11 +53,17 @@ company_name = models.CharField('?irket Ad?', max_length=200, blank=True) company_adress = models.TextField('?irket Adresi', blank=True) # user's title in company - employee_title = models.CharField('?nvan', max_lenght=20, blank=True, help_text='?irket i?erisindeki ?nvan?n?z.') - tax_number = models.IntegerField('Vergi numaras?', max_lenght=15, blank=True) - tax_department = models.CharField('Vergi dairesi ad?', max_lenght=200, blank=True, help_text='?stanbul Bak?rk?y Vergi Dairesi gibi.') + employee_title = models.CharField('?nvan', max_length=20, blank=True, help_text='?irket i?erisindeki ?nvan?n?z.') + tax_number = models.IntegerField('Vergi numaras?', max_length=15, blank=True, default=0) + tax_department = models.CharField('Vergi dairesi ad?', max_length=200, blank=True, help_text='?stanbul Bak?rk?y Vergi Dairesi gibi.') def __unicode__(self): if self.adress: return u'%s' % self.adress + class Meta: + verbose_name = 'Fatura Bilgisi' + verbose_name_plural = 'Fatura Bilgileri' + + class Admin: + list_display = ('adress',) From oi-commits at pardus.org.tr Sat Jul 12 11:50:23 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 12 Jul 2008 11:50:23 +0300 (EEST) Subject: [Oi-commits] r1519 - trunk/shop/shopprofile Message-ID: <20080712085023.320D81384173@liste.pardus.org.tr> Author: erenturkay Date: Sat Jul 12 11:50:22 2008 New Revision: 1519 Modified: trunk/shop/shopprofile/models.py Log: * move have_company_information() into Bill class, that's the right way Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Sat Jul 12 11:50:22 2008 @@ -23,13 +23,6 @@ def __unicode__(self): return u'%s' % self.user.username - def have_company_information(self): - """ Checks if the user has company information """ - if self.bill.company_name and self.bill.tax_number: - return True - else: - return False - #FIXME: Add some useful methods for getting user's ordered products class Meta: @@ -61,6 +54,13 @@ if self.adress: return u'%s' % self.adress + def have_company_information(self): + """ Checks if the user has company information """ + if self.bill.company_name and self.bill.tax_number: + return True + else: + return False + class Meta: verbose_name = 'Fatura Bilgisi' verbose_name_plural = 'Fatura Bilgileri' From oi-commits at pardus.org.tr Sat Jul 12 12:51:45 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 12 Jul 2008 12:51:45 +0300 (EEST) Subject: [Oi-commits] r1520 - trunk/profile Message-ID: <20080712095146.0AAF51384176@liste.pardus.org.tr> Author: erenturkay Date: Sat Jul 12 12:51:45 2008 New Revision: 1520 Modified: trunk/profile/models.py Log: * fix admin page showing user profile Modified: trunk/profile/models.py ================================================================= --- trunk/profile/models.py (original) +++ trunk/profile/models.py Sat Jul 12 12:51:45 2008 @@ -95,7 +95,7 @@ class Admin: fields = ( - ('?yelik Bilgileri', {'fields': ('user', 'avatar', 'homepage', 'msn', 'city', 'birthday', 'contributes', 'contributes_summary', 'show_email', 'latitude', 'longitude',)}), + ('?yelik Bilgileri', {'fields': ('user', 'avatar', 'homepage', 'msn', 'jabber', 'icq', 'city', 'birthday', 'contributes', 'contributes_summary', 'show_email', 'latitude', 'longitude',)}), ('Di?er', {'fields': ('activation_key', 'key_expires', 'signature'), 'classes': 'collapse',}), ) From oi-commits at pardus.org.tr Sat Jul 12 15:16:54 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 12 Jul 2008 15:16:54 +0300 (EEST) Subject: [Oi-commits] r1521 - trunk/shop/shopprofile Message-ID: <20080712121654.42E8E1384171@liste.pardus.org.tr> Author: erenturkay Date: Sat Jul 12 15:16:53 2008 New Revision: 1521 Modified: trunk/shop/shopprofile/models.py Log: see extra information on admin page Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Sat Jul 12 15:16:53 2008 @@ -66,4 +66,14 @@ verbose_name_plural = 'Fatura Bilgileri' class Admin: - list_display = ('adress',) + list_display = ('shop_profile', 'adress', 'company_name', 'tax_number',) + search_fields = ['adress'] + + def shop_profile(self): + qs = ShopProfile.objects.filter(bill=self) + print "BILL:", qs + if qs.count() >= 1: + return qs[0] + else: + return None + shop_profile.short_description = 'Profil' From oi-commits at pardus.org.tr Sat Jul 12 19:53:09 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Sat, 12 Jul 2008 19:53:09 +0300 (EEST) Subject: [Oi-commits] r1522 - in trunk: . shop/shopprofile Message-ID: <20080712165309.CC75313841B4@liste.pardus.org.tr> Author: erenturkay Date: Sat Jul 12 19:53:08 2008 New Revision: 1522 Modified: trunk/shop/shopprofile/models.py trunk/urls.py Log: use OneToOneField and add url for dukkan/ Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Sat Jul 12 19:53:08 2008 @@ -18,7 +18,7 @@ second_adress = models.TextField('?kinci Adres', blank=True, help_text='Size ula?abilece?imiz 2. bir adres (zorunlu de?il') postcode = models.IntegerField('Posta Kodu', max_length=7) - bill = models.ForeignKey('Bill') + bill = models.OneToOneField('Bill') def __unicode__(self): return u'%s' % self.user.username @@ -71,7 +71,6 @@ def shop_profile(self): qs = ShopProfile.objects.filter(bill=self) - print "BILL:", qs if qs.count() >= 1: return qs[0] else: Modified: trunk/urls.py ================================================================= --- trunk/urls.py (original) +++ trunk/urls.py Sat Jul 12 19:53:08 2008 @@ -152,7 +152,7 @@ (r'^tema/', include('oi.tema.urls')), # Shop - (r'^shop/', include('oi.shop.urls')), + (r'^dukkan/', include('oi.shop.urls')), #Petition (r'^petition/', include('oi.petition.urls')), From oi-commits at pardus.org.tr Mon Jul 14 10:30:08 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 10:30:08 +0300 (EEST) Subject: [Oi-commits] r1523 - trunk/shop/shopprofile Message-ID: <20080714073008.95A9413841BE@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 10:30:08 2008 New Revision: 1523 Modified: trunk/shop/shopprofile/models.py Log: use OneToOneField instead of ForeignKey as a user can only have 1 shop profile Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Mon Jul 14 10:30:08 2008 @@ -10,7 +10,7 @@ from django.contrib.auth.models import User class ShopProfile(models.Model): - user = models.ForeignKey(User, unique=True) + user = models.OneToOneField(User, unique=True) # max_length 18 because we want users to write "+90 0212 123 45 67" phone = models.CharField('Telefon', max_length=18, help_text='Telefon numaras?. +90 ?eklinde belirtin. ?rne?in; +90 0212 123 45 67') cellphone = models.CharField('Cep Telefonu', max_length=18, blank=True, help_text='Cep telefonu. +90 ?eklinde belirtin. ?rne?in; +90 512 345 67 89. (zorunlu de?il)') @@ -56,7 +56,7 @@ def have_company_information(self): """ Checks if the user has company information """ - if self.bill.company_name and self.bill.tax_number: + if self.company_name and self.tax_number: return True else: return False From oi-commits at pardus.org.tr Mon Jul 14 12:05:59 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 12:05:59 +0300 (EEST) Subject: [Oi-commits] r1524 - trunk/shop/shopprofile Message-ID: <20080714090559.4848713841BB@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 12:05:59 2008 New Revision: 1524 Modified: trunk/shop/shopprofile/models.py Log: add get_absolute_url method Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Mon Jul 14 12:05:59 2008 @@ -23,6 +23,9 @@ def __unicode__(self): return u'%s' % self.user.username + def get_absolute_url(self): + return '/dukkan/profil/%s/' % self.user.username + #FIXME: Add some useful methods for getting user's ordered products class Meta: From oi-commits at pardus.org.tr Mon Jul 14 12:34:04 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 12:34:04 +0300 (EEST) Subject: [Oi-commits] r1525 - in trunk/shop: . main product Message-ID: <20080714093404.E79F513841BB@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 12:34:04 2008 New Revision: 1525 Added: trunk/shop/main/ trunk/shop/main/__init__.py trunk/shop/main/views.py trunk/shop/product/ trunk/shop/product/__init__.py trunk/shop/product/models.py trunk/shop/urls.py Log: add product and main apps From oi-commits at pardus.org.tr Mon Jul 14 14:16:32 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 14:16:32 +0300 (EEST) Subject: [Oi-commits] r1526 - in trunk/shop: product shopprofile Message-ID: <20080714111632.2689F13841B0@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 14:16:31 2008 New Revision: 1526 Modified: trunk/shop/product/models.py trunk/shop/shopprofile/models.py Log: * use ForeignKey instead of OneToOneField * add children methods for managing childrens and parents Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Mon Jul 14 14:16:31 2008 @@ -16,6 +16,21 @@ parent = models.ForeignKey("self", blank=True, null=True, related_name="child") description = models.TextField("Kategori a??klamas?") + def have_child(self): + if self.child.count() > 0: + return True + else: + return False + + def have_parent(self): + if not self.parent_id: + return False + else: + return True + + def get_separator(self): + return ' :: ' + def _recurse_for_parents(self, cat_obj): p_list = [] if cat_obj.parent_id: @@ -28,9 +43,6 @@ p_list.reverse() return p_list - def get_separator(self): - return ' :: ' - # For displaying object's parents on admin page correctly def _parents_repr(self): name_list = [cat.name for cat in self._recurse_for_parents(self)] @@ -54,6 +66,31 @@ super(Category, self).save() + def _flatten(self, L): + """ + Taken from a python newsgroup post + """ + if type(L) != type([]): return [L] + if L == []: return L + return self._flatten(L[0]) + self._flatten(L[1:]) + + def _recurse_for_children(self, node): + children = [] + children.append(node) + for child in node.child.all(): + if child != self: + children_list = self._recurse_for_children(child) + children.append(children_list) + return children + + def get_all_children(self): + """ + Gets a list of all of the children categories. + """ + children_list = self._recurse_for_children(self) + flat_list = self._flatten(children_list[1:]) + return flat_list + class Meta: ordering = ["name"] verbose_name = "Kategori" Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Mon Jul 14 14:16:31 2008 @@ -10,7 +10,7 @@ from django.contrib.auth.models import User class ShopProfile(models.Model): - user = models.OneToOneField(User, unique=True) + user = models.ForeignKey(User) # max_length 18 because we want users to write "+90 0212 123 45 67" phone = models.CharField('Telefon', max_length=18, help_text='Telefon numaras?. +90 ?eklinde belirtin. ?rne?in; +90 0212 123 45 67') cellphone = models.CharField('Cep Telefonu', max_length=18, blank=True, help_text='Cep telefonu. +90 ?eklinde belirtin. ?rne?in; +90 512 345 67 89. (zorunlu de?il)') From oi-commits at pardus.org.tr Mon Jul 14 16:11:48 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 16:11:48 +0300 (EEST) Subject: [Oi-commits] r1527 - in trunk/shop: product product/templatetags templates Message-ID: <20080714131148.3ABC713841B0@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 16:11:47 2008 New Revision: 1527 Added: trunk/shop/product/templatetags/ trunk/shop/product/templatetags/library.py trunk/shop/templates/shop_base.html trunk/shop/templates/shop_main.html trunk/shop/templates/shop_ust_menu.html Modified: trunk/shop/product/models.py Log: add templatetags, category listing is almost finished but there is no css yet Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Mon Jul 14 16:11:47 2008 @@ -16,6 +16,9 @@ parent = models.ForeignKey("self", blank=True, null=True, related_name="child") description = models.TextField("Kategori a??klamas?") + def get_absolute_url(self): + return u'/dukkan/category/%s/' % self.slug + def have_child(self): if self.child.count() > 0: return True From oi-commits at pardus.org.tr Mon Jul 14 16:14:35 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 16:14:35 +0300 (EEST) Subject: [Oi-commits] r1528 - trunk/shop Message-ID: <20080714131435.81EF513841B0@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 16:14:35 2008 New Revision: 1528 Removed: trunk/shop/models.py Log: remove models.py, this was moved into shopprofile From oi-commits at pardus.org.tr Mon Jul 14 17:06:37 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 17:06:37 +0300 (EEST) Subject: [Oi-commits] r1529 - in trunk/shop: product/templatetags templates Message-ID: <20080714140637.6022C1384091@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 17:06:37 2008 New Revision: 1529 Added: trunk/shop/product/templatetags/__init__.py trunk/shop/product/templatetags/shop_library.py Removed: trunk/shop/product/templatetags/library.py Modified: trunk/shop/templates/shop_base.html Log: * templatetag rename library.py as shop_category.py * we can now create category_tree. HTML part should be reviewed, I suck on HTML, god damn it Modified: trunk/shop/templates/shop_base.html ================================================================= --- trunk/shop/templates/shop_base.html (original) +++ trunk/shop/templates/shop_base.html Mon Jul 14 17:06:37 2008 @@ -1,3 +1,4 @@ +{% load shop_library %} @@ -33,6 +34,7 @@
+ {% category_tree %}
{% block content %} {% endblock %} From oi-commits at pardus.org.tr Mon Jul 14 17:14:04 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 17:14:04 +0300 (EEST) Subject: [Oi-commits] r1530 - trunk Message-ID: <20080714141404.5A6E1138409C@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 17:14:03 2008 New Revision: 1530 Modified: trunk/README Log: we use ElementTree in shop to create menu with
  • Modified: trunk/README ================================================================= --- trunk/README (original) +++ trunk/README Mon Jul 14 17:14:03 2008 @@ -2,6 +2,7 @@ Django environment (Python, Web Server (Apache recommended), mod_python (if Apache preferred), Django*) Python Imaging Library (PIL) BeautifulSoup + ElementTree DBMS (MySQL recommended) Note About Django SVN: From oi-commits at pardus.org.tr Mon Jul 14 17:18:13 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 17:18:13 +0300 (EEST) Subject: [Oi-commits] r1531 - trunk/shop/shopprofile Message-ID: <20080714141813.E0FC4138409C@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 17:18:13 2008 New Revision: 1531 Modified: trunk/shop/shopprofile/models.py Log: * remove postcode field as there are different adresses on Bill model * Simply ask user to state postcode in Adress field. Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Mon Jul 14 17:18:13 2008 @@ -14,9 +14,8 @@ # max_length 18 because we want users to write "+90 0212 123 45 67" phone = models.CharField('Telefon', max_length=18, help_text='Telefon numaras?. +90 ?eklinde belirtin. ?rne?in; +90 0212 123 45 67') cellphone = models.CharField('Cep Telefonu', max_length=18, blank=True, help_text='Cep telefonu. +90 ?eklinde belirtin. ?rne?in; +90 512 345 67 89. (zorunlu de?il)') - adress = models.TextField('Adres', help_text='?kamet etti?iniz yer') + adress = models.TextField('Adres', help_text='?kamet etti?iniz yer (posta kodu ile birlikte)') second_adress = models.TextField('?kinci Adres', blank=True, help_text='Size ula?abilece?imiz 2. bir adres (zorunlu de?il') - postcode = models.IntegerField('Posta Kodu', max_length=7) bill = models.OneToOneField('Bill') @@ -43,11 +42,11 @@ # If we require all fields, then user wanting to select only invidual bill type won't be able to select it. Additionally, user can select both bill type. # Invidual bill type fields - adress = models.TextField('?r?nlerin g?nderilece?i adres', blank=True) + adress = models.TextField('?r?nlerin g?nderilece?i adres.', blank=True, help_text="L?tfen posta kodunu da belirtin.") # Bill type for companies company_name = models.CharField('?irket Ad?', max_length=200, blank=True) - company_adress = models.TextField('?irket Adresi', blank=True) + company_adress = models.TextField('?irket Adresi', blank=True, help_text="L?tfen posta kodunu da belirtin." # user's title in company employee_title = models.CharField('?nvan', max_length=20, blank=True, help_text='?irket i?erisindeki ?nvan?n?z.') tax_number = models.IntegerField('Vergi numaras?', max_length=15, blank=True, default=0) From oi-commits at pardus.org.tr Mon Jul 14 17:56:11 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 17:56:11 +0300 (EEST) Subject: [Oi-commits] r1532 - trunk/shop/shopprofile Message-ID: <20080714145611.E112C1384118@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 17:56:11 2008 New Revision: 1532 Modified: trunk/shop/shopprofile/models.py Log: * use unique=True as a user can only have 1 ShopProfile * fix typo in company_adress Modified: trunk/shop/shopprofile/models.py ================================================================= --- trunk/shop/shopprofile/models.py (original) +++ trunk/shop/shopprofile/models.py Mon Jul 14 17:56:11 2008 @@ -10,7 +10,7 @@ from django.contrib.auth.models import User class ShopProfile(models.Model): - user = models.ForeignKey(User) + user = models.ForeignKey(User, unique=True) # max_length 18 because we want users to write "+90 0212 123 45 67" phone = models.CharField('Telefon', max_length=18, help_text='Telefon numaras?. +90 ?eklinde belirtin. ?rne?in; +90 0212 123 45 67') cellphone = models.CharField('Cep Telefonu', max_length=18, blank=True, help_text='Cep telefonu. +90 ?eklinde belirtin. ?rne?in; +90 512 345 67 89. (zorunlu de?il)') @@ -46,7 +46,7 @@ # Bill type for companies company_name = models.CharField('?irket Ad?', max_length=200, blank=True) - company_adress = models.TextField('?irket Adresi', blank=True, help_text="L?tfen posta kodunu da belirtin." + company_adress = models.TextField('?irket Adresi', blank=True, help_text="L?tfen posta kodunu da belirtin.") # user's title in company employee_title = models.CharField('?nvan', max_length=20, blank=True, help_text='?irket i?erisindeki ?nvan?n?z.') tax_number = models.IntegerField('Vergi numaras?', max_length=15, blank=True, default=0) From oi-commits at pardus.org.tr Mon Jul 14 18:04:12 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 18:04:12 +0300 (EEST) Subject: [Oi-commits] r1533 - trunk Message-ID: <20080714150417.5CE051384171@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 18:04:02 2008 New Revision: 1533 Modified: trunk/TODO Log: * some parts of this file have been completed Modified: trunk/TODO ================================================================= --- trunk/TODO (original) +++ trunk/TODO Mon Jul 14 18:04:02 2008 @@ -16,8 +16,8 @@ + register + edit profile - user list - - show profile - - avatar support + + show profile + + avatar support + lost password support - FreeComment support for news (also maybe packages, games etc.) @@ -52,9 +52,9 @@ - Markup language (BBCode??) - Smiley + Quotations - - Feeds + + Feeds - Search - Log & monitor all IP's - User/IP Ban - Migration - - Multi language \ No newline at end of file + - Multi language From oi-commits at pardus.org.tr Mon Jul 14 18:26:57 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 18:26:57 +0300 (EEST) Subject: [Oi-commits] r1534 - trunk/shop Message-ID: <20080714152657.4F70813841C0@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 18:26:56 2008 New Revision: 1534 Added: trunk/shop/TODO Log: our TODO :) From oi-commits at pardus.org.tr Mon Jul 14 18:52:57 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 18:52:57 +0300 (EEST) Subject: [Oi-commits] r1535 - in trunk/shop: . product Message-ID: <20080714155257.68FC61384091@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 18:52:57 2008 New Revision: 1535 Modified: trunk/shop/TODO trunk/shop/product/models.py Log: * extend TODO * edit the url of category Modified: trunk/shop/TODO ================================================================= --- trunk/shop/TODO (original) +++ trunk/shop/TODO Mon Jul 14 18:52:57 2008 @@ -10,6 +10,8 @@ [*] Category - Image with thumbnail support for each category + - Show how many products a category have in the category tree. E.g: T-shirts (14) + [*] User - Don't forget to control user's bill information as bill class doesn't have any check. Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Mon Jul 14 18:52:57 2008 @@ -17,7 +17,7 @@ description = models.TextField("Kategori a??klamas?") def get_absolute_url(self): - return u'/dukkan/category/%s/' % self.slug + return u'/dukkan/kategori/%s/' % self.slug def have_child(self): if self.child.count() > 0: From oi-commits at pardus.org.tr Mon Jul 14 18:59:37 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 18:59:37 +0300 (EEST) Subject: [Oi-commits] r1536 - trunk/shop Message-ID: <20080714155937.4664D13840CC@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 18:59:37 2008 New Revision: 1536 Modified: trunk/shop/TODO Log: extend TODO, huh... Modified: trunk/shop/TODO ================================================================= --- trunk/shop/TODO (original) +++ trunk/shop/TODO Mon Jul 14 18:59:37 2008 @@ -13,6 +13,10 @@ - Show how many products a category have in the category tree. E.g: T-shirts (14) +[*] Product + - Create Product class, damn?! + - Make sure that product can have more than 1 picture. Also, these should be with thumbnail support + [*] User - Don't forget to control user's bill information as bill class doesn't have any check. - Add javascript. It will be used to print out different bill form. E.g: When the user checks invidual bill, From oi-commits at pardus.org.tr Mon Jul 14 22:13:21 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Mon, 14 Jul 2008 22:13:21 +0300 (EEST) Subject: [Oi-commits] r1537 - in trunk/shop: . product Message-ID: <20080714191321.7025713841B0@liste.pardus.org.tr> Author: erenturkay Date: Mon Jul 14 22:13:21 2008 New Revision: 1537 Modified: trunk/shop/TODO trunk/shop/product/models.py Log: * add Image support for each category * I really love django since ForeignKeys can be edited inline on the related object's page, yaaaaaayy Modified: trunk/shop/TODO ================================================================= --- trunk/shop/TODO (original) +++ trunk/shop/TODO Mon Jul 14 22:13:21 2008 @@ -9,7 +9,7 @@ + Completed [*] Category - - Image with thumbnail support for each category + / Image with thumbnail support for each category - Show how many products a category have in the category tree. E.g: T-shirts (14) @@ -23,4 +23,4 @@ only adress form will be displayed. But when the user selects company bill, another form will be displayed. Additionally, user can have both bill type - - Add "mycart" to left + - Add "mycart" to right Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Mon Jul 14 22:13:21 2008 @@ -8,6 +8,30 @@ from django.db import models from django.core import validators +class CategoryImages(models.Model): + """ This class has no Meta and Admin class because it's edited inline on related object's page """ + category = models.ForeignKey("Category", blank=True, null=True, edit_inline=models.TABULAR, num_in_admin=2, max_num_in_admin=2, related_name="images") + picture = models.ImageField(verbose_name="Kategori Resmi", upload_to="upload/image/") + keep = models.BooleanField(default=True, editable=False, core=True) + # we use remove since we don't have admin interface for editing CategoryImage. + # It's edited inline on the related model page, when remove is checked, we will just delete the entry. + remove = models.BooleanField(default=False) + + def __unicode__(self): + return u'"%s" kategori resmi' % self.category.name + + def save(self): + # Picture value is always set. When you add new Category without images, + # it just saves as blank. So prevent adding useless images. + + # new entry. + if not self.id and not self.picture: + return + if self.remove: + self.delete() + else: + super(CategoryImages, self).save() + class Category(models.Model): """ Base category model for all products """ name = models.CharField("?sim", max_length=200, core=True) From oi-commits at pardus.org.tr Tue Jul 15 15:12:32 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 15:12:32 +0300 (EEST) Subject: [Oi-commits] r1538 - trunk/media/js/tinymce Message-ID: <20080715121232.95FE61384225@liste.pardus.org.tr> Author: jnmbk Date: Tue Jul 15 15:12:32 2008 New Revision: 1538 Modified: trunk/media/js/tinymce/forum.js trunk/media/js/tinymce/textareas.js Log: fix align problem in tinymce Modified: trunk/media/js/tinymce/forum.js ================================================================= --- trunk/media/js/tinymce/forum.js (original) +++ trunk/media/js/tinymce/forum.js Tue Jul 15 15:12:32 2008 @@ -14,7 +14,7 @@ convert_urls : false, width : "630", height : "300", - extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", + extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", advimage_update_dimensions_onchange: true, plugins : "advimage,autosave,searchreplace,table,visualchars,advlink,emotions,media,safari,style,template,xhtmlxtras", gecko_spellcheck : true, Modified: trunk/media/js/tinymce/textareas.js ================================================================= --- trunk/media/js/tinymce/textareas.js (original) +++ trunk/media/js/tinymce/textareas.js Tue Jul 15 15:12:32 2008 @@ -14,7 +14,7 @@ convert_urls : false, width : "800", height : "300", - extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", + extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name|sytle],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", advimage_update_dimensions_onchange: true, file_browser_callback : 'oiFileBrowser', plugins : "advimage,autosave,searchreplace,table,visualchars,advlink,emotions,media,style,template,xhtmlxtras", From oi-commits at pardus.org.tr Tue Jul 15 15:16:01 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 15:16:01 +0300 (EEST) Subject: [Oi-commits] r1539 - branches/stable/media/js/tinymce Message-ID: <20080715121601.E4B551384254@liste.pardus.org.tr> Author: jnmbk Date: Tue Jul 15 15:16:00 2008 New Revision: 1539 Modified: branches/stable/media/js/tinymce/forum.js branches/stable/media/js/tinymce/textareas.js Log: merge tinmce fix Modified: branches/stable/media/js/tinymce/forum.js ================================================================= --- branches/stable/media/js/tinymce/forum.js (original) +++ branches/stable/media/js/tinymce/forum.js Tue Jul 15 15:16:00 2008 @@ -14,7 +14,7 @@ convert_urls : false, width : "630", height : "300", - extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", + extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name|style],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", advimage_update_dimensions_onchange: true, plugins : "advimage,autosave,searchreplace,table,visualchars,advlink,emotions,media,safari,style,template,xhtmlxtras", gecko_spellcheck : true, Modified: branches/stable/media/js/tinymce/textareas.js ================================================================= --- branches/stable/media/js/tinymce/textareas.js (original) +++ branches/stable/media/js/tinymce/textareas.js Tue Jul 15 15:16:00 2008 @@ -14,7 +14,7 @@ convert_urls : false, width : "800", height : "300", - extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", + extended_valid_elements : "a[name|href|target|title],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|name|sytle],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]", advimage_update_dimensions_onchange: true, file_browser_callback : 'oiFileBrowser', plugins : "advimage,autosave,searchreplace,table,visualchars,advlink,emotions,media,style,template,xhtmlxtras", From oi-commits at pardus.org.tr Tue Jul 15 15:47:43 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 15:47:43 +0300 (EEST) Subject: [Oi-commits] r1540 - trunk/shop/product Message-ID: <20080715124744.3F5BB1384088@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 15 15:47:42 2008 New Revision: 1540 Modified: trunk/shop/product/models.py Log: * add Tax model * add Product model but it needs reaaaaaaallllyyyyy more work Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Tue Jul 15 15:47:42 2008 @@ -126,3 +126,88 @@ class Admin: search_fields = ["name", "slug"] list_display = ("name", "_parents_repr",) + +######################################## +# # +# Tax Model that all products can have # +# # +######################################## + +class Tax(models.Model): + # FIXME: Maybe inline edited? + title = models.CharField("Vergi ?smi", max_length=100) + percentage = models.DecimalField("Vergi Oran?", max_digits=3, decimal_places=2, help_text="3.21 gibi") + + def __unicode__(self): + return u'%s:%s' % (self.title, self.percentage) + + class Meta: + verbose_name = "Vergi" + verbose_name_plural = "Vergiler" + + ordering = ['title'] + + class Admin: + list_display = ("title", "percentage",) + search_fields = ['title'] + +############################################################ +# # +# Main product class, it can have a child product model # +# It's use-case is T-shirt. A t-shirt can have X/XL/M type # +# # +############################################################ + +class Product(models.Model): + # core True because we will use ProductImage as inline-edited object + name = models.CharField("?sim", max_length=200, core=True) + slug = models.SlugField("SEF Ba?l?k", prepopulate_from=("name",), help_text="Adres k?sm?nda kullan?lan ad, isim k?sm?ndan otomatik olarak ?retilmektedir") + + stock = models.IntegerField("?r?n Sto?u", blank=True) + price = models.DecimalField("?r?n?n fiyat?", blank=True, max_digits=5, decimal_places=2, help_text="15.67 gibi. YTL Cinsinden") + + parent = models.ForeignKey('self', blank=True, null=True, related_name='child') + category = models.ForeignKey('Category') + tax = models.ForeignKey('Tax') + + # FIXME: add stock, price etc... + + # God damn it, these functions are the same with Category + # It's a code repeat. Grr.. + + def get_separator(self): + return ' :: ' + + def _recurse_for_parents(self, cat_obj): + p_list = [] + if cat_obj.parent_id: + p = cat_obj.parent + p_list.append(p) + if p != self: + more = self._recurse_for_parents(p) + p_list.extend(more) + if cat_obj == self and p_list: + p_list.reverse() + return p_list + + # For displaying object's parents on admin page correctly + def _parents_repr(self): + name_list = [cat.name for cat in self._recurse_for_parents(self)] + return self.get_separator().join(name_list) + _parents_repr.short_description = "Category parents" + + def __unicode__(self): + name_list = [cat.name for cat in self._recurse_for_parents(self)] + name_list.append(self.name) + return self.get_separator().join(name_list) + + class Meta: + verbose_name = "?r?n" + verbose_name_plural = "?r?nler" + + ordering = ["name", "price"] + + class Admin: + search_fields = ["name"] + + list_display = ("name", "stock", "_parents_repr") From oi-commits at pardus.org.tr Tue Jul 15 17:18:23 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 17:18:23 +0300 (EEST) Subject: [Oi-commits] r1541 - trunk/shop Message-ID: <20080715141823.A247813840F3@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 15 17:18:23 2008 New Revision: 1541 Modified: trunk/shop/urls.py Log: add url Modified: trunk/shop/urls.py ================================================================= --- trunk/shop/urls.py (original) +++ trunk/shop/urls.py Tue Jul 15 17:18:23 2008 @@ -12,4 +12,6 @@ (r'^$', 'main.views.home'), # Profile (r'^profil/$', include('shopprofile.urls')), + # Category + (r'^kategori/(?P.*)/$', 'product.views.get_category_products'), ) From oi-commits at pardus.org.tr Tue Jul 15 17:19:39 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 17:19:39 +0300 (EEST) Subject: [Oi-commits] r1542 - in trunk: . bug feedjack flatpages forum forum/stripogram petition profile seminar st upload Message-ID: <20080715141939.38A8213840F1@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 15 17:19:38 2008 New Revision: 1542 Modified: trunk/bug/models.py trunk/feedjack/models.py trunk/flatpages/models.py trunk/forum/models.py trunk/forum/postmarkup.py trunk/forum/stripogram/HTMLParser.py trunk/petition/models.py trunk/profile/models.py trunk/seminar/models.py trunk/settings.py trunk/st/models.py trunk/upload/models.py Log: __str__ -> __unicode__ Modified: trunk/bug/models.py ================================================================= --- trunk/bug/models.py (original) +++ trunk/bug/models.py Tue Jul 15 17:19:38 2008 @@ -32,7 +32,7 @@ status = models.IntegerField(verbose_name="Durum", default=1, choices=STATUS_CODES) priority = models.IntegerField(verbose_name="?ncelik", default=3, choices=PRIORITIES) - def __str__(self): + def __unicode__(self): return self.title def get_full_url(self): @@ -52,7 +52,7 @@ text = models.TextField(blank=False, verbose_name="Yorum") date = models.DateTimeField(auto_now_add=True, verbose_name="Tarih") - def __str__(self): + def __unicode__(self): return self.text class Admin: Modified: trunk/feedjack/models.py ================================================================= --- trunk/feedjack/models.py (original) +++ trunk/feedjack/models.py Tue Jul 15 17:19:38 2008 @@ -27,7 +27,7 @@ class Admin: pass - def __str__(self): + def __unicode__(self): return '%s (%s)' % (self.name, self.link) @@ -66,7 +66,7 @@ verbose_name_plural = 'sites' ordering = ('name',) - def __str__(self): + def __unicode__(self): return self.name def save(self): @@ -121,7 +121,7 @@ verbose_name_plural = 'feeds' ordering = ('name', 'feed_url',) - def __str__(self): + def __unicode__(self): return '%s (%s)' % (self.name, self.feed_url) def save(self): @@ -135,7 +135,7 @@ verbose_name_plural = 'tags' ordering = ('name',) - def __str__(self): + def __unicode__(self): return self.name def save(self): @@ -165,7 +165,7 @@ ordering = ('-date_modified',) unique_together = (('feed', 'guid'),) - def __str__(self): + def __unicode__(self): return self.title def save(self): @@ -197,7 +197,7 @@ ordering = ('site', 'name', 'feed') unique_together = (('site', 'feed'),) - def __str__(self): + def __unicode__(self): return '%s in %s' % (self.feed, self.site) def get_cloud(self): Modified: trunk/flatpages/models.py ================================================================= --- trunk/flatpages/models.py (original) +++ trunk/flatpages/models.py Tue Jul 15 17:19:38 2008 @@ -36,7 +36,7 @@ search_fields = ['title', 'text', 'tags'] js = ("js/tinymce/tiny_mce.js", "js/tinymce/textareas.js",) - def __str__(self): + def __unicode__(self): return "%s -- %s" % (self.url, self.title) def get_absolute_url(self): Modified: trunk/forum/models.py ================================================================= --- trunk/forum/models.py (original) +++ trunk/forum/models.py Tue Jul 15 17:19:38 2008 @@ -22,7 +22,7 @@ """ Post model. - __str__: id of post + __unicode__: id of post get_absolute_url: absolute url of post save(): saves post and updates Topic and Forum objects """ @@ -36,7 +36,7 @@ last_edited_by = models.ForeignKey(User, blank=True, null=True, related_name='last edited by', verbose_name='Yazar') ip = models.IPAddressField(blank=True, verbose_name='IP adresi') - def __str__(self): + def __unicode__(self): return "%s" % self.id def get_absolute_url(self): @@ -162,7 +162,7 @@ tags = models.ManyToManyField(Tag, verbose_name='Etiketler') poll = models.ForeignKey(Poll, blank=True, verbose_name="Anket") - def __str__(self): + def __unicode__(self): return self.title def get_absolute_url(self): @@ -265,7 +265,7 @@ lastpage = ((latest_topic.posts - 1) / oi.forum.settings.POSTS_PER_PAGE) + 1 return '/forum/%s/%s/?page=%s#post%s' % (self.slug, latest_topic.id, lastpage, self.forum_latest_post.id) - def __str__(self): + def __unicode__(self): return self.name class Admin: @@ -287,7 +287,7 @@ hidden = models.BooleanField(blank=True, null=True, verbose_name='Gizli') order = models.PositiveIntegerField(unique=True, verbose_name='S?ralama') - def __str__(self): + def __unicode__(self): return self.name def get_absolute_url(self): @@ -323,7 +323,7 @@ user = models.ForeignKey(User, verbose_name='Kullan?c?') topic = models.ForeignKey(Topic, verbose_name='Konu') - def __str__(self): + def __unicode__(self): return '%s' % self.topic.title class Admin: Modified: trunk/forum/postmarkup.py ================================================================= --- trunk/forum/postmarkup.py (original) +++ trunk/forum/postmarkup.py Tue Jul 15 17:19:38 2008 @@ -803,10 +803,10 @@ self.callback = callback self.raw = raw r[b]=3 - def __str__(self): + def __unicode__(self): return self.callback() def __repr__(self): - return self.__str__() + return self.__unicode__() [/code]""") Modified: trunk/forum/stripogram/HTMLParser.py ================================================================= --- trunk/forum/stripogram/HTMLParser.py (original) +++ trunk/forum/stripogram/HTMLParser.py Tue Jul 15 17:19:38 2008 @@ -72,7 +72,7 @@ self.lineno = position[0] self.offset = position[1] - def __str__(self): + def __unicode__(self): result = self.msg if self.lineno is not None: result = result + ", at line %d" % self.lineno Modified: trunk/petition/models.py ================================================================= --- trunk/petition/models.py (original) +++ trunk/petition/models.py Tue Jul 15 17:19:38 2008 @@ -22,7 +22,7 @@ is_active = models.BooleanField("Etkin") inform = models.BooleanField("Haberdar Et") - def __str__(self): + def __unicode__(self): return "%s %s" % (self.firstname, self.lastname) class Admin: Modified: trunk/profile/models.py ================================================================= --- trunk/profile/models.py (original) +++ trunk/profile/models.py Tue Jul 15 17:19:38 2008 @@ -18,7 +18,7 @@ class ForbiddenUsername(models.Model): name = models.CharField("Kullan?c? ad?", max_length=30) - def __str__(self): + def __unicode__(self): return self.name class Admin: @@ -34,7 +34,7 @@ name = models.CharField("A??klama", max_length=32, unique=True) file = models.ImageField(upload_to="avatar/") - def __str__(self): + def __unicode__(self): return self.file class Admin: @@ -51,7 +51,7 @@ key = models.CharField('Anahtar', max_length=40, unique=True) key_expires = models.DateTimeField('Zaman A??m?') - def __str__(self): + def __unicode__(self): return "%s" % self.key def is_expired(self): Modified: trunk/seminar/models.py ================================================================= --- trunk/seminar/models.py (original) +++ trunk/seminar/models.py Tue Jul 15 17:19:38 2008 @@ -15,7 +15,7 @@ direction = models.TextField('Adres Tarifi', blank=True) phone = models.PhoneNumberField('Telefon', blank=True) - def __str__(self): + def __unicode__(self): return self.name class Admin: @@ -31,7 +31,7 @@ class Attender(models.Model): name = models.CharField('Konu?mac?', max_length=64, blank=False, unique=True) - def __str__(self): + def __unicode__(self): return self.name class Admin: @@ -51,7 +51,7 @@ date = models.DateField('Tarih', blank=False) status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return self.description class Admin: Modified: trunk/settings.py ================================================================= --- trunk/settings.py (original) +++ trunk/settings.py Tue Jul 15 17:19:38 2008 @@ -15,13 +15,13 @@ DEBUG = True TESTING = True TEMPLATE_DEBUG = DEBUG -WEB_URL = 'http://django' -DOCUMENT_ROOT = '/home/ahmet/public_html/oi' +WEB_URL = 'http://localhost:8000' +DOCUMENT_ROOT = '/home/eren/sourcebox/oi/trunk' DATABASE_ENGINE = 'mysql' DATABASE_NAME = 'oi' DATABASE_USER = 'root' -DATABASE_PASSWORD = 'root' +DATABASE_PASSWORD = '' DATABASE_HOST = 'localhost' DATABASE_PORT = '' @@ -98,6 +98,7 @@ TEMPLATE_DIRS = ( '%s/templates' % DOCUMENT_ROOT, + '%s/shop/templates' % DOCUMENT_ROOT, ) INSTALLED_APPS = ( @@ -119,6 +120,9 @@ 'oi.comments', 'oi.petition', 'oi.poll', + # shop apps + 'oi.shop.shopprofile', + 'oi.shop.product', ) CITY_LIST = ( Modified: trunk/st/models.py ================================================================= --- trunk/st/models.py (original) +++ trunk/st/models.py Tue Jul 15 17:19:38 2008 @@ -23,7 +23,7 @@ class Tag(models.Model): name = models.CharField('Etiket', max_length=32, blank=False, unique=True) - def __str__(self): + def __unicode__(self): return self.name def get_absolute_url(self): @@ -42,7 +42,7 @@ class Wiki(models.Model): name = models.CharField('Madde ad?', max_length=128, blank=False, unique=True) - def __str__(self): + def __unicode__(self): return self.name def get_absolute_url(self): @@ -61,7 +61,7 @@ class Contribute(models.Model): name = models.CharField('Tan?m', max_length=64, blank=False, unique=True) - def __str__(self): + def __unicode__(self): return self.name class Admin: @@ -78,7 +78,7 @@ file = models.FileField(upload_to='dosya/') tags = models.ManyToManyField(Tag) - def __str__(self): + def __unicode__(self): return self.file class Admin: @@ -95,7 +95,7 @@ file = models.ImageField(upload_to='ekran_goruntusu/') tags = models.ManyToManyField(Tag) - def __str__(self): + def __unicode__(self): return self.file def get_thumbnail_url(file, size='230x230'): @@ -128,7 +128,7 @@ file = models.FileField(upload_to='upload/video/') tags = models.ManyToManyField(Tag) - def __str__(self): + def __unicode__(self): return self.desc def get_thumbnail_url(self): @@ -181,7 +181,7 @@ name = models.CharField(max_length=16, blank=False, unique=True) url = models.URLField() - def __str__(self): + def __unicode__(self): return self.name class Admin: @@ -203,7 +203,7 @@ order = models.PositiveIntegerField(unique=True, verbose_name='S?ralama') status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return self.title def get_absolute_url(self): @@ -240,7 +240,7 @@ author = models.CharField('Yazar', max_length=32) status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return self.title def get_absolute_url(self): @@ -292,7 +292,7 @@ author = models.CharField('Yazar', max_length=32) status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return self.title def get_absolute_url(self): @@ -330,7 +330,7 @@ author = models.CharField('Yazar', max_length=32) status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return self.title def get_absolute_url(self): @@ -378,7 +378,7 @@ author = models.CharField('Yazar', max_length=32) status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return self.title def get_absolute_url(self): @@ -416,7 +416,7 @@ live_torrent = models.CharField('?al??an Torrent', max_length = 128) status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return "Pardus %s" % self.number def get_absolute_url(self): @@ -441,7 +441,7 @@ order = models.PositiveIntegerField(verbose_name='S?ralama') status = models.BooleanField('Aktif') - def __str__(self): + def __unicode__(self): return self.name class Admin: Modified: trunk/upload/models.py ================================================================= --- trunk/upload/models.py (original) +++ trunk/upload/models.py Tue Jul 15 17:19:38 2008 @@ -10,7 +10,7 @@ class Image(models.Model): file = models.FileField(upload_to='upload/image/') - def __str__(self): + def __unicode__(self): return self.file class Admin: From oi-commits at pardus.org.tr Tue Jul 15 20:33:44 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 20:33:44 +0300 (EEST) Subject: [Oi-commits] r1543 - in trunk/shop: . product product/templatetags templates Message-ID: <20080715173345.155D313841BE@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 15 20:33:44 2008 New Revision: 1543 Modified: trunk/shop/TODO trunk/shop/product/models.py trunk/shop/product/templatetags/shop_library.py trunk/shop/templates/shop_base.html trunk/shop/templates/shop_main.html Log: * add ProductImage class * make category_tree show how many products a category have, e.g: Thirts (2) Modified: trunk/shop/TODO ================================================================= --- trunk/shop/TODO (original) +++ trunk/shop/TODO Tue Jul 15 20:33:44 2008 @@ -8,14 +8,18 @@ / In progress + Completed + +- Specific thumbnail field for image adding. (ImageWithThumbnail) + [*] Category - / Image with thumbnail support for each category - - Show how many products a category have in the category tree. E.g: T-shirts (14) + + Image for each category + + Show how many products a category have in the category tree. E.g: T-shirts (14) + - Product listing for each category [*] Product - - Create Product class, damn?! - - Make sure that product can have more than 1 picture. Also, these should be with thumbnail support + + Create Product class, damn?! + + Make sure that product can have more than 1 picture. [*] User - Don't forget to control user's bill information as bill class doesn't have any check. Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Tue Jul 15 20:33:44 2008 @@ -151,6 +151,37 @@ list_display = ("title", "percentage",) search_fields = ['title'] +###################################################### +# # +# Image class for all Products. # +# There is a code repeat but I can't think better :P # +# # +###################################################### + +class ProductImages(models.Model): + """ This class has no Meta and Admin class because it's edited inline on related object's page """ + product = models.ForeignKey("Product", blank=True, null=True, edit_inline=models.TABULAR, num_in_admin=3, max_num_in_admin=3, related_name="images") + picture = models.ImageField(verbose_name="?r?n Resmi", upload_to="upload/image/") + keep = models.BooleanField(default=True, editable=False, core=True) + # we use remove since we don't have admin interface for editing CategoryImage. + # It's edited inline on the related model page, when remove is checked, we will just delete the entry. + remove = models.BooleanField(default=False) + + def __unicode__(self): + return u'"%s" ?r?n resmi' % self.product.name + + def save(self): + # Picture value is always set. When you add new Category without images, + # it just saves as blank. So prevent adding useless images. + + # new entry. + if not self.id and not self.picture: + return + if self.remove: + self.delete() + else: + super(CategoryImages, self).save() + ############################################################ # # # Main product class, it can have a child product model # Modified: trunk/shop/product/templatetags/shop_library.py ================================================================= --- trunk/shop/product/templatetags/shop_library.py (original) +++ trunk/shop/product/templatetags/shop_library.py Tue Jul 15 20:33:44 2008 @@ -24,7 +24,7 @@ if current_node == active_cat: attrs["class"] = "current" link = SubElement(temp_parent, 'a', attrs) - link.text = current_node.name + link.text = "%s (%s)" % (current_node.name, current_node.product_set.count()) if child_count > 0: new_parent = SubElement(temp_parent, 'ul') Modified: trunk/shop/templates/shop_base.html ================================================================= --- trunk/shop/templates/shop_base.html (original) +++ trunk/shop/templates/shop_base.html Tue Jul 15 20:33:44 2008 @@ -2,7 +2,7 @@ -{% block title %}{% endblock %}?zg?rl?k i?in... +{% block title %}{% endblock %} - ?zg?rl?k i?in... Modified: trunk/shop/templates/shop_main.html ================================================================= --- trunk/shop/templates/shop_main.html (original) +++ trunk/shop/templates/shop_main.html Tue Jul 15 20:33:44 2008 @@ -1,6 +1,6 @@ {% extends "shop_base.html" %} -{% block title %}D?kkan - {% endblock %} +{% block title %}D?kkan{% endblock %} {% block header_menu %} {% include "header.html" %} From oi-commits at pardus.org.tr Tue Jul 15 20:34:05 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 20:34:05 +0300 (EEST) Subject: [Oi-commits] r1544 - trunk/shop/product Message-ID: <20080715173405.83B8A13841BE@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 15 20:34:05 2008 New Revision: 1544 Added: trunk/shop/product/views.py Log: * opps, add forgotten views.py for product From oi-commits at pardus.org.tr Tue Jul 15 22:35:13 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 22:35:13 +0300 (EEST) Subject: [Oi-commits] r1545 - trunk/shop/product Message-ID: <20080715193513.F385113840DA@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 15 22:35:13 2008 New Revision: 1545 Modified: trunk/shop/product/models.py Log: * add helper methods * display product info on admin page well * add Active field Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Tue Jul 15 22:35:13 2008 @@ -43,18 +43,6 @@ def get_absolute_url(self): return u'/dukkan/kategori/%s/' % self.slug - def have_child(self): - if self.child.count() > 0: - return True - else: - return False - - def have_parent(self): - if not self.parent_id: - return False - else: - return True - def get_separator(self): return ' :: ' @@ -139,7 +127,7 @@ percentage = models.DecimalField("Vergi Oran?", max_digits=3, decimal_places=2, help_text="3.21 gibi") def __unicode__(self): - return u'%s:%s' % (self.title, self.percentage) + return u'%s: %%%s' % (self.title, self.percentage) class Meta: verbose_name = "Vergi" @@ -194,14 +182,41 @@ name = models.CharField("?sim", max_length=200, core=True) slug = models.SlugField("SEF Ba?l?k", prepopulate_from=("name",), help_text="Adres k?sm?nda kullan?lan ad, isim k?sm?ndan otomatik olarak ?retilmektedir") - stock = models.IntegerField("?r?n Sto?u", blank=True) - price = models.DecimalField("?r?n?n fiyat?", blank=True, max_digits=5, decimal_places=2, help_text="15.67 gibi. YTL Cinsinden") + stock = models.IntegerField("?r?n Sto?u", default=0) + price = models.DecimalField("?r?n?n fiyat?", default=0, max_digits=5, decimal_places=2, help_text="?r?n?n vergisiz fiyat?. Vergi a?a??da se?ti?inize ba?l? olarak otomatik bir ?ekilde bu fiyat?n ?zerine eklenmektedir. 15.67 gibi YTL cinsinden belirtin.") + + active = models.BooleanField("Aktif", default=False) parent = models.ForeignKey('self', blank=True, null=True, related_name='child') - category = models.ForeignKey('Category') - tax = models.ForeignKey('Tax') + category = models.ForeignKey('Category', blank=True, null=True) + tax = models.ForeignKey('Tax', blank=True, null=True) + + def get_absolute_url(self): + return u'/dukkan/urun/%s/%s/' % (self.category.slug, self.slug) + + def get_active_products(self): + return self.objects.filter(active=True) + + def is_in_stock(self): + if self.stock > 0: + return True + else: + return False - # FIXME: add stock, price etc... + # We use them on template + # If a product have childs (t-shirt, for example), then the page acts differently + + def have_child(self): + if self.child.count() > 0: + return True + else: + return False + + def have_parent(self): + if not self.parent_id: + return False + else: + return True # God damn it, these functions are the same with Category # It's a code repeat. Grr.. @@ -239,6 +254,13 @@ ordering = ["name", "price"] class Admin: + fields = ( + ("?r?n Bilgileri", {"fields": ("name", "slug", "stock", "price")}), + ("Kategori/Resim/Vergi", {"fields": ("parent", "category", "tax")}), + (None, {"fields": ("active",)}) + ) + search_fields = ["name"] list_display = ("name", "stock", "_parents_repr") + From oi-commits at pardus.org.tr Tue Jul 15 22:48:49 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Tue, 15 Jul 2008 22:48:49 +0300 (EEST) Subject: [Oi-commits] r1546 - in trunk/shop: . product Message-ID: <20080715194849.ABB00138422D@liste.pardus.org.tr> Author: erenturkay Date: Tue Jul 15 22:48:49 2008 New Revision: 1546 Modified: trunk/shop/TODO trunk/shop/product/views.py trunk/shop/urls.py Log: * try to implement URL, not finished yet. I'll take a look at it later :) Modified: trunk/shop/TODO ================================================================= --- trunk/shop/TODO (original) +++ trunk/shop/TODO Tue Jul 15 22:48:49 2008 @@ -21,6 +21,8 @@ + Create Product class, damn?! + Make sure that product can have more than 1 picture. + - Calculate total price, considering tax + [*] User - Don't forget to control user's bill information as bill class doesn't have any check. - Add javascript. It will be used to print out different bill form. E.g: When the user checks invidual bill, Modified: trunk/shop/product/views.py ================================================================= --- trunk/shop/product/views.py (original) +++ trunk/shop/product/views.py Tue Jul 15 22:48:49 2008 @@ -8,7 +8,7 @@ from django.shortcuts import get_object_or_404 from oi.st.wrappers import render_response -from oi.shop.product.models import Category +from oi.shop.product.models import Category, Product # temp from django.http import HttpResponse @@ -24,3 +24,13 @@ products = category.product_set.all() return render_response(request, "category/category_list.html", {"products": products}) + +def get_product(request, category_slug, product_slug): + # filter by product and category slug together + # becuase a product can have the same name but can be in different categories. + + product = get_object_or_404(Product, product__slug__iexact=product_slug) + + print product + + return HttpResponse(request, product) Modified: trunk/shop/urls.py ================================================================= --- trunk/shop/urls.py (original) +++ trunk/shop/urls.py Tue Jul 15 22:48:49 2008 @@ -14,4 +14,6 @@ (r'^profil/$', include('shopprofile.urls')), # Category (r'^kategori/(?P.*)/$', 'product.views.get_category_products'), + # Product + (r'^urun/(?P.*)/(?P.*)/$', 'product.views.get_product'), ) From oi-commits at pardus.org.tr Wed Jul 16 17:02:33 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 16 Jul 2008 17:02:33 +0300 (EEST) Subject: [Oi-commits] r1547 - in trunk/shop: product templates/category templates/product Message-ID: <20080716140234.1CE9513840FB@liste.pardus.org.tr> Author: erenturkay Date: Wed Jul 16 17:02:33 2008 New Revision: 1547 Added: trunk/shop/templates/category/ trunk/shop/templates/category/category_list.html trunk/shop/templates/product/ trunk/shop/templates/product/product_info.html Modified: trunk/shop/product/views.py Log: * add base product template Modified: trunk/shop/product/views.py ================================================================= --- trunk/shop/product/views.py (original) +++ trunk/shop/product/views.py Wed Jul 16 17:02:33 2008 @@ -29,8 +29,6 @@ # filter by product and category slug together # becuase a product can have the same name but can be in different categories. - product = get_object_or_404(Product, product__slug__iexact=product_slug) + product = get_object_or_404(Product, slug__exact=product_slug, category__slug__exact=category_slug) - print product - - return HttpResponse(request, product) + return render_response(request, "product/product_info.html", {"product": product}) From oi-commits at pardus.org.tr Wed Jul 16 19:28:12 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 16 Jul 2008 19:28:12 +0300 (EEST) Subject: [Oi-commits] r1548 - in trunk: media/css media/img media/js templates/fs templates/package Message-ID: <20080716162812.EE0DA13840F7@liste.pardus.org.tr> Author: erenturkay Date: Wed Jul 16 19:28:12 2008 New Revision: 1548 Added: trunk/media/css/lightbox.css (contents, props changed) trunk/media/img/bullet.gif (contents, props changed) trunk/media/img/close.gif (contents, props changed) trunk/media/img/closelabel.gif (contents, props changed) trunk/media/img/donate-button.gif (contents, props changed) trunk/media/img/download-icon.gif (contents, props changed) trunk/media/img/nextlabel.gif (contents, props changed) trunk/media/img/prevlabel.gif (contents, props changed) trunk/media/js/builder.js trunk/media/js/effects.js (contents, props changed) trunk/media/js/lightbox.js (contents, props changed) trunk/media/js/prototype.js (contents, props changed) trunk/media/js/scriptaculous.js (contents, props changed) Removed: trunk/media/css/slimbox_ex.css trunk/media/js/slimbox_ex.js Modified: trunk/media/img/loading.gif trunk/templates/fs/fs_detail.html trunk/templates/package/package_detail.html Log: * fix lightbox, yay. Other page fixes are coming Modified: trunk/media/img/loading.gif ================================================================= Binary files. No diff available. Modified: trunk/templates/fs/fs_detail.html ================================================================= --- trunk/templates/fs/fs_detail.html (original) +++ trunk/templates/fs/fs_detail.html Wed Jul 16 19:28:12 2008 @@ -4,8 +4,12 @@ {% block title %}{{ fs.title }} - ?lk Ad?mlar - {% endblock %} {% block extrahead %} - - + + + + + + {% endblock %} {% block pagetype %}page{% endblock %} Modified: trunk/templates/package/package_detail.html ================================================================= --- trunk/templates/package/package_detail.html (original) +++ trunk/templates/package/package_detail.html Wed Jul 16 19:28:12 2008 @@ -4,10 +4,14 @@ {% block title %}{{ package.title }} - Paketler - {% endblock %} {% block extrahead %} - - + + + + + + {% endblock %} {% block pagetype %}page{% endblock %} From oi-commits at pardus.org.tr Wed Jul 16 19:31:38 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 16 Jul 2008 19:31:38 +0300 (EEST) Subject: [Oi-commits] r1549 - in trunk/templates: game howto Message-ID: <20080716163139.0AABF13840F7@liste.pardus.org.tr> Author: erenturkay Date: Wed Jul 16 19:31:38 2008 New Revision: 1549 Modified: trunk/templates/game/game_detail.html trunk/templates/howto/howto_detail.html Log: * fix howto and game pages too, that's it Modified: trunk/templates/game/game_detail.html ================================================================= --- trunk/templates/game/game_detail.html (original) +++ trunk/templates/game/game_detail.html Wed Jul 16 19:31:38 2008 @@ -4,10 +4,14 @@ {% block title %}{{ game.title }} - Oyunlar - {% endblock %} {% block extrahead %} - - + + + + + + {% endblock %} {% block pagetype %}page{% endblock %} Modified: trunk/templates/howto/howto_detail.html ================================================================= --- trunk/templates/howto/howto_detail.html (original) +++ trunk/templates/howto/howto_detail.html Wed Jul 16 19:31:38 2008 @@ -4,10 +4,13 @@ {% block title %}{{ howto.title }} - Nas?l - {% endblock %} {% block extrahead %} - - + + + + + {% endblock %} {% block pagetype %}page{% endblock %} From oi-commits at pardus.org.tr Wed Jul 16 19:35:45 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 16 Jul 2008 19:35:45 +0300 (EEST) Subject: [Oi-commits] r1550 - in branches/stable: media/css media/dosya media/img media/js templates/fs templates/game templates/howto templates/package Message-ID: <20080716163545.785E413840F7@liste.pardus.org.tr> Author: erenturkay Date: Wed Jul 16 19:35:44 2008 New Revision: 1550 Added: branches/stable/media/css/lightbox.css - copied unchanged from r1549, trunk/media/css/lightbox.css branches/stable/media/dosya/ - copied from r1549, trunk/media/dosya/ branches/stable/media/img/bullet.gif - copied unchanged from r1549, trunk/media/img/bullet.gif branches/stable/media/img/close.gif - copied unchanged from r1549, trunk/media/img/close.gif branches/stable/media/img/closelabel.gif - copied unchanged from r1549, trunk/media/img/closelabel.gif branches/stable/media/img/donate-button.gif - copied unchanged from r1549, trunk/media/img/donate-button.gif branches/stable/media/img/download-icon.gif - copied unchanged from r1549, trunk/media/img/download-icon.gif branches/stable/media/img/nextlabel.gif - copied unchanged from r1549, trunk/media/img/nextlabel.gif branches/stable/media/img/prevlabel.gif - copied unchanged from r1549, trunk/media/img/prevlabel.gif branches/stable/media/js/builder.js - copied unchanged from r1549, trunk/media/js/builder.js branches/stable/media/js/effects.js - copied unchanged from r1549, trunk/media/js/effects.js branches/stable/media/js/lightbox.js - copied unchanged from r1549, trunk/media/js/lightbox.js branches/stable/media/js/prototype.js - copied unchanged from r1549, trunk/media/js/prototype.js branches/stable/media/js/scriptaculous.js - copied unchanged from r1549, trunk/media/js/scriptaculous.js Removed: branches/stable/media/css/slimbox_ex.css branches/stable/media/js/slimbox_ex.js Modified: branches/stable/media/img/loading.gif branches/stable/templates/fs/fs_detail.html branches/stable/templates/game/game_detail.html branches/stable/templates/howto/howto_detail.html branches/stable/templates/package/package_detail.html Log: * merge lightbox changes into stable Modified: branches/stable/media/img/loading.gif ================================================================= Binary files. No diff available. Modified: branches/stable/templates/fs/fs_detail.html ================================================================= --- branches/stable/templates/fs/fs_detail.html (original) +++ branches/stable/templates/fs/fs_detail.html Wed Jul 16 19:35:44 2008 @@ -4,8 +4,12 @@ {% block title %}{{ fs.title }} - ?lk Ad?mlar - {% endblock %} {% block extrahead %} - - + + + + + + {% endblock %} {% block pagetype %}page{% endblock %} Modified: branches/stable/templates/game/game_detail.html ================================================================= --- branches/stable/templates/game/game_detail.html (original) +++ branches/stable/templates/game/game_detail.html Wed Jul 16 19:35:44 2008 @@ -4,10 +4,14 @@ {% block title %}{{ game.title }} - Oyunlar - {% endblock %} {% block extrahead %} - - + + + + + + {% endblock %} {% block pagetype %}page{% endblock %} Modified: branches/stable/templates/howto/howto_detail.html ================================================================= --- branches/stable/templates/howto/howto_detail.html (original) +++ branches/stable/templates/howto/howto_detail.html Wed Jul 16 19:35:44 2008 @@ -4,10 +4,13 @@ {% block title %}{{ howto.title }} - Nas?l - {% endblock %} {% block extrahead %} - - + + + + + {% endblock %} {% block pagetype %}page{% endblock %} Modified: branches/stable/templates/package/package_detail.html ================================================================= --- branches/stable/templates/package/package_detail.html (original) +++ branches/stable/templates/package/package_detail.html Wed Jul 16 19:35:44 2008 @@ -4,10 +4,14 @@ {% block title %}{{ package.title }} - Paketler - {% endblock %} {% block extrahead %} - - + + + + + + {% endblock %} {% block pagetype %}page{% endblock %} From oi-commits at pardus.org.tr Wed Jul 16 20:15:23 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 16 Jul 2008 20:15:23 +0300 (EEST) Subject: [Oi-commits] r1551 - trunk/shop/product/templatetags Message-ID: <20080716171523.EA06D13840F7@liste.pardus.org.tr> Author: erenturkay Date: Wed Jul 16 20:15:23 2008 New Revision: 1551 Modified: trunk/shop/product/templatetags/shop_library.py Log: we now have a Product mode, this line can be used Modified: trunk/shop/product/templatetags/shop_library.py ================================================================= --- trunk/shop/product/templatetags/shop_library.py (original) +++ trunk/shop/product/templatetags/shop_library.py Wed Jul 16 20:15:23 2008 @@ -15,10 +15,7 @@ def recurse_for_children(current_node, parent_node, active_cat, show_empty=True): child_count = current_node.child.count() - # FIXME: update this code when product model has been added - # if show_empty or child_count > 0 or current_node.product_set.count() > 0: - - if show_empty or child_count > 0: + if show_empty or child_count > 0 or current_node.product_set.count() > 0: temp_parent = SubElement(parent_node, 'li') attrs = {'href': current_node.get_absolute_url()} if current_node == active_cat: From oi-commits at pardus.org.tr Wed Jul 16 21:14:48 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Wed, 16 Jul 2008 21:14:48 +0300 (EEST) Subject: [Oi-commits] r1552 - in trunk/shop: . product product/templatetags Message-ID: <20080716181448.9E21113840AE@liste.pardus.org.tr> Author: erenturkay Date: Wed Jul 16 21:14:47 2008 New Revision: 1552 Modified: trunk/shop/TODO trunk/shop/product/models.py trunk/shop/product/templatetags/shop_library.py trunk/shop/product/views.py Log: * fix category listing according to Active. * add get_active_products to Category class * then remove it from Product class, it's not needed. * On product info page, product's all childs are shown regardless of their active/deactive status. Fix this Modified: trunk/shop/TODO ================================================================= --- trunk/shop/TODO (original) +++ trunk/shop/TODO Wed Jul 16 21:14:47 2008 @@ -22,6 +22,7 @@ + Make sure that product can have more than 1 picture. - Calculate total price, considering tax + - On product info page, product's all childs are shown regardless of their active/deactive status. Fix this [*] User - Don't forget to control user's bill information as bill class doesn't have any check. Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Wed Jul 16 21:14:47 2008 @@ -43,6 +43,9 @@ def get_absolute_url(self): return u'/dukkan/kategori/%s/' % self.slug + def get_active_products(self): + return self.product_set.filter(active=True) + def get_separator(self): return ' :: ' @@ -194,9 +197,6 @@ def get_absolute_url(self): return u'/dukkan/urun/%s/%s/' % (self.category.slug, self.slug) - def get_active_products(self): - return self.objects.filter(active=True) - def is_in_stock(self): if self.stock > 0: return True @@ -262,5 +262,5 @@ search_fields = ["name"] - list_display = ("name", "stock", "_parents_repr") + list_display = ("name", "stock", "_parents_repr", "category", "active") Modified: trunk/shop/product/templatetags/shop_library.py ================================================================= --- trunk/shop/product/templatetags/shop_library.py (original) +++ trunk/shop/product/templatetags/shop_library.py Wed Jul 16 21:14:47 2008 @@ -21,7 +21,7 @@ if current_node == active_cat: attrs["class"] = "current" link = SubElement(temp_parent, 'a', attrs) - link.text = "%s (%s)" % (current_node.name, current_node.product_set.count()) + link.text = "%s (%s)" % (current_node.name, current_node.get_active_products().count()) if child_count > 0: new_parent = SubElement(temp_parent, 'ul') Modified: trunk/shop/product/views.py ================================================================= --- trunk/shop/product/views.py (original) +++ trunk/shop/product/views.py Wed Jul 16 21:14:47 2008 @@ -21,7 +21,7 @@ def get_category_products(request, slug): category = get_object_or_404(Category, slug=slug) - products = category.product_set.all() + products = category.get_active_products() return render_response(request, "category/category_list.html", {"products": products}) From oi-commits at pardus.org.tr Thu Jul 17 17:39:18 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 17 Jul 2008 17:39:18 +0300 (EEST) Subject: [Oi-commits] r1553 - in trunk/shop: . product templates/product Message-ID: <20080717143918.83A631384171@liste.pardus.org.tr> Author: erenturkay Date: Thu Jul 17 17:39:18 2008 New Revision: 1553 Modified: trunk/shop/TODO trunk/shop/product/models.py trunk/shop/templates/product/product_info.html Log: * only print active product childs Modified: trunk/shop/TODO ================================================================= --- trunk/shop/TODO (original) +++ trunk/shop/TODO Thu Jul 17 17:39:18 2008 @@ -14,7 +14,7 @@ [*] Category + Image for each category + Show how many products a category have in the category tree. E.g: T-shirts (14) - - Product listing for each category + + Product listing for each category [*] Product Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Thu Jul 17 17:39:18 2008 @@ -197,6 +197,12 @@ def get_absolute_url(self): return u'/dukkan/urun/%s/%s/' % (self.category.slug, self.slug) + # used in template's {% if %} statement. + # it checks whether the product is active and shows if it's active + + def is_active(self): + return self.active + def is_in_stock(self): if self.stock > 0: return True @@ -204,7 +210,7 @@ return False # We use them on template - # If a product have childs (t-shirt, for example), then the page acts differently + # If a product have childs (t-shirt, for example), then the page lists these products def have_child(self): if self.child.count() > 0: @@ -261,6 +267,6 @@ ) search_fields = ["name"] + list_filter = ["active"] list_display = ("name", "stock", "_parents_repr", "category", "active") - Modified: trunk/shop/templates/product/product_info.html ================================================================= --- trunk/shop/templates/product/product_info.html (original) +++ trunk/shop/templates/product/product_info.html Thu Jul 17 17:39:18 2008 @@ -16,9 +16,11 @@ {% if product.have_child %} {% for child in product.child.all %} + {% if child.is_active %}      ?r?n ?smi: {{ child.name }}
         ?r?n Fiyat?: {{ child.price }}
         ?r?n Sto?u: {{ child.stock }}

    + {% endif %} {% endfor %} {% else %} ?r?n Fiyat?: {{ child.price }}
    From oi-commits at pardus.org.tr Thu Jul 17 19:13:44 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 17 Jul 2008 19:13:44 +0300 (EEST) Subject: [Oi-commits] r1554 - in trunk: media/img templates templates/feedjack/oi Message-ID: <20080717161344.85710138412A@liste.pardus.org.tr> Author: jnmbk Date: Thu Jul 17 19:13:44 2008 New Revision: 1554 Added: trunk/media/img/oi-edergi-4-kapak.jpg (contents, props changed) Removed: trunk/media/img/oi-edergi-3-kapak.jpg Modified: trunk/templates/base.html trunk/templates/feedjack/oi/post_list.html Log: new e-zine Modified: trunk/templates/base.html ================================================================= --- trunk/templates/base.html (original) +++ trunk/templates/base.html Thu Jul 17 19:13:44 2008 @@ -77,7 +77,7 @@ Modified: trunk/templates/feedjack/oi/post_list.html ================================================================= --- trunk/templates/feedjack/oi/post_list.html (original) +++ trunk/templates/feedjack/oi/post_list.html Thu Jul 17 19:13:44 2008 @@ -103,7 +103,7 @@ From oi-commits at pardus.org.tr Thu Jul 17 19:16:05 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Thu, 17 Jul 2008 19:16:05 +0300 (EEST) Subject: [Oi-commits] r1555 - in branches/stable: media/img templates templates/feedjack/oi Message-ID: <20080717161605.8A5CB138412A@liste.pardus.org.tr> Author: jnmbk Date: Thu Jul 17 19:16:05 2008 New Revision: 1555 Added: branches/stable/media/img/oi-edergi-4-kapak.jpg - copied unchanged from r1554, trunk/media/img/oi-edergi-4-kapak.jpg Removed: branches/stable/media/img/oi-edergi-3-kapak.jpg Modified: branches/stable/templates/base.html branches/stable/templates/feedjack/oi/post_list.html Log: merge new e-zine Modified: branches/stable/templates/base.html ================================================================= --- branches/stable/templates/base.html (original) +++ branches/stable/templates/base.html Thu Jul 17 19:16:05 2008 @@ -77,7 +77,7 @@ Modified: branches/stable/templates/feedjack/oi/post_list.html ================================================================= --- branches/stable/templates/feedjack/oi/post_list.html (original) +++ branches/stable/templates/feedjack/oi/post_list.html Thu Jul 17 19:16:05 2008 @@ -103,7 +103,7 @@ From oi-commits at pardus.org.tr Fri Jul 18 14:00:14 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Fri, 18 Jul 2008 14:00:14 +0300 (EEST) Subject: [Oi-commits] r1556 - in trunk/shop: product templates/product Message-ID: <20080718110014.EB75B13840E2@liste.pardus.org.tr> Author: erenturkay Date: Fri Jul 18 14:00:14 2008 New Revision: 1556 Modified: trunk/shop/product/models.py trunk/shop/templates/product/product_info.html Log: yay, add tax support Modified: trunk/shop/product/models.py ================================================================= --- trunk/shop/product/models.py (original) +++ trunk/shop/product/models.py Fri Jul 18 14:00:14 2008 @@ -197,6 +197,9 @@ def get_absolute_url(self): return u'/dukkan/urun/%s/%s/' % (self.category.slug, self.slug) + def price_with_tax(self): + return (self.price + (self.price * self.tax.percentage)/100).normalize() + # used in template's {% if %} statement. # it checks whether the product is active and shows if it's active Modified: trunk/shop/templates/product/product_info.html ================================================================= --- trunk/shop/templates/product/product_info.html (original) +++ trunk/shop/templates/product/product_info.html Fri Jul 18 14:00:14 2008 @@ -18,12 +18,12 @@ {% for child in product.child.all %} {% if child.is_active %}      ?r?n ?smi: {{ child.name }}
    -      ?r?n Fiyat?: {{ child.price }}
    +      ?r?n Fiyat?: {{ child.price }} +KDV ({{ child.price_with_tax }})
         ?r?n Sto?u: {{ child.stock }}

    {% endif %} {% endfor %} {% else %} - ?r?n Fiyat?: {{ child.price }}
    - ?r?n Sto?u: {{ child.name }}
    + ?r?n Fiyat?: {{ product.price }} +KDV ({{ product.price_with_tax }})
    + ?r?n Sto?u: {{ product.stock }}
    {% endif %} {% endblock %} From oi-commits at pardus.org.tr Fri Jul 18 16:08:14 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Fri, 18 Jul 2008 16:08:14 +0300 (EEST) Subject: [Oi-commits] r1557 - in trunk: media/dijital/img/forum templates/forum Message-ID: <20080718130814.CBC5913840CA@liste.pardus.org.tr> Author: jnmbk Date: Fri Jul 18 16:08:13 2008 New Revision: 1557 Added: trunk/media/dijital/img/forum/add_poll.png (contents, props changed) trunk/media/dijital/img/forum/hide.png (contents, props changed) trunk/media/dijital/img/forum/hide_topic.png (contents, props changed) trunk/media/dijital/img/forum/lock_topic.png (contents, props changed) trunk/media/dijital/img/forum/merge_topic.png (contents, props changed) trunk/media/dijital/img/forum/move_topic.png (contents, props changed) trunk/media/dijital/img/forum/unhide.png (contents, props changed) trunk/media/dijital/img/forum/unlock_topic.png (contents, props changed) trunk/media/dijital/img/forum/unstick_topic.png (contents, props changed) Removed: trunk/media/dijital/img/forum/delete.jpg trunk/media/dijital/img/forum/lock.jpg trunk/media/dijital/img/forum/move.jpg trunk/media/dijital/img/forum/unlock.jpg Modified: trunk/templates/forum/topic.html Log: new forum buttons Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Fri Jul 18 16:08:13 2008 @@ -16,7 +16,7 @@
    izle
    {% endif %} {% if perms.forum.can_create_poll and not topic.poll %} -
    add_poll
    +
    anket ekle
    {% endif %}

@@ -86,12 +86,12 @@ {% endif %} {% if perms.forum.can_hide_post and not forloop.first and not post.hidden %}
- hide + gizle
{% endif %} {% if perms.forum.can_hide_post and not forloop.first and post.hidden %}
- unhide + gizle
{% endif %} {% if perms.forum.delete_post and not forloop.first %} @@ -148,28 +148,28 @@
Yan?tla
{% endif %} {% if perms.forum.can_lock_topic and topic.locked %} -
Kilidi kald?r
+
Kilidi kald?r
{% endif %} {% if perms.forum.can_merge_topic %} -
merge
+
Ba?l??? Birle?tir
{% endif %} {% if perms.forum.can_move_topic %} -
Ba?l??? Ta??
+
Ba?l??? Ta??
{% endif %} {% if perms.forum.can_hide_topic and not topic.hidden %} -
hide
+
Ba?l??? Gizle
{% endif %} {% if perms.forum.can_hide_topic and topic.hidden %} -
unhide
+
Ba?l??? G?ster
{% endif %} {% if perms.forum.can_stick_topic and not topic.sticky %} -
stick
+
stick
{% endif %} {% if perms.forum.can_stick_topic and topic.sticky %} -
unstick
+
Sabitli?i Kald?r
{% endif %} {% if perms.forum.can_lock_topic and not topic.locked %} -
Kilitle
+
Kilitle
{% endif %} {% if perms.forum.change_topic %}
edit_topic
From oi-commits at pardus.org.tr Fri Jul 18 16:10:56 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Fri, 18 Jul 2008 16:10:56 +0300 (EEST) Subject: [Oi-commits] r1558 - trunk/templates/forum Message-ID: <20080718131056.44CFB13840CA@liste.pardus.org.tr> Author: jnmbk Date: Fri Jul 18 16:10:55 2008 New Revision: 1558 Modified: trunk/templates/forum/topic.html Log: fix wrong button Modified: trunk/templates/forum/topic.html ================================================================= --- trunk/templates/forum/topic.html (original) +++ trunk/templates/forum/topic.html Fri Jul 18 16:10:55 2008 @@ -91,7 +91,7 @@ {% endif %} {% if perms.forum.can_hide_post and not forloop.first and post.hidden %}
- gizle + g?ster
{% endif %} {% if perms.forum.delete_post and not forloop.first %} From oi-commits at pardus.org.tr Fri Jul 18 16:51:06 2008 From: oi-commits at pardus.org.tr (oi-commits at pardus.org.tr) Date: Fri, 18 Jul 2008 16:51:06 +0300 (EEST) Subject: [Oi-commits] r1559 - in branches/stable: media/dijital/img/forum templates/forum Message-ID: <20080718135106.A193913840CF@liste.pardus.org.tr> Author: jnmbk Date: Fri Jul 18 16:51:06 2008 New Revision: 1559 Added: branches/stable/media/dijital/img/forum/add_poll.png - copied unchanged from r1558, trunk/media/dijital/img/forum/add_poll.png branches/stable/media/dijital/img/forum/hide.png - copied unchanged from r1558, trunk/media/dijital/img/forum/hide.png branches/stable/media/dijital/img/forum/hide_topic.png - copied unchanged from r1558, trunk/media/dijital/img/forum/hide_topic.png branches/stable/media/dijital/img/forum/lock_topic.png - copied unchanged from r1558, trunk/media/dijital/img/forum/lock_topic.png branches/stable/media/dijital/img/forum/merge_topic.png - copied unchanged from r1558, trunk/media/dijital/img/forum/merge_topic.png branches/stable/media/dijital/img/forum/move_topic.png - copied unchanged from r1558, trunk/media/dijital/img/forum/move_topic.png branches/stable/media/dijital/img/forum/unhide.png - copied unchanged from r1558, trunk/media/dijital/img/forum/unhide.png branches/stable/media/dijital/img/forum/unlock_topic.png - copied unchanged from r1558, trunk/media/dijital/img/forum/unlock_topic.png branches/stable/media/dijital/img/forum/unstick_topic.png - copied unchanged from r1558, trunk/media/dijital/img/forum/unstick_topic.png Removed: branches/stable/media/dijital/img/forum/delete.jpg branches/stable/media/dijital/img/forum/lock.jpg branches/stable/media/dijital/img/forum/move.jpg branches/stable/media/dijital/img/forum/unlock.jpg Modified: branches/stable/templates/forum/topic.html Log: merge new buttons Modified: branches/stable/templates/forum/topic.html ================================================================= --- branches/stable/templates/forum/topic.html (original) +++ branches/stable/templates/forum/topic.html Fri Jul 18 16:51:06 2008 @@ -16,7 +16,7 @@
izle
{% endif %} {% if perms.forum.can_create_poll and not topic.poll %} -
add_poll
+
anket ekle
{% endif %}

@@ -86,12 +86,12 @@ {% endif %} {% if perms.forum.can_hide_post and not forloop.first and not post.hidden %}
- hide + gizle
{% endif %} {% if perms.forum.can_hide_post and not forloop.first and post.hidden %}
- unhide + g?ster
{% endif %} {% if perms.forum.delete_post and not forloop.first %} @@ -148,28 +148,28 @@
Yan?tla
{% endif %} {% if perms.forum.can_lock_topic and topic.locked %} -
Kilidi kald?r
+
Kilidi kald?r
{% endif %} {% if perms.forum.can_merge_topic %} -
merge
+
Ba?l??? Birle?tir
{% endif %} {% if perms.forum.can_move_topic %} -
Ba?l??? Ta??
+
Ba?l??? Ta??
{% endif %} {% if perms.forum.can_hide_topic and not topic.hidden %} -
hide
+
Ba?l??? Gizle
{% endif %} {% if perms.forum.can_hide_topic and topic.hidden %} -
unhide
+
Ba?l??? G?ster
{% endif %} {% if perms.forum.can_stick_topic and not topic.sticky %} -
stick
+
stick
{% endif %} {% if perms.forum.can_stick_topic and topic.sticky %} -
unstick
+
Sabitli?i Kald?r
{% endif %} {% if perms.forum.can_lock_topic and not topic.locked %} -
Kilitle
+
Kilitle
{% endif %} {% if perms.forum.change_topic %}
edit_topic