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 
"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
-~--~~~~--~~--~--~---



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 do this? Thanks!
>
> This is from the top of my head, but you probably want to say
> null=True (i am guessing you'll leave this field empty in some cases)
> and blank=True on certain model field, then override models save()
> method to check for some conditions under which you want or do not
> want to allow the field to be empty.
>
> I am not sure how you would rise validation error from save() though.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



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 group, send email to django-us...@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.



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 a particular instance, but I would like
the child class to inherit the fields and field values from an actual
parent instance, but with the capability of overriding them.

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: user created variables

2010-09-12 Thread pixelcowboy
Of course! But what about different field types? How would you pair
the variable name with the variable value for multiple types in the
same class?  Or would you need a separate model class for each
different value type? example integers, strings, etc

Sorry for the lack of information, but my application structure
requires that users are able to add arbitrary variables to a
model.Thanks for your help!

On Sep 12, 8:24 pm, "nick.l...@gmail.com"  wrote:
> without knowing any context of what you want...or are going to do...I would
> say create a similar model and run with 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
>
> On Sun, Sep 12, 2010 at 9:42 PM, pixelcowboy 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 for your advice!
>
> > --
> > 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, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Guadajuko! Vamos a correr!
>  -"Cool! we are going to run!"

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: user created variables

2010-09-13 Thread pixelcowboy
The only reason I dont share the information is that I dont want to
bore you to death. The application will need to provide (via a
database) per project environment variables for use in external client
applications. However, those variables might, or might not change from
project to project.

The only problem that I see with your solution above is that it would
not validate for type (in a pythonic sense). What way would there be
to add an arbitrary number of a diverse set of django model types?
Thanks again for your help.

On Sep 13, 6:40 am, "nick.l...@gmail.com"  wrote:
> That's fine...well for data types ad a field for types say an integer field
> and when youcome across a new type you need just increment your integer
> count by one...
>
> ie:
>
> STRING = 1
> INT = 2
> CHAR = 3
> TYPE_CHOICES = (
> (STRING, 'string'),
> (INT, 'integer'),
> (CHAR, 'character'),
> )
>
> Then add the field to your model:
> data_type = models.IntegerField(choices=TYPE_CHOICES)
>
> Then in your admin view there will be filds the user needs to fill 'in'
>
> name
> value
> 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 up with something more elegant
> that fits your business needs! :)
>
> n
>
> On Mon, Sep 13, 2010 at 4:37 AM, pixelcowboy wrote:
>
>
>
>
>
> > Of course! But what about different field types? How would you pair
> > the variable name with the variable value for multiple types in the
> > same class?  Or would you need a separate model class for each
> > different value type? example integers, strings, etc
>
> > Sorry for the lack of information, but my application structure
> > requires that users are able to add arbitrary variables to a
> > model.Thanks for your help!
>
> > On Sep 12, 8:24 pm, "nick.l...@gmail.com"  wrote:
> > > without knowing any context of what you want...or are going to do...I
> > would
> > > say create a similar model and run with 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
>
> > > On Sun, Sep 12, 2010 at 9:42 PM, pixelcowboy  > >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 for your advice!
>
> > > > --
> > > > 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, send email to
> > > > django-users+unsubscr...@googlegroups.com > > >  groups.com>
> > 
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --
> > > Guadajuko! Vamos a correr!
> > >  -"Cool! we are going to run!"
>
> > --
> > 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, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Guadajuko! Vamos a correr!
>  -"Cool! we are going to run!"

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: user created variables

2010-09-13 Thread pixelcowboy
Yes, it totally does! Thanks again for your help. Another work around
might be just creating different models for each data type that I want
to validate, as in your first example maybe... but create a different
model for each different data type possibility? What do you about this
approach?

