Re: Change the url

2009-01-09 Thread Briel
Hi Praveen It's not always an easy task being a developer. However, I don't see the point in using Django, if you're not also using all of the tools that available because you need a designer that only know strict HTML, and don't know anything about the process. With all the vars and tags you're

Re: Change the url

2009-01-09 Thread Praveen
Hi Briel again my senior gave me other idea and they gave me a nice reason why they want me to use get_absolute_url() Given our new understanding of what the best practice is, the workflow for a template designer, who shouldn’t need to know or understand programming, is: 1. Ignore the documen

Re: Change the url

2009-01-08 Thread Praveen
Thank you so much Briel. Really you gave me a nice explanation and the same think i was thinking but was not able to make understand to my senior. let me put your idea to my senior and lets see what they say.. but really i appreciate you and for your politeness. On Jan 8, 6:43 pm, Briel wrote: >

Re: Change the url

2009-01-08 Thread Briel
Hi Praveen I personally would prefer naming the urls rather than using the get_absolute_url. Both can accomplish your goal, but naming the urls is a more robust and in other ways a better solution. If you in a week decide that the url should not be /category/... but instead /whatever/... you woul

Re: Change the url

2009-01-08 Thread Kip Parker
You can use reverse() in your get_absolute_url method, it works the same as the url template tag in using your url patterns to generate the url. http://docs.djangoproject.com/en/dev/topics/http/urls/?from=olddocs#reverse On Jan 8, 12:58 pm, Praveen wrote: > Hi Briel i am totally confused now.

Re: Change the url

2009-01-08 Thread Praveen
Hi Briel i am totally confused now. My senior told me to write get_absolute_url so i wrote get_absolute_url like this class Listing_channels(models.Model): list_channel = models.CharField(max_length = 20) visibility = models.BooleanField() def __unicode__(self): return self.l

Re: Change the url

2009-01-08 Thread Briel
Using urls with names will solve your problem. Basically if you change your urls.py like this: url( r'^category/listing_view/(?P\w+)/$', 'mysite.library.views.listing_view', name = 'name_for_this_view' ), What I have done is to add a name to the url for convenience

Re: Change the url

2009-01-08 Thread Praveen
Hi Malcolm i am very new bie of Django. i read through get_absolute_url but do not know how to use. What you have given the answer i tried with that and its working fine but my senior asked me what will happen if i change the site name then every where you will have to change url mysite.library.vi

Re: Change the url

2009-01-08 Thread Praveen
Thank you so much Malcolm. every one gives only the link and tell to read but your style of solving the problem is amazing. how you explained me in a nice way that i can never ever find in djangoproject.com. Thanks you so much malcom On Jan 8, 3:23 pm, Malcolm Tredinnick wrote: > I'm going to tr

Re: Change the url

2009-01-08 Thread Briel
Hi. Instead of manually writing the url, you can instead use the {% url %} tag, then Django would figure out what the correct url is. If you are using url tags you should considder using named urls. The link with url tag would end up something like this: {{n.list_channel}} read about the url tag

Re: Change the url

2009-01-08 Thread Malcolm Tredinnick
I'm going to trim your code to what looks like the relevant portion of the HTML template, since that's where the easiest solution lies. On Thu, 2009-01-08 at 02:02 -0800, Praveen wrote: [...] > > list_listing.html > > > Sight Seeings > > {%if listing_result %} > {% for n in listing_re

Change the url

2009-01-08 Thread Praveen
MODELS.py class Listing_channels(models.Model): list_channel = models.CharField(max_length = 20) visibility = models.BooleanField() def __unicode__(self): return self.list_channel class Listing(models.Model): name = models.CharField(max_length=20) descriptio