poll tutorial 4

2013-01-26 Thread Fatih Tiryakioglu
Hi all, I have encountered following error in the django tutorial. It is a reverse function error and the problematic line: return HttpResponseRedirect(reverse('polls.views.results', args=(p.id,))) In the "vote" view, I choose one of the choices, and click the vote button. Instead of "results"

Re: poll tutorial 4

2013-01-26 Thread Fatih Tiryakioglu
I think somebody just updated the tutorial document as return HttpResponseRedirect(reverse('polls:results', args=(p.id,))) Thanks.. -- 26 Ocak 2013 Cumartesi 13:54:04 UTC+2 tarihinde Fatih Tiryakioglu yazdı: > > Hi all, > > I have encountered following error in the dj

how to evaluate "cities/countries of the world" static table for an application.

2013-02-24 Thread Fatih Tiryakioglu
Hello all, Is there any shortcut for evaluating such a database table, or should I collect myself all this information. Please help. If you prefer a package which one do you prefer, or all of them is workable. Thanks. -- -- You received this message because you are subscribed to the Google

reverse foreign key relationship usage

2013-03-05 Thread Fatih Tiryakioglu
Hello all, In Appendix B:Database API, it says "related_name (keyword) is particularly useful if a model has two foreign keys to the same second model." which is about 'related_name' keyword used reverse foreign key relationships. e.g. blog = ForeignKey(Blog, related_name='entries'). What does

Re: reverse foreign key relationship usage

2013-03-06 Thread Fatih Tiryakioglu
ignKey(Person, related_name='used_car') > > In case of not having a different related_name for each of those two > relations, you wouldn't be able to get the person's car or the car this > person uses. (This person may own a car but use his company car, or a &g

queryset minimization

2013-03-06 Thread Fatih Tiryakioglu
Hi all, Is there any shortcut (minimum db hit) for the following querysets: p = Person.objects.get(mail="pers...@ex.com") p.password & form.password comparison and it is ok. #reversing to the person's groupregisteration, for example: reg = p.groupregistration_set.all() #groupregistratin model is

Re: queryset minimization

2013-03-07 Thread Fatih Tiryakioglu
ll take what is > currently 1 + (number of group registrations for the user) queries and > turn it into 2 queries: > > reg = p.groupregistration_set.all().select_related('group') > > More on select_related: > https://docs.djangoproject.com/en/dev/ref/models/querys

static file rendering help

2013-04-04 Thread Fatih Tiryakioglu
Hi all, I want to render back "user uploaded images" via template. I pass the shortcuts to the template, but template can't show it: only small image symbol. How can i show it up. I tryed some 'MEDIA_ROOT', 'MEDIA_URL' settings, and read some info, but i couldn't figure out.. I appreciate your

Re: static file rendering help

2013-04-05 Thread Fatih Tiryakioglu
'/unnamed/' STATIC_ROOT = '' STATIC_URL = '/static/' What is wrong.. -- 5 Nisan 2013 Cuma 20:26:40 UTC+3 tarihinde Navid Shaikh yazdı: > > > > On Friday, April 5, 2013 11:16:00 AM UTC+5:30, Fatih Tiryakioglu wrote: >> >> Hi all, >> &g

Re: static file rendering help

2013-04-05 Thread Fatih Tiryakioglu
t;/home/mehmet/internet_projeleri/site4ust/unnamed/60830071673353216.jpg" > /> > ...instead of... > /> > > > On Fri, Apr 5, 2013 at 1:43 PM, Fatih Tiryakioglu > > > wrote: > >> Thank you. >> >> The shortcut of the picture: >> /

couldn't render a media image via a template

2013-04-06 Thread Fatih Tiryakioglu
And in the settings: MEDIA_ROOT = '/home/mehmet/internet_projeleri/site4ust/site4/media' MEDIA_URL = '/media/' STATIC_ROOT = ' ' STATIC_URL = '/static/' I have a template in '/home/mehmet/internet_projeleri/site4ust/site4/templatelerim', which has the following line: http://groups.google.com/

Re: couldn't render a media image via a template

2013-04-06 Thread Fatih Tiryakioglu
.giris'), url(r'^anasayfa/$', 'unnamed.views.anasayfa'), url(r'^upload/$', 'unnamed.views.dosya_yukle'), url(r'^media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) What is the problem.. On

