If you /absolutely/ have to use separate tables per user (again, I do not recommend this), then you'll need to implement some form of dynamic models (models which can be constructed at run-time rather than needing to be defined in the application code) such as discussed here: https://code.djangoproject.com/wiki/DynamicModels (see link at the top of the page for newer approaches and full implementations of dynamic models).
_Nik On 9/21/2012 11:07 AM, Rohit Banga wrote: > > Just HAVE to separate data - requirement. > > On Sep 21, 2012 1:59 PM, "Mayukh Mukherjee" <mayu...@gmail.com > <mailto:mayu...@gmail.com>> wrote: > > As I understand it: (And im fairly new to django too) > > A model corresponds to a single table (not multiple). > The question to you is what is different between User1 and User2 > that you need different tables? > > > > On Fri, Sep 21, 2012 at 1:35 PM, Rohit Banga > <iamrohitba...@gmail.com <mailto:iamrohitba...@gmail.com>> wrote: > > Hi > > I am a django #n00b. I came across the django model > documentation and found it pretty interesting. > (https://docs.djangoproject.com/en/dev/topics/db/models/). > > Now my usecase requires I have a set of Models and each model > has multiple tables corresponding to it. > For example when user1 registers I can create a table > user1_t1, user1_t2, user1_t3. > When user2 registers I can create a table user2_t1, user2_t2, > user2_t3. > > I really like the Model abstraction but can't find a way to > create these multiple tables conveniently without creating new > models. I could not find clear solutions to this on the internet. > I just want clear separation between t1, t2, t3 for the all > users. Depending on the logged in user, I want to use the > relevant table. What is the cleanest way to achieve this with > Django? > > If it is not possible to do this with tables I can think about > different databases one for each user with the same set of > tables. Is it possible to do the same with multiple databases? > > Thanks > Rohit Banga > -- > You received this message because you are subscribed to the > Google Groups "Django users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/tl8qKhJb-_cJ. > To post to this group, send email to > django-users@googlegroups.com > <mailto:django-users@googlegroups.com>. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > <mailto:django-users%2bunsubscr...@googlegroups.com>. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > > > > -- > Mayukh Mukherjee > http://www.linkedin.com/in/mayukhmmukherjee > > > > -- > 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 > <mailto:django-users@googlegroups.com>. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > <mailto:django-users%2bunsubscr...@googlegroups.com>. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- > 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. -- 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.