On Thu, Feb 10, 2011 at 12:39 PM, Paul Bagwell <pba...@gmail.com> wrote:
> Model I've described is just an example.
> In the real world, I'm developing imageboard (chan).
> This is anonymous forum with sections. Each section needs to have its own 
> post counter. It is very typical for all modern chans (wakaba, kusaba etc.).

I don't see why this requires you to label each post with its post id
in the database. If you want to do something with the 5 post of a
thread:

post = thread.post_set.order_by('-created')[4]

You don't need to do decompose a derived value onto the model.

> Wakaba just creates separate table for each section, what is very inefficient.
>
> And what is 'hardest solution'? I've thought about mutexes.
>

Mutexes, but again, won't scale - won't work in different processes.
Write a standalone process which acts as a post id granting service.

It's still a pain, anything like deleting a post etc leads to you
having to update any number of posts re-ordering/numbering them. Its
easier to treat the post index as a computed variable.

Cheers

Tom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to