On Sep 13, 9:27 am, "nick.l...@gmail.com"  wrote:
> hmm ok I'm thinking out loud here :)
>
> So you want your users to have the ability to create env variables through
> the Django admin. You also want these variables to be validated (ie you
> don't want people to put 123 in a char var).
>
> I still see this solution as being at least a starting ground. You would
> just have to add some customization to the admin. 
> Read:http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-custom...
>
> Then in your form you can validate the data (ie check to make sure that the
> value for the variable is of type what ever type they picked.)
>
> Then if your user attempted to put an int in a string you can have the
> django admin raise errors to the user saying something to the effect "You
> dingdong, the number 1 is not a string. If you want the number 1 to be a
> string please put it in quotes"
>
> as an aside: You could also add a foreign key to the project (if you have a
> project model)
>
> re: adding arbitrary models to django would be difficult, though i think you
> can do it. The problem there is that each time you add a new model you'd
> have to sync the database again. If you remove a model django won't remove
> the tables in the DB you'd have to go and remove that table manually.
>
> The problem with validating an env-var pythonically in a database is..well
> the database isn't python and vice versa. The way I think your're thinking
> about it is you want to have a dynamic database where you can create
> variables and destroy variables and change variable types the way you do in
> python (ie a = 1, a= "1", del a, etc...)
>
> 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, pixelcowboy wrote:
>
>
>
>
>
> > The only reason I dont share the information is that I dont want to
> > bore you to death. The application will need to provide (via a
> > database) per project environment variables for use in external client
> > applications. However, those variables might, or might not change from
> > project to project.
>
> > The only problem that I see with your solution above is that it would
> > not validate for type (in a pythonic sense). What way would there be
> > to add an arbitrary number of a diverse set of django model types?
> > Thanks again for your help.
>
> > On Sep 13, 6:40 am, "nick.l...@gmail.com"  wrote:
> > > That's fine...well for data types ad a field for types say an integer
> > field
> > > and when youcome across a new type you need just increment your integer
> > > count by one...
>
> > > ie:
>
> > > STRING = 1
> > > INT = 2
> > > CHAR = 3
> > > TYPE_CHOICES = (
> > > (STRING, 'string'),
> > > (INT, 'integer'),
> > > (CHAR, 'character'),
> > > )
>
> > > Then add the field to your model:
> > > data_type = models.IntegerField(choices=TYPE_CHOICES)
>
> > > Then in your admin view there will be filds the user needs to fill 'in'
>
> > > name
> > > value
> > > 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 up with something more elegant
> > > that fits your business needs! :)
>
> > > n
>
> > > On Mon, Sep 13, 2010 at 4:37 AM, pixelcowboy  > >wrote:
>
> > > > Of course! But what about different field types? How would you pair
> > > > the variable name with the variable value for multiple types in the
> > > > same class?  Or would you need a separate model class for each
> > > > different value type? example integers, strings, etc
>
> > > > Sorry for the lack of information, but my application structure
> > > > requires that users are able to add arbitrary variables to a
&

Re: user created variables

2010-09-13 Thread pixelcowboy
I see what you are saying, thanks for the advice!

