Is there some trick to parse
http://www.example.com/foo/42
such that "42" becomes an integer parameter to the view function,
instead of a string?
Right now I have to do:
from my.app.views import foo
urlpatterns = patterns('',
(r'foo/(?P\d+)/?$', foo),
)
my/app/views.py
def foo(reque
I would like tighten the link from URLs to instances of Models and
have something like:
import foo.FooModel
urlpatterns = patterns('',
(r'foo/create/?$', 'foo.FooModel.create'),
(r'foo/(?P\d+)/?$', 'foo.FooModel.view'),
(r'foo/(?P\d+)/edit$', 'foo.FooModel.edit'
I've spent the last few hours trying variations on upload_to for my
FileField path generator get_file_path(instance,filename) that will
allow me to include the username from the POST HttpRequest object. No
luck. Does anyone have any suggestions on how to do this? My
instance does have a "user"
I have a model Foo and a corresponding FooForm with the requisite
inner Meta class and model=Foo. I want a url example.com/newfoo to
bring up a blank form to allow the creation of a new Foo instance. It
is not obvious to me how this should be done. I reckon it is
something very roughly like:
4 matches
Mail list logo