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

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 <pixelcowbo...@gmail.com> wrote: > The second solution would be great, but is the relationship

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 <glicer...@gmail.com> wrote: > On Tue, Oct 26, 2010 at 6:21 PM, pi

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

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 <antoni.a...@gmail.com> wrote: > http://www.cdolivet.com/index.php?page=editArea=106bb5f73b60725d... > > This a javascript code editor. Perhaphs it would give you another 40% > > 2010/10/15 pi

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 <antoni.a...@gmail.com> wrote: > Take a look at > > http://bitbucket.org/jezdez/django-dbtemplates/wiki/Home > > Hope it helps! > > 2010/10

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

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

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,

Re: filepath (system file system path) field

2010-09-22 Thread pixelcowboy
21, 2010 at 6:17 PM, pixelcowboy <pixelcowbo...@gmail.com> 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 som

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

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

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

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

2010-09-15 Thread pixelcowboy
HINK that'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 > >

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

2010-09-15 Thread pixelcowboy
; 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:24 PM, pixelcowboy <pixelcowbo

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

2010-09-15 Thread pixelcowboy
> n > > PS I'm just thinking of things off the top of my head! :) > On Wed, Sep 15, 2010 at 4:16 AM, pixelcowboy <pixelcowbo...@gmail.com>wrote: > > > > > > > Im not sure Im getting this properly. In the example above, how would > > you know what the

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, p

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

2010-09-14 Thread pixelcowboy
uot;field_i_care_about": > (object_i_want.field_i_care_about) > > admin.site.register(MyModel, MyModelAdmin) > > On Tue, Sep 14, 2010 at 3:59 PM, pixelcowboy <pixelcowbo...@gmail.com>wrote: > > > > > > > Hi, I want a project structure that is as follows: > > &

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

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

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
mental Variables 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 Mo

Re: user created variables

2010-09-13 Thread pixelcowboy
gt; > 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 at 3:56 PM, pi

Re: user created variables

2010-09-13 Thread pixelcowboy
erstand 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 up with something more elegant

Re: user created variables

2010-09-12 Thread pixelcowboy
) > > n > > On Sun, Sep 12, 2010 at 9:42 PM, pixelcowboy <pixelcowbo...@gmail.com>wrote: > > > 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

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

Re: verbose field names in admin

2010-03-01 Thread pixelcowboy
ay be something small overlooked. > > 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 <pixelcow

Re: verbose field names in admin

2010-03-01 Thread pixelcowboy
something small overlooked. > > 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 <pixelcowbo...@gmail.co

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

Re: Model field validation for admin

2009-11-10 Thread pixelcowboy
Ok, I'll try that.Thanks! On Nov 10, 10:19 am, rebus_ <r.dav...@gmail.com> wrote: > 2009/11/10 pixelcowboy <pixelcowbo...@gmail.com>: > > > > > Hello, I want to make a field optional (blank=True), only if another > > text field's options match a certain valu

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