Re: Embedding A List in urlpatterns

2009-09-17 Thread Thomas
Thanks. I had heard about 'slugs' but haven't gotten far enough to find out what they were yet. I managed to do a simplified version of what you're explaining by matching any alphanumeric character within the 'jobs' URL section. I did add a second argument to the view and am able to get things

Re: Embedding A List in urlpatterns

2009-09-17 Thread Daniel Roseman
On Sep 17, 4:10 pm, Thomas wrote: > Hello, > > I'm learning Django and have some questions regarding passing data to > urlpatterns.  Right now, I have something like this in my urls.py: > > urlpatterns = patterns('', >     (r'^$', index), >     (r'^list_jobs/', list_jobs), > ) > > This works fi

Re: Embedding A List in urlpatterns

2009-09-17 Thread Thomas
Thanks for the help. I can see how I can do something like: (r'job/(\w+)/$', job_details), The job_details view can query the DB to see if that job is there, and then display it. It looks like I need to learn more about the () matching syntax within the raw string. Karen, thanks for the link.

Re: Embedding A List in urlpatterns

2009-09-17 Thread Tiago Serafim
Hi Thomas, When you define the urls patterns, you don't have to specify each possibility. What you do is create a pattern that can match all the values that might be there and, then, on your view, you check to see if they exist on the DB. One possible way is like this: urlpatterns = patterns('',

Re: Embedding A List in urlpatterns

2009-09-17 Thread Karen Tracey
On Thu, Sep 17, 2009 at 11:10 AM, Thomas wrote: > > Hello, > > I'm learning Django and have some questions regarding passing data to > urlpatterns. Right now, I have something like this in my urls.py: > > urlpatterns = patterns('', >(r'^$', index), >(r'^list_jobs/', list_jobs), > ) > > Th

Embedding A List in urlpatterns

2009-09-17 Thread Thomas
Hello, I'm learning Django and have some questions regarding passing data to urlpatterns. Right now, I have something like this in my urls.py: urlpatterns = patterns('', (r'^$', index), (r'^list_jobs/', list_jobs), ) This works fine. I.e., any URL that matches ^list_jobs/ is handled b