On Sep 13, 12:10 pm, "nick.l...@gmail.com" 
wrote:
> The problem I see with creating a model for each data type is that you have
> LOTS of clutter in the admin...and what happens if you want to change the
> value from a string to an int? You'd have to delete it one, then recreate it
> in another...just a lot of steps. Also it means more models to maintain...if
> you find yourself wanting to change a field on a data type model...and you
> realize that would be a good change across the board...then your stuck with
> running multiple migrations...(or I suppose you could sublclass the model
> too...but that sounds yucky as well! :)
>
> I know it's more work up front to create a validator, but I also think it's
> cleaner in the end to have just one model for Environmental 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 Mon, Sep 13, 2010 at 6:55 PM, pixelcowboy wrote:
>
>
>
>
>
> > Yes, it totally does! Thanks again for your help. Another work around
> > might be just creating different models for each data type that I want
> > to validate, as in your first example maybe... but create a different
> > model for each different data type possibility? What do you about this
> > approach?
>
> > On Sep 13, 9:27 am, "nick.l...@gmail.com"  wrote:
> > > hmm ok I'm thinking out loud here :)
>
> > > So you want your users to have the ability to create env variables
> > through
> > > the Django admin. You also want these variables to be validated (ie you
> > > don't want people to put 123 in a char var).
>
> > > I still see this solution as being at least a starting ground. You would
> > > just have to add some customization to the admin. Read:
> >http://docs.djangoproject.com/en/dev/ref/contrib/admin/#adding-custom...
>
> > > Then in your form you can validate the data (ie check to make sure that
> > the
> > > value for the variable is of type what ever type they picked.)
>
> > > Then if your user attempted to put an int in a string you can have the
> > > django admin raise errors to the user saying something to the effect "You
> > > dingdong, the number 1 is not a string. If you want the number 1 to be a
> > > string please put it in quotes"
>
> > > as an aside: You could also add a foreign key to the project (if you have
> > a
> > > project model)
>
> > > re: adding arbitrary models to django would be difficult, though i think
> > you
> > > can do it. The problem there is that each time you add a new model you'd
> > > have to sync the database again. If you remove a model django won't
> > remove
> > > the tables in the DB you'd have to go and remove that table manually.
>
> > > The problem with validating an env-var pythonically in a database
> > is..well
> > > the database isn't python and vice versa. The way I think your're
> > thinking
> > > about it is you want to have a dynamic database where you can create
> > > variables and destroy variables and change variable types the way you do
> > in
> > > python (ie a = 1, a= "1", del a, etc...)
>
> > > 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, pixelcowboy  > >wrote:
>
> > > > The only reason I dont share the information is that I dont want to
> > > > bore you to death. The application will need to provide (via a
> > > > database) per project environment variables for use in external client
> > > > applications. However, those variables might, or might not change from
> > > > project to project.
>
> > > > The only problem that I see with your solution above is that it would
> > > > not validate for type (in a pythonic sense). What way would there be
> > > > to add an arbitrary number of a diverse set of django model types?
> > > > Thanks again for your help.
>
> > > > On Sep 13, 6:40 am, "nick.l...@gmail.com"  wrote:
> > > > > That's fine...well for da

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 its own instance (but not in
the parent instance).

My first idea is using something like a foreign key. This gives me
access to the parent values, but not the ability to override them.

The second option is multi-table inheritance from the parent class.
This gives me the parents class attributes, but I again I dont get the
fields in the admin, so Im not able to override them (at least not in
the admin). Is there any way to this?

The third option is to inherit an abstract class. The parent also
inherits from this class, so both have the fields I need. However, I
would like for the child class to inherit default values for this
fields from the parent class, but be free to override them. Is there
any way to pre-populate fields in the admin with the attribute values
from a parent or related files?

Thanks for your help.

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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:
> Hello everybody!
>
> This is my first post over here, I'll briefly introduce myself saying
> that I am an electronic engineer fiddling with a little bit of web
> development. After trying asp and other nasty stuff, I have discovered
> Django and I am LOVING it, it is just incredible.
>
> As I said, I've been learning Django for a couple of months, and it
> makes web development really easy... to the point that template/UI
> design has become the hard part in my opinion.
>
> What resources do you guys use to ease the pain of doing a nice user
> interface??
>
> Thank you all!
> Pedro

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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  wrote:
>
> > I agree about Aptana. I am trying it right now and it looks very good,
> > I already used eclipse and I think it rocks!
>
> Emacs is the OneTrueEditor !-)
>
> > However, re-reading my post I realise that I didn't express myself as
> > well as I would have liked. Maybe a better title for my question would
> > have been:
>
> > OK, now we have rapid web development frameworks... where is the rapid
> > web DESIGN stuff??
>
> blueprint && uniform come to mind.

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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

2010-09-14 Thread pixelcowboy
I'll try when I get home, but thanks again for your help!

