limit_choice_to all objects of a particular model (using inheritance)

2010-10-28 Thread pixelcowboy
Example class Base(): pass class A(Base) parent=models.Foreignkey("self", limit_choices_to=(all members of the B class) class B(Base) parent=models.Foreignkey("self", limit_choices_to=(all members of the A class) What would be the query syntax for limit_choices_to, to get only the objects

Re: help with model definition

2010-10-28 Thread pixelcowboy
Yes, it works! Thanks so much, that is the perfect solution! Inheritance in Django in my opinion should do much more, but in this case it actually does the job! On Oct 27, 2:31 pm, pixelcowboy wrote: > The second solution would be great, but is the relationship inherited? > I didnt thin

Re: help with model definition

2010-10-27 Thread pixelcowboy
The second solution would be great, but is the relationship inherited? I didnt think that was possible. Will try it out, first solution is also an option. Thanks for your help. On Oct 27, 1:35 pm, Marc Aymerich wrote: > On Tue, Oct 26, 2010 at 6:21 PM, pixelcowboy wrote: > > > I hav

help with model definition

2010-10-26 Thread pixelcowboy
I have a question regarding the best way to conceptualize a model. I have a tasks model, which I want to hook to a few different other models: The model Project, the model Company and a few other undefined models. The problem is that I want a particular instance of the task to be pluggable to one a

customizing inherited field attributes

2010-10-19 Thread pixelcowboy
Hi, I have the need for the following inheritance customization: class abstract(models.Model): field=models.Charfield() class Meta: abstract=True class A(abstract): I want the field 'field' to be required here. class B(abstract):

Re: python highlighting in text input field

2010-10-15 Thread pixelcowboy
Yep, thats it man! That is great, thanks! On Oct 14, 11:01 pm, Antoni Aloy wrote: > http://www.cdolivet.com/index.php?page=editArea&sess=106bb5f73b60725d... > > This a javascript code editor. Perhaphs it would give you another 40% > > 2010/10/15 pixelcowboy : > > >

Re: python highlighting in text input field

2010-10-14 Thread pixelcowboy
Thanks, I guess this gets me halfway there! Still need to figure out the highlighting for python. On Oct 14, 12:34 pm, Antoni Aloy wrote: > Take a look at > > http://bitbucket.org/jezdez/django-dbtemplates/wiki/Home > > Hope it helps! > > 2010/10/14 pixelcowboy : > &g

python highlighting in text input field

2010-10-14 Thread pixelcowboy
Is there any way to do this? I want the admin to be able to edit python templates from the admin. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group,

Re: IDE for Python/django

2010-09-28 Thread pixelcowboy
For me, at least in ubuntu 64 bit, pycharm is indeed terribly slow. And this on a icore7 machine with 8 gigs of ram. Otherwise I like it, but it does have a few bugs. On Sep 28, 10:53 am, Masklinn wrote: > On 2010-09-28, at 02:01 , tayfur yilmaz wrote:> pycharm is very slow > > It's not. > > > ı

Re: IDE for Python/django

2010-09-27 Thread pixelcowboy
For linux/ubuntu there is also Eric IDE. It has django plugin. On Sep 27, 7:38 am, Sithembewena Lloyd Dube wrote: > Less? He could probably ask, "is there any IDE?" > > ^^ Couldn't let that one slip by...haven't trolled in a while :) > > On Mon, Sep 27, 2010 at 4:29 PM, fcaldera wrote: > > > > >

Re: filepath (system file system path) field

2010-09-22 Thread pixelcowboy
PM, pixelcowboy wrote: > > Hi, I have seen this asked before here (without answers), but I wanted > > to know how to go on about creating a field that stores filepath names > > from the client filesystem, so I wanted to check if someone could > > recommend the best apporach: Creating

filepath (system file system path) field

2010-09-21 Thread pixelcowboy
Hi, I have seen this asked before here (without answers), but I wanted to know how to go on about creating a field that stores filepath names from the client filesystem, so I wanted to check if someone could recommend the best apporach: Creating a custom field perhaps? Or perhaps extending the file

Re: Automatically creating fields

2010-09-20 Thread pixelcowboy
I get what you are saying, you are right in that it might make more sense to do it for every field that needs it. Thanks. On Sep 20, 11:22 am, Shawn Milochik wrote: > There are always ways. You could subclass models.Model and add the behavior, > if you read enough to understand how Django's mod

Automatically creating fields

2010-09-20 Thread pixelcowboy
Hi, for every field in a model that I have created, I want to create a releated boolean field. Is there any way to do this automatically? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegro

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-15 Thread pixelcowboy
;ll do what you want. > > Now you can choose a specific project, create a new subproject...django is > aware of the object your currently dealing with, creating a new object, with > the specified fields is at this point really simple... > > make sense? > > n > > On Wed, S

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-15 Thread pixelcowboy
jquery ping that view, to do the > queries...and return a json object...that you can use to populate various > fields in your admin form...that way you're still using django to query the > db and do all the lifting. > > hope that helps... > > n > > On Wed, Sep 15, 2010 at 5

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-15 Thread pixelcowboy
e to only work on the creation of an object...not the > changing of an object. (ie so you don't override the new values with the > inherited ones every time...) > > OR you could have it check to see if those values are null, if they are null > put in the inherited values, else pass..

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-14 Thread pixelcowboy
Im not sure Im getting this properly. In the example above, how would you know what the word "whatever", the query value, stands for? How could you keep it dynamic in that the values of that field is taken from whatever the actual parent object is? Thanks. On Sep 14, 2:34 pm, pixelcow

Re: Prepopulating fields from parent, or related models, in the admin

2010-09-14 Thread pixelcowboy
> (object_i_want.field_i_care_about) > > admin.site.register(MyModel, MyModelAdmin) > > On Tue, Sep 14, 2010 at 3:59 PM, pixelcowboy wrote: > > > > > > > Hi, I want a project structure that is as follows: > > > I have an application with project model that

Re: Tools to ease template/ui development

2010-09-14 Thread pixelcowboy
I would really love something like pyjamas but that works with jquery or something like that. What I would really love is to forget every other programming language and just use python everywhere. Wouldn't that be sweet? On Sep 14, 1:20 pm, bruno desthuilliers wrote: > On 14 sep, 20:23, payala w

Re: Tools to ease template/ui development

2010-09-14 Thread pixelcowboy
Pydev supports Django templates in Aptana, and there is also an IDE called PyCharm that is supposed to support them. I have begun learning eclipse and I like it. Eric IDE and its Django plugin is also very good, although I dont think it supports Django templates. On Sep 14, 8:20 am, payala wrote:

Prepopulating fields from parent, or related models, in the admin

2010-09-14 Thread pixelcowboy
Hi, I want a project structure that is as follows: I have an application with project model that has a subproject, and that subproject has other subproject,etc. What I want to get is that the subproject gets the same attributes that the parent project, but is also able to override their values in

Re: user created variables

2010-09-13 Thread pixelcowboy
with a > type field. By creating the custom validation in the admin, you can give the > users a bit of help too when they are creating/changing variables. (ie > helping them along saying you chose data type int, and gave me a string...) > > n > > On Mon, Sep 13, 2010 at 6:55 P

Re: user created variables

2010-09-13 Thread pixelcowboy
tc...) > > I think you're problem needs some creative thinking to create an environment > to create variables that replicates the way you can create variables in > Python. > > I hope I made some sense! :) > > n > > Once in there you can > On Mon, Sep 13, 2010 a

Re: user created variables

2010-09-13 Thread pixelcowboy
type > > I understand your lack of depth of information on the topic (this solution > isn't making me any happier than it's making you! :) > > I'm sure there is a slicker solution out there, I'm just trying to give you > something to think about and hopfully come

Re: user created variables

2010-09-12 Thread pixelcowboy
th it: > > class UserVariables(models.Model): >     variable_name = models.CharField(max_length=100) >     variable_value = models.TextField() > > THOUGH like I said, I have no idea what you're trying to do or why...but > this is by far the simplest way :) > > n > &

inheritance of fields and default values from parent model class

2010-09-12 Thread pixelcowboy
Hi, I would like to create an inheritance relationship, similar to an abstract class, where the child class inherits all the fields from the parent class, but also gets its default values from the parent instance. So basically Im confused about the concepts, I know an abstract class would not have

user created variables

2010-09-12 Thread pixelcowboy
What would be the best way to enable a user to create arbitrary variables through the django admin? This could be either numbers, text or paths to files. Thanks for your advice! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: verbose field names in admin

2010-03-01 Thread pixelcowboy
verlooked. > > You shouldn't have to re-sync the database to use verbose_name.  It's > just a hook to be used for example, in the model's meta options.  Give > us more detail about your model for further help. > > On Mar 1, 7:20 am, pixelcowboy wrote: > > >

Re: verbose field names in admin

2010-03-01 Thread pixelcowboy
. > > You shouldn't have to re-sync the database to use verbose_name.  It's > just a hook to be used for example, in the model's meta options.  Give > us more detail about your model for further help. > > On Mar 1, 7:20 am, pixelcowboy wrote: > > > > > Hi, I

verbose field names in admin

2010-03-01 Thread pixelcowboy
Hi, I have added verbose names for each of my field names, with the purpose of getting a pretty admin display. However, I have reset my database and the admin still shows the field name only, not the verbose name. Do I need to do anything else? -- You received this message because you are subscri

Re: Model field validation for admin

2009-11-10 Thread pixelcowboy
Ok, I'll try that.Thanks! On Nov 10, 10:19 am, rebus_ wrote: > 2009/11/10 pixelcowboy : > > > > > Hello, I want to make a field optional (blank=True), only if another > > text field's options match a certain value in the admin. Is there any > > way to d

Model field validation for admin

2009-11-10 Thread pixelcowboy
Hello, I want to make a field optional (blank=True), only if another text field's options match a certain value in the admin. Is there any way to do this? Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan