Try updating to the latest revision, there was a bug I fixed a few days
ago that was causing this error for a lot of people. If it still
doesn't work, please pastebin your model, and let us know the database
system you are using and the steps taken.
Chris
--~--~-~--~~~--
Search on google gave:
http://www.woodpecker.org.cn:9081/classes/050925-CPUG/django_reference_sheet.pdf#search=%22django%20reference%20sheet%22
http://code.djangoproject.com/wiki/DjangoCheatSheet
Chris
--~--~-~--~~~---~--~~
You received this message because you
Either that, or use a custom manipulator and override the save method
there. Depends on if the processing will always need to be done when
saving or just done with the form data. If it's the form data, probably
best to put it in a manipulator. If you want, just create a manipulator
and override it
See:
http://www.djangoproject.com/documentation/model_api/#unique-together
Cheers,
Chris
--~--~-~--~~~---~--~~
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@goog
> Oh, I see where you're going with it. Just hide the interface from the
> user. That's a great idea, I still need a way though to enforce it so
> that carefully crafted POST requests don't allow unauthorized users
> from breaking things.
That's true, maybe using the custom manipulator would han
> Thanks, that's a neat trick, though from the surface I'm not 100% sure
> it will do what I'm thinking. I'll have to investigate further. My
> intuition tells me I need to do the checks in the model, maybe with a
> save hook, not in the template; but I may be off on that.
Maybe, but if you do i
Howdy,
For the permission checking, you could override the admin template and
add auth checking in there for the various permissions you want to
check for. See:
http://code.djangoproject.com/wiki/ExtendingAdminTemplates for more
details on this. And in the auth documents there is info on how to
a
Nothing right now. Currently the admin interface doesn't use any AJAX,
but it has been under discussion for a while to implement it.
If you did wish to use it, you could probably modify the admin
interface fairly easily to implement it (w/o changing the actual
django.contrib.admin) package. There
You can do something like this:
def extra_object_detail(...):
context = {"next":nextObj, "previous":previousObj}
return object_detail(..., extra_context=context)
The generic view adds the extra_context parameter to the context so you
can access it in your template.
Chris
--~--~---
Using javascript would be the way to go. Though you have two options on
how to know which car relates to which manufacturer.
1) AJAX: Query the server, which will return a list to be placed in the
select field.
2) Hard coded JS: Hard code it into a JS array that will then be used
to look up the f
Try:
data.getlist('teams')
Chris
--~--~-~--~~~---~--~~
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
Might be of help:
http://www.djangoproject.com/documentation/request_response/#httprequest-objects
if request.method == 'GET':
do_something()
elif request.method == 'POST':
do_something_else()
Chris
--~--~-~--~~~---~--~~
You received this message becaus
Try either:
def __str__(self):
return '%s - %s' % (self.name, str(self.category))
or
def __str__(self):
return '%s - %s' % (self.name, self.category.name)
The problem is that it is using __repr__ to print it out, not str. To
force str you have to use the str(). Or you can
This might be of use:
http://www.djangoproject.com/documentation/model_api/#list-per-page
Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-use
To add permissions.
For user: user.user_permissions.add(perm)
(I think, don't have the chance to double check) For group:
group.permissions.add(perm)
For your question, the permission table contains the codename, verbose
name and content type of the object. In most cases, you could probably
get a
If I have a group instance called students and I wanted to add it to
the user instance bill I would use:
bill.groups.add(students)
If you want to have a permission for a view, you will have to use the
has_perm method that is within the user model (user.has_perm) and check
for the permission you w
Hey Seemant,
Sorry about not getting back to you sooner to work on this. Been
finishing off last minute details with my SoC project.
Here is what I've come up w/ that (w/ my limited testing) seems to
work:
preacher = models.ForeignKey (
Person,
limit_choices_to = { '
Might be of help:
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser
Chris
--~--~-~--~~~---~--~~
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@googleg
If you had two views:
def view_1(request):
return render_to_response(...)
def view_2(request):
return view_1(request)
Will return the view_1 but will be under the view_2 URL.
Chris
--~--~-~--~~~---~--~~
You received this message because you
You could simplify your urls.py by extending the generic view with
another view, e.g. an example from the authorization document:
from django.views.generic.date_based import object_detail
@login_required
def limited_object_detail(*args, **kwargs):
return object_detail(*args, **kwargs)
It mi
This might help:
http://www.djangoproject.com/documentation/db_api/#latest-field-name-none
Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us
I believe there are articles on blogs and wiki posts about extending
the user model.
The basic idea as of right now (as far as I know), before model
inheritance is committed, is to connect the two using a foreign key.
If you want to create a user and relate it to the customer object, best
spot m
Not sure if this is of any help
Create a manipulator with the form fields, doesn't matter if they are
for two different models just make sure to remember the name. If you
want to prepopulate the fields, you might have to fill in the data
dictionary before creating the formwrapper and passing
It's not very hard to integrate AJAX into Django, it is a bit more
manual then TG (from what I've read). But with the AJAX frameworks out
there, writing the javascript is far from hard.
James has a blog article on AJAX and Django:
http://www.b-list.org/weblog/2006/07/31/django-tips-simple-ajax-ex
24 matches
Mail list logo