On Sep 14, 11:31 am, "nick.l...@gmail.com" 
wrote:
> Hi again! :)
>
> I haven't thought this idea through, and very well could be
> wildly inefficient! :)
>
> Though in your admin.py when registering the admin model do something like
> this:
>
> from myproject.myapp.models import MyModel, OtherModel
>
> class MyModelAdmin(models.admin):
>     object_i_want = OtherModel.objects.get(field_i_care_about=whatever)
>     prepopulated_fields = { "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 wrote:
>
>
>
>
>
> > 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 its own instance (but not in
> > the parent instance).
>
> > My first idea is using something like a foreign key. This gives me
> > access to the parent values, but not the ability to override them.
>
> > The second option is multi-table inheritance from the parent class.
> > This gives me the parents class attributes, but I again I dont get the
> > fields in the admin, so Im not able to override them (at least not in
> > the admin). Is there any way to this?
>
> > The third option is to inherit an abstract class. The parent also
> > inherits from this class, so both have the fields I need. However, I
> > would like for the child class to inherit default values for this
> > fields from the parent class, but be free to override them. Is there
> > any way to pre-populate fields in the admin with the attribute values
> > from a parent or related files?
>
> > Thanks for your help.
>
> > --
> > 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, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Guadajuko! Vamos a correr!
>  -"Cool! we are going to run!"

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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, pixelcowboy  wrote:
> I'll try when I get home, but thanks again for your help!
>
> On Sep 14, 11:31 am, "nick.l...@gmail.com" 
> wrote:
>
>
>
> > Hi again! :)
>
> > I haven't thought this idea through, and very well could be
> > wildly inefficient! :)
>
> > Though in your admin.py when registering the admin model do something like
> > this:
>
> > from myproject.myapp.models import MyModel, OtherModel
>
> > class MyModelAdmin(models.admin):
> >     object_i_want = OtherModel.objects.get(field_i_care_about=whatever)
> >     prepopulated_fields = { "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 wrote:
>
> > > 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 its own instance (but not in
> > > the parent instance).
>
> > > My first idea is using something like a foreign key. This gives me
> > > access to the parent values, but not the ability to override them.
>
> > > The second option is multi-table inheritance from the parent class.
> > > This gives me the parents class attributes, but I again I dont get the
> > > fields in the admin, so Im not able to override them (at least not in
> > > the admin). Is there any way to this?
>
> > > The third option is to inherit an abstract class. The parent also
> > > inherits from this class, so both have the fields I need. However, I
> > > would like for the child class to inherit default values for this
> > > fields from the parent class, but be free to override them. Is there
> > > any way to pre-populate fields in the admin with the attribute values
> > > from a parent or related files?
>
> > > Thanks for your help.
>
> > > --
> > > 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, send email to
> > > django-users+unsubscr...@googlegroups.com > >  groups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> > --
> > Guadajuko! Vamos a correr!
> >  -"Cool! we are going to run!"

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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

2010-09-15 Thread pixelcowboy
Mmmm seems like inheritance is not as straight forward as I thought it
was... Might be that this is the case that the admin doesnt cut it for
what I need it to do... Ill probably need to see ways in which I can
extend it. Like for example, I can think of adding a callback to the
FK selection button, that when clicked, queries the database and
prepopulates the inherited values. Any suggestions on how to implement
this kind of thing. I have never use jquery for example to interact
with a database, any good tutorials or tips on how to do this with
django? Thanks!


On Sep 15, 7:59 am, "nick.l...@gmail.com"  wrote:
> Good question! :)
>
> I don't know...like I said I hadn't thought it through! :)
> I'll ponder it a bit...
>
> maybe you'd have to tackle it in a different direction...Say something like
> this:
>
> you have a dropdown in your project model that's blankable/nullable and it
> would essentially be a FK to other projects...
>
> When you clicked save (or save and continue working) you would have a custom
> save method that would go through and pull out all the information you
> wanted about that other project and pull it in to the new project.
>
> Does that make sense? Unfortunatly, it means you have to click a button to
> load the inherited values...BUT this way you can make sure that the users
> are selecting the right project to inherit from...
>
> ALSO it would have 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..
>
> n
>
> PS I'm just thinking of things off the top of my head! :)
> On Wed, Sep 15, 2010 at 4:16 AM, pixelcowboy wrote:
>
>
>
>
>
> > 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, pixelcowboy  wrote:
> > > I'll try when I get home, but thanks again for your help!
>
> > > On Sep 14, 11:31 am, "nick.l...@gmail.com" 
> > > wrote:
>
> > > > Hi again! :)
>
> > > > I haven't thought this idea through, and very well could be
> > > > wildly inefficient! :)
>
> > > > Though in your admin.py when registering the admin model do something
> > like
> > > > this:
>
> > > > from myproject.myapp.models import MyModel, OtherModel
>
> > > > class MyModelAdmin(models.admin):
> > > >     object_i_want = OtherModel.objects.get(field_i_care_about=whatever)
> > > >     prepopulated_fields = { "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  > >wrote:
>
> > > > > 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 its own instance (but not in
> > > > > the parent instance).
>
> > > > > My first idea is using something like a foreign key. This gives me
> > > > > access to the parent values, but not the ability to override them.
>
> > > > > The second option is multi-table inheritance from the parent class.
> > > > > This gives me the parents class attributes, but I again I dont get
> > the
> > > > > fields in the admin, so Im not able to override them (at least not in
> > > > > the admin). Is there any way to this?
>
> > > > > The third option is to inherit an abstract class. The parent also
> > > > > inherits from this class, so both have the fields I need. However, I
> > > > > would like for the child class to inherit default values for this
> > > > > fields from the parent class, but be free to override them. Is there
> > > > > any way to pre-populate fields in the admin with the attribute values
> > > > > from a parent or related files?
>
> > > > > Thanks for your help.
>
> > > > >

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

2010-09-15 Thread pixelcowboy
 Again my problem is that i want the actual values of the fields to
cascade down into child models, unless overridden by the child models.
Thanks again for your help, I'll think this through a bit more, there
might be a better way to conceptualize my models and their inheritance
than the way Im thinking.

On Sep 15, 10:55 am, "nick.l...@gmail.com" 
wrote:
> well...when you say inheritance...I was thinking that you were going to
> create some models like this:
>
> class BaseProject(models.Model):
>     title = models.CharField()
>     field2 = models.IntegerField()
>     field3 = models.TextField()
>
> class SubProject(BaseProject)
>     """
>     inherits the fields from BaseProject and allows you to override and add
> custom fields
>     """
>     field3 = models.CharField()
>     new_field = models.BigIntegerField()
>
> Then once you've set up your admins for these...
> you'll have two models you can interact with...one will be called
> BaseProject
> and the other will be called SubProject...
>
> These models in the admin don't inherit the data stored in them...they only
> inherit the fields defined...
>
> SO long story short...
>
> Inheritance won't transfer data from one model to another, it'll just allow
> you to inherit fields so if you had a model that was going to be 99% the
> same as a previous model, you'd just inherit from that, and then
> extend/override the field descriptions in the new model.
>
> Umm yeah you could use Jquery to do that...it's one way..though the only
> thing I've used ajax for in the change view is to add a thumbnail into the
> view of stuff that have image fields.
>
> I don't really have any good tutorials off the top of my 
> head...thoughwww.jquery.comhas some great documentation on the stuff available
> there...Also I've never done Jquery to interact with the DB..
>
> you might want to write a view and have 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:24 PM, pixelcowboy wrote:
>
>
>
>
>
> > Mmmm seems like inheritance is not as straight forward as I thought it
> > was... Might be that this is the case that the admin doesnt cut it for
> > what I need it to do... Ill probably need to see ways in which I can
> > extend it. Like for example, I can think of adding a callback to the
> > FK selection button, that when clicked, queries the database and
> > prepopulates the inherited values. Any suggestions on how to implement
> > this kind of thing. I have never use jquery for example to interact
> > with a database, any good tutorials or tips on how to do this with
> > django? Thanks!
>
> > On Sep 15, 7:59 am, "nick.l...@gmail.com"  wrote:
> > > Good question! :)
>
> > > I don't know...like I said I hadn't thought it through! :)
> > > I'll ponder it a bit...
>
> > > maybe you'd have to tackle it in a different direction...Say something
> > like
> > > this:
>
> > > you have a dropdown in your project model that's blankable/nullable and
> > it
> > > would essentially be a FK to other projects...
>
> > > When you clicked save (or save and continue working) you would have a
> > custom
> > > save method that would go through and pull out all the information you
> > > wanted about that other project and pull it in to the new project.
>
> > > Does that make sense? Unfortunatly, it means you have to click a button
> > to
> > > load the inherited values...BUT this way you can make sure that the users
> > > are selecting the right project to inherit from...
>
> > > ALSO it would have 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..
>
> > > n
>
> > > PS I'm just thinking of things off the top of my head! :)
> > > On Wed, Sep 15, 2010 at 4:16 AM, pixelcowboy  > >wrote:
>
> > > > 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 i

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

