On 8/6/2010 1:23 PM, kostia wrote:
> The question of clarity:
>
> What is the best way to do:
> project.pk
> or
> project.id
> ?
>
Well, pk will always work no matter what the field is named, so I tend
to prefer that. It's mostly a matter of style, though.
regards
Steve
--
I'm no expert.
"ex"
The question of clarity:
What is the best way to do:
project.pk
or
project.id
?
--
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...@googlegroups.com.
To unsubscribe from this group, send email to
d
Part of my urls.py:
...
url(r'^project/(?P\d+)/event/(?P\d+)$',
views.event, name="event"),
url(r'^project/(?P\d+)/event/edit/(?P\d+)$',
views.edit_event, name="edit_event"),
url(r'^project/(?P\d+)/event/new/$', views.edit_event,
name="new_event"),
...
I see, I need to write this:
{
On Aug 6, 5:46 pm, kostia wrote:
> What is wrong?
>
> My view function:
> def project(request, project_id):
>
> try:
>
> project_id = int(project_id)
>
> except ValueError:
>
> raise Http404
>
> myProject = get_object_or_404(Project, id = project_id)
> events = Even
4 matches
Mail list logo