Re: Match from list in URLconf

2007-07-29 Thread Matt the Destroyer

I missed a quote, it should be:
(r'^(?P\w+)/$', 'project.views.user_page')

On Jul 29, 10:16 pm, Matt the Destroyer <[EMAIL PROTECTED]>
wrote:
> Perhaps try adding a URL pattern like the following:
>  (r^(?P\w+)/$', 'project.views.user_page')
>
> Your view function (called "user_page") will now accept "user_name" as
> an argument in addition to the request object.  I should warn you that
> using that regular expression could be dangerous, as it'll accept any
> string past the root url.  That having been said, I'm sure there's a
> better way to do this, but this should get you started.
>
> On Jul 29, 7:17 pm, Matt <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hello list,
>
> > I was wondering if the following is possible with the URLconf:
>
> > I'd like the URL regex to match part of a URL if it exists within a
> > specific list of values. For example, if you wanted to direct users to
> > their area of your site, you might have something like this:
>
> >www.mysite.com/matt--> go to my areawww.mysite.com/jess--> go to Jess' 
> >areawww.mysite.com/mark--> go to Mark's area
>
> > In this situation you'd want a URL match for every user on your site,
> > which is obviously database driven. I'd like to be able to pull a list
> > of all the users out of the database and use a single line in my
> > URLconf to acheive the above.
>
> > This could all be acheived using another view to determine whether the
> > given name was a valid user, and if so direct you to the appropriate
> > view, but wouldn't that prevent you using Django's generic views?
>
> > Thanks,
> > Matt.- Hide quoted text -
>
> - Show quoted text -


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Match from list in URLconf

2007-07-29 Thread Matt the Destroyer

Perhaps try adding a URL pattern like the following:
 (r^(?P\w+)/$', 'project.views.user_page')

Your view function (called "user_page") will now accept "user_name" as
an argument in addition to the request object.  I should warn you that
using that regular expression could be dangerous, as it'll accept any
string past the root url.  That having been said, I'm sure there's a
better way to do this, but this should get you started.

On Jul 29, 7:17 pm, Matt <[EMAIL PROTECTED]> wrote:
> Hello list,
>
> I was wondering if the following is possible with the URLconf:
>
> I'd like the URL regex to match part of a URL if it exists within a
> specific list of values. For example, if you wanted to direct users to
> their area of your site, you might have something like this:
>
> www.mysite.com/matt--> go to my areawww.mysite.com/jess--> go to Jess' 
> areawww.mysite.com/mark--> go to Mark's area
>
> In this situation you'd want a URL match for every user on your site,
> which is obviously database driven. I'd like to be able to pull a list
> of all the users out of the database and use a single line in my
> URLconf to acheive the above.
>
> This could all be acheived using another view to determine whether the
> given name was a valid user, and if so direct you to the appropriate
> view, but wouldn't that prevent you using Django's generic views?
>
> Thanks,
> Matt.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Template widget size

2006-07-27 Thread Matt the Destroyer

size=30 simply tells the browser to make the input field a size of 30
characters wide.  it has no bearing on input data or transmission.

in the past, i have simply hard-coded my own input fields into my
templates so I can directly control the size and other attributes that
i might want (such as onclick et al).


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---