2010-09-15 Thread pixelcowboy
It kind of does... I'll see if I can manage it that way. Thanks again!


On Sep 15, 12:13 pm, "nick.l...@gmail.com" 
wrote:
> good luck! :)
>
> Here's another option...
> create a method or function that spawns a new project based off of what ever
> project is currenlty being viewed...
>
> The way I see it is: Adding a button to the admin that creates a new project
> based off the one currently being viewed...and then also redirects the user
> to the new object...so they can continue on...requires some admin magics but
> I THINK 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
>
> On Wed, Sep 15, 2010 at 7:05 PM, pixelcowboy wrote:
>
>
>
> >  Again my problem is that i want the actual values of the fields to
> > cascade down into child models, unless overridden by the child models.
> > Thanks again for your help, I'll think this through a bit more, there
> > might be a better way to conceptualize my models and their inheritance
> > than the way Im thinking.
>
> > On Sep 15, 10:55 am, "nick.l...@gmail.com" 
> > wrote:
> > > well...when you say inheritance...I was thinking that you were going to
> > > create some models like this:
>
> > > class BaseProject(models.Model):
> > >     title = models.CharField()
> > >     field2 = models.IntegerField()
> > >     field3 = models.TextField()
>
> > > class SubProject(BaseProject)
> > >     """
> > >     inherits the fields from BaseProject and allows you to override and
> > add
> > > custom fields
> > >     """
> > >     field3 = models.CharField()
> > >     new_field = models.BigIntegerField()
>
> > > Then once you've set up your admins for these...
> > > you'll have two models you can interact with...one will be called
> > > BaseProject
> > > and the other will be called SubProject...
>
> > > These models in the admin don't inherit the data stored in them...they
> > only
> > > inherit the fields defined...
>
> > > SO long story short...
>
> > > Inheritance won't transfer data from one model to another, it'll just
> > allow
> > > you to inherit fields so if you had a model that was going to be 99% the
> > > same as a previous model, you'd just inherit from that, and then
> > > extend/override the field descriptions in the new model.
>
> > > Umm yeah you could use Jquery to do that...it's one way..though the only
> > > thing I've used ajax for in the change view is to add a thumbnail into
> > the
> > > view of stuff that have image fields.
>
> > > I don't really have any good tutorials off the top of my
> > head...thoughwww.jquery.comhassome great documentation on the stuff
> > available
> > > there...Also I've never done Jquery to interact with the DB..
>
> > > you might want to write a view and have 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:24 PM, pixelcowboy  > >wrote:
>
> > > > Mmmm seems like inheritance is not as straight forward as I thought it
> > > > was... Might be that this is the case that the admin doesnt cut it for
> > > > what I need it to do... Ill probably need to see ways in which I can
> > > > extend it. Like for example, I can think of adding a callback to the
> > > > FK selection button, that when clicked, queries the database and
> > > > prepopulates the inherited values. Any suggestions on how to implement
> > > > this kind of thing. I have never use jquery for example to interact
> > > > with a database, any good tutorials or tips on how to do this with
> > > > django? Thanks!
>
> > > > On Sep 15, 7:59 am, "nick.l...@gmail.com"  wrote:
> > > > > Good question! :)
>
> > > > > I don't know...like I said I hadn't thought it through! :)
> > > > > I'll ponder it a bit...
>
> > > > > maybe you'd have to tackle it in a differen

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...@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.



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 models work.
>
> However, since you're only going create a model once (except migrations 
> later), is it really going to save that much work?
>
> If you want to do it a quick & dirty way, you could write a Perl one-liner 
> (or a Python script) to read your models.py and automatically output the file 
> with additional lines after each models.*Field line.
>
> Shawn

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 filefield? Or maybe just use a charfiled and do
it all in validation? What do you guys think?

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: filepath (system file system path) field