Re: couldn't render a media image via a template

2013-04-06 Thread Fatih Tiryakioglu
It doesn't work.. -- On Saturday, April 6, 2013 2:46:05 PM UTC+3, Avnesh Shakya wrote: > > try it.. > > create one more folder media and put that media folder inside this new > folder > and then run.. > > regards, > Avnesh Shakya > > On Sat, Apr

Re: couldn't render a media image via a template

2013-04-07 Thread Fatih Tiryakioglu
at 4:11 PM, Fatih Tiryakioglu > > > wrote: > > MEDIA_ROOT = '/home/mehmet/internet_projeleri/site4ust/site4/media' > This is the absolute path to your media directory. > > MEDIA_URL = '/media/' > This means files/directories at MEDIA_ROOT directory

how to cat'ing string in html file

2013-04-07 Thread Fatih Tiryakioglu
Hello, In a html template file, how can I concatenate strings: I find the solution below: {% with "/media/"|add:"{{ i.no }}"|add:".jpg" as template_str %} But When I use: , template_str is /media/{{ i.no }}.jpg How can I evaluate /media/8778877

Re: how to cat'ing string in html file

2013-04-07 Thread Fatih Tiryakioglu
Thank you again Pankaj, But evaluated string is just ".jpg" . "/media/" and i.no are absent.. On Sunday, April 7, 2013 12:16:34 PM UTC+3, psjinx wrote: > > On Sun, Apr 7, 2013 at 1:11 PM, Fatih Tiryakioglu > > > wrote: > > > {% with "/me

jquery doesn't give selected option of a dropbox

2013-05-07 Thread Fatih Tiryakioglu
Hi all, I have a jquery js code in a template like that: jQuery(document).ready(function(){ jQuery("select").change(function(){ var str = $('select option:selected').text(); alert(str); }); }); and, a select form which is handled by

how to get count of each distinct value

2013-11-22 Thread Fatih Tiryakioglu
Hi all, How can I get distribution of values in a field? For example, I have the scores below: (score) (raw1)1 (raw2)1 (raw3)3 (raw4)4 (raw5)4 (raw6)5 (raw7)8 (raw8)8 (raw9)9 (raw10)10 I want to have a resu

Re: how to get count of each distinct value

2013-11-22 Thread Fatih Tiryakioglu
Thank you. -- 22 Kasım 2013 Cuma 18:07:47 UTC+2 tarihinde larry@gmail.com yazdı: > > On Fri, Nov 22, 2013 at 10:44 AM, Fatih Tiryakioglu > > > wrote: > >> Hi all, >> >> How can I get distribution of values in a field? For example, I have the >&g

how to load and render "static .txt file content" from django template

2013-12-07 Thread Fatih Tiryakioglu
Hi all, I want to render a static .txt file from django template, but I can't load it. I tried some combinations. Here is some of them: src="shortcut/to/text-file.txt" How can I load the context of this file? Thanks all. Note: I can render static image files, so it

text media files for comments

2014-01-13 Thread Fatih Tiryakioglu
Hi all, I want to render a static media .txt file from django template, but I can't load it. Should I use database for text comments, or is it better statatic text files like image files in media folder. Any help is appreciated. -- You received this message because you are subscribed to the

render .txt file in django template

2014-01-30 Thread Fatih Tiryakioglu
Hi all, Could you please show me how can I render .txt static files (they are user comments) in django template? I couldn't resolve that issue for a month.. I appreciate your help. -- -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

Re: render .txt file in django template

2014-01-30 Thread Fatih Tiryakioglu
n your view > 2. Read it into a context variable. > 3. Render the context variable in your template > > On Thursday, January 30, 2014 3:29:29 PM UTC-6, Fatih Tiryakioglu wrote: >> >> Hi all, >> >> Could you please show me how can I render .txt static files (they