Re: New Django tutorial
I had a look over your tutorial and it looks pretty sweet. Definitely
gets down into explaining how to use the admin interface and taught me
things I hadn't realized. I have a few suggestions for you (feel free
to ignore :)):
1) I'm not sure how good an idea it is to call the attribute on your
DateTime model "datetime" - it conflicts with the datetime module.
Although this shouldn't cause any problems, it might be confusing.
2) In the "Changing Save Redirect" section you import a load of stuff
inside an instance method. I'd prefer to see this imported at module
level.
3) In the same section, you do request.POST.has_key. I believe the
preferred syntax is "name_of_key" in request.POST.
4) In the same section you are using hard-coded URLs - can you not get
these by using reverse() ? It might not be possible as I know the
admin is quite a beast.
5) In the mark_done method on Item, you could definitely use reverse
and that should aid any changes to your URL structure.
6) In the "Customizing DateTime" your unicode method returns a str not
unicode
7) In the same section you talk about an OnOff property. I think you
actually mean attribute (although in terms of the concept it is indeed
a property, just in terms of the model it is an attribute)
8) In the "Adding users" section, I think you could replace the loop
with:
Item.objects.filter(created=obj,
user_isnull=True).update(user=request.user).
This would use only one SQL UPDATE and not n SELECTs and n UPDATEs.
9) At the end when the possible actions are checked it might be nice
to raise an exception if you don't find a valid action.
I hope you find the above helpful. There's very little wrong with the
tutorial and it's really clear, but I think at least some of the
points might be well incorporated.
Euan
On 2 July, 20:53, Rainy <andrei....@gmail.com> wrote:
> Hi, I plan to make a bunch of Django tutorials and I just finished the
> first one:
>
> http://lightbird.net/dbe/
>
> Please let me know how it can be improved and I'll incorporate
> suggestions into upcoming tutorials. Thanks! -ak
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home