2010-09-22 Thread pixelcowboy
That field seems to grab all the files in a given directory according
to a set filtering. I actually just want to register the actual
directory names, and possible launch a file picker for the user to
select it.

On Sep 22, 2:30 am, Nuno Maltez  wrote:
> On Tue, Sep 21, 2010 at 6:17 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 a custom field perhaps? Or
> > perhaps extending the filefield? Or maybe just use a charfiled and do
> > it all in validation? What do you guys think?
>
> Hmmm something like 
> this?http://docs.djangoproject.com/en/dev/ref/models/fields/#filepathfield
>
> Nuno

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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:
>
>
>
>
>
>
>
> > On 27 Set, 14:52, Masklinn  wrote:
> > > On 2010-09-27, at 14:51 , girish shabadimath wrote:> hi all,
>
> > > > is there any IDE for Python/Django ?
>
> > > Yes.
>
> > Could you be less specific, please?
>
> > --
> > 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, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Regards,
> Sithembewena Lloyd Dubehttp://www.lloyddube.com

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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.
>
> > ı think for pycharm is wrote java programming
> > language..wing ide is best..
>
> Wings is written in Python, which is slower than Java...

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 :
>
> > 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, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Antoni Aloy López
> Blog:http://trespams.com
> Site:http://apsl.net

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 :
>
>
>
>
>
> > 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 :
>
> >> > 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, send email to 
> >> > django-users+unsubscr...@googlegroups.com.
> >> > For more options, visit this group 
> >> > athttp://groups.google.com/group/django-users?hl=en.
>
> >> --
> >> Antoni Aloy López
> >> Blog:http://trespams.com
> >> Site:http://apsl.net
>
> > --
> > 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, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> Antoni Aloy López
> Blog:http://trespams.com
> Site:http://apsl.net

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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):
 I want the field 'field' to have a blank=True value here,
