Re: DJANGO 1.1 dynamic url on static javascript

2017-05-30 Thread ludovic coues
Everything looking like {% %} or {{ }} are template tag. Your js file are not processed by the templating engine so they can be served really fast directly by your web server and not by django which is a lot slower. One solution would be to but the url in your html file. Add a

DJANGO 1.1 dynamic url on static javascript

2017-05-30 Thread lenin david
*Context* I am adding a static javascript file to my **ModelForm** on this way forms.py class SomeForm(forms.ModelForm): class Media: js = ('some-javascript.js',) *Problem* On this javascript I need send a GET request to a rest endpoint hosted on same application

DJANGO 1.1 dynamic url on static javascript

2017-05-30 Thread lenin david
## Context I am adding a static javascript file to my **ModelForm** on this way forms.py class SomeForm(forms.ModelForm): class Media: js = ('some-javascript.js',) ## Problem On this javascript I need send a GET request to a rest endpoint hosted on same

pinax-project-account login redirect to dynamic url

2014-05-06 Thread Daniel Kane
I'm writing a web app that uses the pinax-project-account and bootstrap. When a user logs in the login view should grab the ACCOUNT_LOGIN_REDIRECT_URL and redirect the user to it. There seems to be an issue with dynamic urls though because when I do this with a static /profile/ url, there

Re: Dynamic URL for representatives DB

2010-02-01 Thread Nick
You are exactly right. Thanks, this was a learning curve I was having trouble getting over. You have been an immense help and are a credit to this online community. On Feb 1, 3:42 am, Daniel Roseman wrote: > On Feb 1, 4:30 am, Nick wrote: > > > I'm

Re: Dynamic URL for representatives DB

2010-02-01 Thread Daniel Roseman
On Feb 1, 4:30 am, Nick wrote: > I'm definitely going to continue looking into this. But if you have > any advice on how I can store the rest of the fields from the DB to > call up on the individual reps pages I would greatly appreciate it. > Right now I am only pulling in the

Re: Dynamic URL for representatives DB

2010-01-31 Thread Nick
I'm definitely going to continue looking into this. But if you have any advice on how I can store the rest of the fields from the DB to call up on the individual reps pages I would greatly appreciate it. Right now I am only pulling in the last name and first name and need to return all of the

Re: Dynamic URL for representatives DB

2010-01-31 Thread Nick
Just checked again and I'm getting the output I was looking for. Thanks for the help. I guess the server was just taking a little time to pick up changes to the URL confs. On Jan 31, 5:58 pm, Nick wrote: > Daniel, > > Thanks for the quick reply.  I have made the adjustments

Re: Dynamic URL for representatives DB

2010-01-31 Thread Nick
Daniel, Thanks for the quick reply. I have made the adjustments to the URLS and the views and am getting a 404 error Not Found The requested URL /Government/reps/Prater_David was not found on this server. (using the entry for David Prater) I'm not really sure why it isn't picking up the URL.

Re: Dynamic URL for representatives DB

2010-01-31 Thread Daniel Roseman
On Jan 31, 7:29 pm, Nick wrote: > Thanks in advance for anyone answering this thread. > > I am building a DB of local government representatives. My goal is to > spit out a general list of the reps and a detailed bio page for each > rep. > > The URL structure I would like to

Dynamic URL for representatives DB

2010-01-31 Thread Nick
Thanks in advance for anyone answering this thread. I am building a DB of local government representatives. My goal is to spit out a general list of the reps and a detailed bio page for each rep. The URL structure I would like to have is 'government/reps/list' for a list of all of the Reps and

Re: How do you handle apostrophe and spaces in dynamic url?

2009-05-12 Thread George Song
On 5/12/2009 1:10 PM, Thierry wrote: > I have a table with the following names: > > id name > 1 Foo > 2 Foo goo > 3 Foo's goo > > I want to use the name to construct my url. I don't have a problem > constructing Foo: > > localhost/foo > > But how am I supposed to

Re: How do you handle apostrophe and spaces in dynamic url?

2009-05-12 Thread Alex Gaynor
On Tue, May 12, 2009 at 3:10 PM, Thierry wrote: > > I have a table with the following names: > > id name > 1 Foo > 2 Foo goo > 3 Foo's goo > > I want to use the name to construct my url. I don't have a problem > constructing Foo: > > localhost/foo >

How do you handle apostrophe and spaces in dynamic url?

2009-05-12 Thread Thierry
I have a table with the following names: id name 1 Foo 2 Foo goo 3 Foo's goo I want to use the name to construct my url. I don't have a problem constructing Foo: localhost/foo But how am I supposed to handle "Foo goo" and "Foo's goo"? Will I need to create a 3rd

Re: get function list inside module was: Re: dynamic url pattern

2009-03-26 Thread Karen Tracey
On Thu, Mar 26, 2009 at 12:33 PM, Alessandro wrote: > On Thu, Mar 26, 2009 at 4:44 PM, Alessandro > wrote: > >> >> Is it possible to get a list of function names inside a module? > > > I need to know the names of the functions in a

get function list inside module was: Re: dynamic url pattern

2009-03-26 Thread Alessandro
On Thu, Mar 26, 2009 at 4:44 PM, Alessandro wrote: > > Is it possible to get a list of function names inside a module? I need to know the names of the functions in a module. is it possible ? -- Alessandro Ronchi Skype: aronchi http://www.alessandroronchi.net

