Re: AttributeError for unique field during ModelForm validation

2012-11-11 Thread Rohit Banga
to an abstract model. It does not know which table implementation to look at to verify if the unique constraint is satisfied. Thanks Rohit Banga http://iamrohitbanga.com/ On Sun, Nov 11, 2012 at 9:21 AM, Andrejus wrote: > > Unfortunately I haven't got experience with abstarct models

Re: AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
sure, but there seems to be some restrictions on use of unique > property. > > воскресенье, 11 ноября 2012 г., 0:40:54 UTC+4 пользователь Rohit Banga > написал: >> >> I noticed a strange behavior with Django and filed a bug >> https://code.djangoproject.com/ticket/19

AttributeError for unique field during ModelForm validation

2012-11-10 Thread Rohit Banga
I noticed a strange behavior with Django and filed a bug https://code.djangoproject.com/ticket/19271#ticket It is suggested that I first check on the support group if the bug is valid or not. Fair Enough. I have created a standalone project to demonstrate the problem. In order to run it you may

Problem with URL configuration - cannot use absolute URLs in my case

2012-10-06 Thread Rohit Banga
Hi I have a website at example.com/mywebsite. All URL requests directed to this URL are directed to my app. Now I have the following project structure mywebsiteroot/ -- myapp/ -- manage.py -- myapp/ --templates/ --settings.py

Re: How to separate data having the same model but belonging to different users?

2012-09-23 Thread Rohit Banga
reasonable way to restrict this within the same app or are there problems that I cannot foresee? Thanks Rohit Banga http://iamrohitbanga.com/ On Sun, Sep 23, 2012 at 12:56 PM, Dennis Lee Bieber wrote: > On Sat, 22 Sep 2012 22:04:41 -0700 (PDT), Bill Beal > declaimed

Re: How to separate data having the same model but belonging to different users?

2012-09-22 Thread Rohit Banga
Thats interesting Bill. Are you talking about something like this? http://stackoverflow.com/questions/3276700/django-model-subclass-without-changing-database-name Thanks Rohit Banga http://iamrohitbanga.com/ On Sat, Sep 22, 2012 at 8:15 PM, Bill Beal wrote: > Question for an expert fro

Re: How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
t too ugly looking code is it still a terrible idea? Thanks Rohit Banga http://iamrohitbanga.com/ On Fri, Sep 21, 2012 at 9:34 PM, Dennis Lee Bieber wrote: > On Fri, 21 Sep 2012 17:54:06 -0400, Rohit Banga > declaimed the following in > gmane.comp.python.django.user: > > > Tha

Re: How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
just want to add behavior like PhysicsDepartment.objects.filter() or create(), save() anywhere I want. I want to work with the base class while loading the data from the subclass at runtime. Simple polymorphism but with different database tables in the backend. Thanks Rohit Banga

Re: How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
Sure Nikolas I will reconsider your solution. In case I go for model inheritance then can I use the following solution to load the class dynamically? mod = __import__('mysite.departments', fromlist=[form.getDepartment()]) klass = getattr(mod, 'form.getDepartment()') Tha

Re: How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
cally so I do not have to do Department.objects.filter() PhysicsDepartment.objects.filter() I want to share the same code for all departments. Can I instantiate them dynamically given that I have the string name and the module name available in a dictionary. Thanks Rohit Banga http://iamrohitbang

Re: How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
database for creating the new tables. But what is different is I need to fetch the Place subclass (eg. Restaurant or School page above) at runtime based on the logged in user. Assuming I have a map from id to class name can I just load it dynamically? Thanks Rohit Banga http://iamrohitbanga.com/ On

Re: How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
he filter in the code and there is an unauthorized data access. I will look into dynamic models though I am not sure if it is well supported. What about routing to different databases based on user id? Thanks Rohit Banga http://iamrohitbanga.com/ On Fri, Sep 21, 2012 at 2:34 PM, Joel Goldstick

Re: How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
User2 that you > need different tables? > > > > On Fri, Sep 21, 2012 at 1:35 PM, Rohit Banga wrote: > >> Hi >> >> I am a django #n00b. I came across the django model documentation and >> found it pretty interesting. ( >> https://docs.djangoproject.com/en

How to separate data having the same model but belonging to different users?

2012-09-21 Thread Rohit Banga
s 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.c