that is, to not be required


Any ideas how to accomplish this? I was trying to use something like
self.__name__ with an expression, but self. does not seem to be
available to model fields.Thanks.

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 and only one of those models, which I dont know
how I would achieve using 2 or more separate foreign keys. The only
idea I have is to use generic relationships, and unique them. Any
ideas?

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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 and only one of those models, which I dont know
> > how I would achieve using 2 or more separate foreign keys. The only
> > idea I have is to use generic relationships, and unique them. Any
> > ideas?
>
> Maybe something like this?
>
> class Base(models.Model):
>     pass
>
> class Project(Base):
>     pass
>
> class Company(Base):
>     pass
>
> class Task(models.Model):
>      base = models.ForeignKey(Base)
>
> --
> Marc

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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 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 and only one of those models, which I dont know
> > > how I would achieve using 2 or more separate foreign keys. The only
> > > idea I have is to use generic relationships, and unique them. Any
> > > ideas?
>
> > Maybe something like this?
>
> > class Base(models.Model):
> >     pass
>
> > class Project(Base):
> >     pass
>
> > class Company(Base):
> >     pass
>
> > class Task(models.Model):
> >      base = models.ForeignKey(Base)
>
> > --
> > Marc

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 of a certain class?)

-- 
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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



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 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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: verbose field names in admin

2010-03-01 Thread pixelcowboy
No matter what I do, the verbose name for the fields do not change
what appears on the admin view.


On Mar 1, 2:45 pm, Adam Yee  wrote:
> When in doubt, always refer to the docs 
> -http://docs.djangoproject.com/en/dev/ref/models/options/
> There may 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  wrote:
>
>
>
> > 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 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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: verbose field names in admin

2010-03-01 Thread pixelcowboy
Im not trying to change the verbose name for the model class, but for
individual fields in the model, by the way.

On Mar 1, 2:45 pm, Adam Yee  wrote:
> When in doubt, always refer to the docs 
> -http://docs.djangoproject.com/en/dev/ref/models/options/
> There may 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  wrote:
>
>
>
> > 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 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, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.