Re: dynamic url pattern

2009-03-26 Thread Tim Chase
Alessandro Ronchi wrote: > I want to make a regxep in my urls.py that takes the name of the view from > the url. > Something like: > > > (r'^views/(?P\w+)/', 'myproject.database.reports.' + name), > > is it possible? I've a lot of views with the same rule and I want to make > them be available

Re: dynamic url pattern

2009-03-26 Thread Alessandro
On Thu, Mar 26, 2009 at 4:21 PM, Thomas Guettler wrote: > # views.py (untested) > def wrapper(request, name): >module=__import__("myproject.database.reports.%s" % name, globals(), > locals(), [name]) >method=getattr(module, name) >return method(request) > this

Re: dynamic url pattern

2009-03-26 Thread Thomas Guettler
Alessandro Ronchi schrieb: > I want to make a regxep in my urls.py that takes the name of the view from > the url. > Something like: > > > (r'^views/(?P\w+)/', 'myproject.database.reports.' + name), > > is it possible? I've a lot of views with the same rule and I want to make > them be

dynamic url pattern

2009-03-26 Thread Alessandro Ronchi
I want to make a regxep in my urls.py that takes the name of the view from the url. Something like: (r'^views/(?P\w+)/', 'myproject.database.reports.' + name), is it possible? I've a lot of views with the same rule and I want to make them be available without duplicate names 3 or 4 times.

Re: Redirect user to dynamic url after login

2008-10-11 Thread F.Pighi
On Oct 11, 7:07 pm, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > You can redirect to something like /logged_in, this view has access to > request.user so can redirect you to /users/username/ Thank you for the tips. It worked :-) --~--~-~--~~~---~--~~ You received

Re: Redirect user to dynamic url after login

2008-10-11 Thread Arnaud Delobelle
; > How can I do it? I tried using the default login view it seems I have > to use the LOGIN_REDIRECT_URL variable in the settings.py, but I don't > know how to specify a dynamic url. > > Should I write my own custom login view or is there a way to > accomplish this even with the default

Redirect user to dynamic url after login

2008-10-11 Thread F.Pighi
in the settings.py, but I don't know how to specify a dynamic url. Should I write my own custom login view or is there a way to accomplish this even with the default one? What am I missing here? Thank you very much --~--~-~--~~~---~--~~ You received this message

Re: Dynamic URL

2008-08-27 Thread lingrlongr
Also, convention seems to be to spell out the field names. Because of a different namespaces, you shouldn't have to worry about too much name clashing. And if you don't provide an ID for your model, one is automatically created for you. For example: class Category(models.Model): name

Re: Dynamic URL

2008-08-27 Thread lingrlongr
Your problem is here: def category_entry(request, category): entries_in_cat = Entry.objects.filter(entry_cat=category) return render_to_response('blog/index.html', locals()) Remember, the value of "category" is a string. One way or another you need adjust the filter. Something

Dynamic URL

2008-08-27 Thread djandrow
I'm trying to create a situation where you can bring up all the blog entries in a category through the URL. I've got this in my urls.py: from django.conf.urls.defaults import * from akonline.views import current_datetime urlpatterns = patterns('', (r'^test/$', 'address.blog.views.blog'),

Re: Alpha Chars in dynamic url?

2008-07-10 Thread Norman Harman
lukeqsee wrote: > Thanks, it worked. > > On Jul 10, 1:48 pm, "Scott Moonen" <[EMAIL PROTECTED]> wrote: >> Luke, this should work. Here's an example I use: >> >> *urls.py:* >> url('^user/(?P\w+)/$', user.view) Not sure what you meant by "alpha chars" but \w+ matches more than just [A-Za-z]+

Re: Alpha Chars in dynamic url?

2008-07-10 Thread lukeqsee
t_object_or_404(User, username = user_id) > > Hope that helps, > >   -- Scott > > > > On Thu, Jul 10, 2008 at 1:42 PM, lukeqsee <[EMAIL PROTECTED]> wrote: > > > Sorry I didn't my last post clear > > what I want is mysite.com/people/ {dynamic url ie. name)/

Re: Alpha Chars in dynamic url?

2008-07-10 Thread Scott Moonen
wrote: > > Sorry I didn't my last post clear > what I want is mysite.com/people/ {dynamic url ie. name)/ > > On Jul 10, 1:34 pm, lukeqsee <[EMAIL PROTECTED]> wrote: > > Can you use alpha characters in the urls? like mysite.com/people/ > > [name]/ > >

Re: Alpha Chars in dynamic url?

2008-07-10 Thread lukeqsee
Sorry I didn't my last post clear what I want is mysite.com/people/ {dynamic url ie. name)/ On Jul 10, 1:34 pm, lukeqsee <[EMAIL PROTECTED]> wrote: > Can you use alpha characters in the urls? like mysite.com/people/ > [name]/ > > Is this possible? Haven't found anything in

Alpha Chars in dynamic url?

2008-07-10 Thread lukeqsee
Can you use alpha characters in the urls? like mysite.com/people/ [name]/ Is this possible? Haven't found anything in the documentation relating to it. Thanks, Luke --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

dynamic url use case

2007-12-17 Thread Faheem Mitha
Hi everyone, I have the following situation, and I would value advice. I have two classes, FolderUpload and FileUpload as given below. I want a dynamic upload_to url in FileUpload, such that the upload to field depends on the value of the folder field, specifically path field. I realist that