Re: SOLUTION FounD : How to restore Models original Properties - Problem in Models column Exclude

2019-05-31 Thread Alexis Roda
Hi Balaji, Sorry but I don't understand what do you mean with "*If we put this code with necessary care*". All I can say is that your code is not thread safe and it *may* break. How likely is this to happen depends on the usage patterns of your app. How serious it will be depends on the leaked

Re: SOLUTION FounD : How to restore Models original Properties - Problem in Models column Exclude

2019-05-31 Thread Balaji Shetty
Dear Alexis Roda Sir Thank You very Much. definitely Race Condition may arise if we do not put code inn critical section. But your suggested approach did not work and i found another alternative which is working fine. If we put this code with necessary care than will it be ok? On Tue, May 28,

Re: SOLUTION FounD : How to restore Models original Properties - Problem in Models column Exclude

2019-05-28 Thread Alexis Roda
No, it isn't. It's not thread safe. Changes in shared state in multi-threaded code may lead to race conditions[1]. Depending on your usage it may be very unlikely, but under the right circumstances root may end up having some missing fields in the form or dgp may see fields that it is not

SOLUTION FounD : How to restore Models original Properties - Problem in Models column Exclude

2019-05-28 Thread Balaji Shetty
This is the proper code to customize models column userwise. Here we are sharing model among multiple user and depending upon right access, it is visible in admin.py normaluser_fields = ['user','CourtType','SuitType','CaseNumber','CaseYear','CaseAdvocate','CasePartyNames',

Re: How to restore Models original Properties - Problem in Models column Exclude

2019-05-28 Thread Balaji Shetty
Dear Alexis Roda Sir Thank You very much for your nice reply. I check it. On Tue, May 28, 2019 at 1:55 AM Alexis Roda < alexis.roda.villalo...@gmail.com> wrote: > Not an admin expert here. > > You are modifying the modeladmin instance and, by the behavior you're > describing, it looks like it

Re: How to restore Models original Properties - Problem in Models column Exclude

2019-05-27 Thread Alexis Roda
Not an admin expert here. You are modifying the modeladmin instance and, by the behavior you're describing, it looks like it is a global (shared) object. I'm guessing, you can confirm this by printing id(self) in add_view(). I'll bet you get the same value in each request, so the instance is

How to restore Models original Properties - Problem in Models column Exclude

2019-05-27 Thread Balaji Shetty
*Hi* *i have encountered very strange problem. have two user . One is superuser of name "root" and another is general user of name "dgp". I have model of Name Profile with 21 fields around.* *I want to show all field of Model Profile in "root" login.* *I want to exclude 4 field of Model Profile

Re: Problem with models

2011-01-04 Thread Quetzacotl
I have added related_name to text1 and text2, so at least syncdb worked, but how can I now make this query. In manager: self.compare_set.filter(~Q(Q(compare__user=request.user)(Q(compare__text1__id=id)| Q(compare__text2__id=id.all() this doesn't work -- You received this message because

Problem with models

2011-01-04 Thread Quetzacotl
I have model of text, like that: class Text(models.Model): text = models.CharField() user = models.ForeignKey(User) #author And i need to compare two of texts, so i need table like this: class Compare(models.Model): text1 = models.ForeignKey(Text) text2 =

Re: problem with models and foreign keys

2008-07-01 Thread Malcolm Tredinnick
On Tue, 2008-07-01 at 00:09 -0700, KevinTran wrote: > So that means that the tables are correct right? Yes, they're fine. It's just a subtle difference between what "manage.py sql ..." and "manage.py sqlall ..." prints out. When you run "manage.py syncdb", it will use the "sqlall" equivalent.

Re: problem with models and foreign keys

2008-07-01 Thread KevinTran
existant table, if you use the sqlall command > instead you will see that the tables are altered to add the > constraint. > > On Jul 1, 1:57 am, KevinTran <[EMAIL PROTECTED]> wrote: > > > Hi I'm currently reading Learning Website Development with Django and > >

Re: problem with models and foreign keys

2008-07-01 Thread [EMAIL PROTECTED]
y reading Learning Website Development with Django and > I'm having a problem with models.  Here is my models.py: > > from django.db import models > from django.contrib.auth.models import User > > class Link(models.Model): >     url = models.URLField(unique=True) > > class

problem with models and foreign keys

2008-07-01 Thread KevinTran
Hi I'm currently reading Learning Website Development with Django and I'm having a problem with models. Here is my models.py: from django.db import models from django.contrib.auth.models import User class Link(models.Model): url = models.URLField(unique=True) class Bookmark(models.Model

Re: Problem importing models in custom data import scripts

2007-03-21 Thread ScottB
Hi Nathan. On Mar 21, 12:37 am, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > My Project is called pynomics and the app alignments. > ~/pynomics/alignments/models.py > > so in my "Parser.py", I try to import the models file > from pynomics.alignments.models import * > > but I get the following

Problem importing models in custom data import scripts

2007-03-20 Thread Nathan Harmston
Hi Guys and Gals, I am currently trying to import a large amount of data held in flatfiles into a database so that it can be displayed through Django. I am using the most recent development version of Django. I found that a new method called get_or_create, however I cant seem to get it to work as