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
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
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.
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('',
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
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
6 matches
Mail list logo