Re: How can I read child model class' DecimalField attribute 'decimal_places' from inside a parent Meta class

2018-12-27 Thread Mikkel Kromann
class, but not from the parent class. Mikkel torsdag den 27. december 2018 kl. 20.59.43 UTC+1 skrev Mikkel Kromann: > > > Hello. > > I have a parent Meta class and some child classes. > I would like to read the decimal_places attribute from DecimalField of my > child ins

How can I read child model class' DecimalField attribute 'decimal_places' from inside a parent Meta class

2018-12-27 Thread Mikkel Kromann
Hello. I have a parent Meta class and some child classes. I would like to read the decimal_places attribute from DecimalField of my child instances using a function in my parent class. I am able to read the attribute from inside my child classes, but I cant crack how to read from a function in

Re: Choices in DecimalField - django 1.8.

2017-09-19 Thread Gordon Wrigley
In case anyone else ends up here, I've found that it's very sensitive to how you specify the Decimal, so in my example Decimal('20.00') worked but Decimal('20') and Decimal(20) did not. On Monday, April 20, 2015 at 6:44:30 PM UTC+1, eltonplima wrote: > > In the model below, using the Django admi

Choices in DecimalField - django 1.8.

2015-04-20 Thread Elton Pereira
In the model below, using the Django admin, no matter what value I choose, it always displays the default value. But writes the correct value in the database. Am I doing something wrong or is this a bug? TENSAO_220 = Decimal(220) TENSAO_110 = Decimal(110) TENSOES = ((TENSAO_220, '220 volts'),

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-25 Thread elcaiaimar
It works! You are great Collin! Thank you very much! El domingo, 16 de noviembre de 2014 18:51:43 UTC+1, elcaiaimar escribió: > > Hello everybody, I've a problem with DecimalField at Forms. I've a long > form in my template and I want to left some fields in blank. I've

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-24 Thread Collin Anderson
your > advice! > > Thank you very much! > > > El domingo, 16 de noviembre de 2014 18:51:43 UTC+1, elcaiaimar escribió: >> >> Hello everybody, I've a problem with DecimalField at Forms. I've a long >> form in my template and I want to left some f

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-22 Thread elcaiaimar
ybody, I've a problem with DecimalField at Forms. I've a long > form in my template and I want to left some fields in blank. I've declared > these fields with > *required=False*, but when I submit the form I receive this error: '*This > value must be a decimal

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-21 Thread Collin Anderson
seccionmayor=seccionmayor, seccionmenor=seccionmenor, > numacometidas=numacometidas, > origen=origen, observaciones=observaciones, geom=pnt) > > xy.save() > > I've tried to put default=None or default=Decimal('0.00') in my mod

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-20 Thread elcaiaimar
y.save() I've tried to put default=None or default=Decimal('0.00') in my models.py but it continues without working. I don't know what can I do Thank you very much El domingo, 16 de noviembre de 2014 18:51:43 UTC+1, elcaiaimar escribió: > > Hello everybody, I've a

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-17 Thread elcaiaimar
TC+1, elcaiaimar escribió: > > Hello everybody, I've a problem with DecimalField at Forms. I've a long > form in my template and I want to left some fields in blank. I've declared > these fields with > *required=False*, but when I submit the form I receive this erro

DecimalField returns 'This value must be a decimal number' when blank

2014-11-17 Thread fred . wulei
You'd better have a look at the raw database SQL. I think syncdb won't change the null attr of this column if it is not set in the first time. So the possible solutions are 1) change the column in db manually 2) use a migration tool like south. Hope this can help you. -- You received this mess

DecimalField returns 'This value must be a decimal number' when blank

2014-11-17 Thread fred . wulei
I think you'd better have a look at the raw db sql. I remember that the syncdb won't change the null attr. of a column if it's not set when initialized. So two possible solutions: 1) set the db manually 2) use a tool like south to do a migration. Hope I can help you. -- You received this messa

Re: DecimalField returns 'This value must be a decimal number' when blank

2014-11-16 Thread Vijay Khemlani
aimar wrote: > Hello everybody, I've a problem with DecimalField at Forms. I've a long > form in my template and I want to left some fields in blank. I've declared > these fields with > *required=False*, but when I submit the form I receive this error: '*This > va

DecimalField returns 'This value must be a decimal number' when blank

2014-11-16 Thread elcaiaimar
Hello everybody, I've a problem with DecimalField at Forms. I've a long form in my template and I want to left some fields in blank. I've declared these fields with *required=False*, but when I submit the form I receive this error: '*This value must be a decimal numb

django DecimalField and scientific notation when displayed

2014-09-04 Thread Michael
Hello, How to display the DecimalField without the E (scientific) notation in the django admin? Here is my field: models.DecimalField(max_digits=12, decimal_places=8, null=True) Here is what I see in the admin: 0E-8.# on the table 0E-8 # in the form

Re: DecimalField Problem

2014-01-14 Thread Tom Evans
t only > admin), if I switch to sqlite3 backend then it works perfectly > Decimal("0E-8") == Decimal(0) == Decimal(0.0) If you do not want the python representation of your field to be a Decimal, do not use DecimalField, use FloatField. https://docs.djangoproject.com/en/1

Re: DecimalField Problem

2014-01-14 Thread Eric Rouleau
fectly On Thursday, January 9, 2014 3:37:38 AM UTC-5, Timothy W. Cook wrote: > > > On Wed, Jan 8, 2014 at 10:42 PM, Dennis Lee Bieber > > > wrote: > > >> If Django's "DecimalField" is NOT use Python's Decimal type, I'd >> be >

Re: DecimalField Problem

2014-01-09 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 10:42 PM, Dennis Lee Bieber wrote: > If Django's "DecimalField" is NOT use Python's Decimal type, I'd be > concerned... Python's Decimal is NOT a "float". > > However, the conversion of a Decimal to/from P

Re: DecimalField Problem

2014-01-08 Thread Mike Dewhirst
On Thursday, January 9, 2014 7:37:43 AM UTC+11, Timothy W. Cook wrote: > > > On Wed, Jan 8, 2014 at 6:07 PM, Erik Cederstrand > > > wrote: > >> Den 08/01/2014 kl. 17.56 skrev Daniel Roseman >> >> >: >> > > > >> But to post the solution to the issue, just for completeness. >> > > Yes, Djan

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 6:07 PM, Erik Cederstrand wrote: > Den 08/01/2014 kl. 17.56 skrev Daniel Roseman : > > > > Greatly embarrassed, and thanks for clarifying. Will be more careful when > answering next time :-) > > Erik > > Well, Erik. I appreciate you answering even if it wasn't 100% accurate

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
prisingly) the `decimal` module. As the > documentation for that module explains, decimals do provide precise > floating-point arithmetic, and are therefore suitable for representing things > like currencies. Databases usually also provide a similar datatype, which > Django's De

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
(not surprisingly) the `decimal` module. As the > documentation for that module explains, decimals do provide precise > floating-point arithmetic, and are therefore suitable for representing > things like currencies. Databases usually also provide a similar datatype, > which Django's

Re: DecimalField Problem

2014-01-08 Thread Daniel Roseman
t before writing it out to the file (an XML schema) > so it really isn't a big deal, just surprising. > > Ah, the “decimal” in DecimalField only refers to how you are supposed to > enter the values in a form. Python itself only has float and that’s what > Django uses internal

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
t surprising. Ah, the “decimal” in DecimalField only refers to how you are supposed to enter the values in a form. Python itself only has float and that’s what Django uses internally. Decimal vs. scientific notation is just a matter of how you choose to format the output when converting the float to a

Re: DecimalField Problem

2014-01-08 Thread Timothy W. Cook
On Wed, Jan 8, 2014 at 1:44 PM, Erik Cederstrand wrote: > Den 08/01/2014 kl. 16.18 skrev Timothy W. Cook : > > > > So, why doesn't it just store a zero? > > Underneath a DecimalField there is a Python float type, and some > equivalent float type in your

Re: DecimalField Problem

2014-01-08 Thread Erik Cederstrand
is > concept."), null=True, blank=True) > > Via the admin interface when I enter a 0 (zero) and save the object I get > 0E-10 as the value. I am using PostgreSQL 9.1 for persistence. > > So, why doesn't it just store a zero? Underneath a DecimalField there is

DecimalField Problem

2014-01-08 Thread Timothy W. Cook
I have several decimal fields defined in the model like this: min_inclusive = models.DecimalField(_('minimum inclusive'), max_digits=19, decimal_places=10, help_text=_("Enter the minimum (inclusive) value for this concept."), null=True, blank=True) Via the admin interface when I enter a 0 (zero)

Re: DecimalField and SQL Server

2013-12-08 Thread Derrick Jackson
Tom, Thanks for the quick response and explanation. Using adodbapi is not an option in the environment we run in, but I am checking with the django_pyodbc developers to see why decimal values are converted to float prior to saving to the database. On Sunday, December 8, 2013 11:16:56 AM UTC-

Re: DecimalField and SQL Server

2013-12-08 Thread Tom Lockhart
On 2013-12-08, at 7:18 AM, Derrick Jackson wrote: > Thanks Vernon and Michael. > > I've done a little more research and at first I thought the problem was in > django_pyodbc. However, running the following "%0.2f" % 3 > from the python console and it yields '2

Re: DecimalField and SQL Server

2013-12-08 Thread Derrick Jackson
Thanks Vernon and Michael. I've done a little more research and at first I thought the problem was in django_pyodbc. However, running the following "%0.2f" % 3 from the python console and it yields '2.00' and I don't understand why the digit prior to the decimal

Re: DecimalField and SQL Server

2013-12-06 Thread Vernon D. Cole
Derrick: I just added your failing test pattern to the unit test for adodbapi, and it works correctly. Therefore I would conclude that the problem is in django-pyodbc, not in SQL Server itself. Micheal and I maintain the other SQL server backend, sqlserver_ado, so I am afraid that we can't be

Re: DecimalField and SQL Server

2013-12-06 Thread Derrick Jackson
Hi Michael, I'm using django-pyodbc 0.10 On Friday, December 6, 2013 8:42:00 AM UTC-5, Michael Manfre wrote: > > Which database backend are you using to connect to SQL Server? > > Regards, > Michael Manfre > > On Friday, December 6, 2013 6:45:30 AM UTC-5, Derrick Jackson wrote: >> >> Hello all, >

Re: DecimalField and SQL Server

2013-12-06 Thread Michael Manfre
Which database backend are you using to connect to SQL Server? Regards, Michael Manfre On Friday, December 6, 2013 6:45:30 AM UTC-5, Derrick Jackson wrote: > > Hello all, > > I have a strange occurrence I'd like to share to see if any of you have > run into the same thing. I am using Django 1.5

DecimalField and SQL Server

2013-12-06 Thread Derrick Jackson
Hello all, I have a strange occurrence I'd like to share to see if any of you have run into the same thing. I am using Django 1.5.4, SQL Server 2008, and have the following field definition in one of my models: gift_value = models.DecimalField(max_digits=20, decimal_places=2, verbose_name='Gift

Re: DecimalField

2013-11-05 Thread Derrick Jackson
Thanks Tom. This did the trick. Much appreciated. On Sunday, August 25, 2013 5:47:00 AM UTC-4, Derrick Jackson wrote: > > Hi All, > > My Model has a DecimalField: > > amount = models.DecimalField(max_digits=19, decimal_places=2, > verbose_name='Amount') >

Re: DecimalField

2013-11-05 Thread Tom Evans
n %s digits before the decimal point.') The problem arises because the documentation seems incorrect for 1.5 (and trunk): """ The max_value and min_value error messages may contain %(limit_value)s, which will be substituted by the appropriate limit. """ htt

Re: DecimalField

2013-11-05 Thread Derrick Jackson
imal_places key is being ignored. Has anyone seen this before? > BTW, I am using Django 1.5.2 > > On Sunday, August 25, 2013 5:47:00 AM UTC-4, Derrick Jackson wrote: >> >> Hi All, >> >> My Model has a DecimalField: >> >> amount = models.Decimal

Re: DecimalField

2013-08-27 Thread Derrick Jackson
using Django 1.5.2 On Sunday, August 25, 2013 5:47:00 AM UTC-4, Derrick Jackson wrote: > > Hi All, > > My Model has a DecimalField: > > amount = models.DecimalField(max_digits=19, decimal_places=2, > verbose_name='Amount') > > My ModelForm has the

Re: DecimalField

2013-08-25 Thread Thomas Scrace
You're creating an entirely new DecimalField, rather than altering the error messages of your existing field. I think what you want is: class YourForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(YourForm, self).__init__(*args, **kwargs) self.fields[&q

DecimalField

2013-08-25 Thread Derrick Jackson
Hi All, My Model has a DecimalField: amount = models.DecimalField(max_digits=19, decimal_places=2, verbose_name='Amount') My ModelForm has the following: self.fields['amount'] = forms.DecimalField(error_messages={ 'required': 'Amount is required

Re: Trailing zeros in DecimalField

2013-05-20 Thread Derek
Possibly related to localisation. See: https://groups.google.com/forum/?fromgroups#!topic/django-users/evJ7jg-YhdM https://docs.djangoproject.com/en/dev/topics/i18n/formatting/ On Sunday, 19 May 2013 01:37:22 UTC+2, Pedro J. Aramburu wrote: > > I've been reviewing the code of *models.DecimalFiel

Trailing zeros in DecimalField

2013-05-18 Thread Pedro J. Aramburu
I've been reviewing the code of *models.DecimalField* and * forms.DecimalField* because trailing zeros after the decimal point are being removed in my forms. I didn't find anything suggesting that it's done there, instead they are handled properly according to my needs. Although the proper handl

Re: Unable to Store Decimal values to DecimalField

2012-09-27 Thread Amyth Arora
What other integer fields are there in your model ? On Thu, Sep 27, 2012 at 2:35 PM, Sergey Fursov wrote: > As I see from the stack, error produced by book.save() in File > "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118 but in you > code I can't this line of code. Do you really sh

Re: Unable to Store Decimal values to DecimalField

2012-09-27 Thread Sergey Fursov
As I see from the stack, error produced by book.save() in File "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118 but in you code I can't this line of code. Do you really show the code, that related to error 2012/9/27 Laxmikant Gurnalkar > Hi , > >While storing decimal values to da

Unable to Store Decimal values to DecimalField

2012-09-27 Thread Laxmikant Gurnalkar
Hi , While storing decimal values to database I have following error. Exception in storeFormatMetadataTraceback (most recent call last): File "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118, in storePricing book.save() File "/var/opt/igp_acfs/acfs/models.py", line 529, in s

Re: Django's DecimalField represenation in admin as 0,00 values

2012-05-04 Thread orschiro
/github.com/divio/django-shop/blob/master/shop/admin/mixins.py > > For your "2.1" problem, set decimal_places to 2 DecimalField. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django

Re: Django's DecimalField represenation in admin as 0,00 values

2012-05-02 Thread jrief
: https://github.com/divio/django-shop/pull/146#issuecomment-4720340 and here https://github.com/divio/django-shop/blob/master/shop/admin/mixins.py For your "2.1" problem, set decimal_places to 2 DecimalField. -- You received this message because you are subscribed to the Google Group

Re: Django's DecimalField represenation in admin as 0,00 values

2012-05-02 Thread Mike Dewhirst
On 3/05/2012 2:30pm, orschiro wrote: Anybody? On May 2, 11:07 am, orschiro wrote: I want to represent a price in my model in the form of 0,00. This is the part of my model. price = models.DecimalField(max_digits=5, decimal_places=2, default=Decimal('0.00')) However, prices such as 2.10 are s

Re: Django's DecimalField represenation in admin as 0,00 values

2012-05-02 Thread orschiro
Anybody? On May 2, 11:07 am, orschiro wrote: > I want to represent a price in my model in the form of 0,00. This is > the part of my model. > > price = models.DecimalField(max_digits=5, decimal_places=2, > default=Decimal('0.00')) > > However, prices such as 2.10 are still represented as 2.1. > >

Django's DecimalField represenation in admin as 0,00 values

2012-05-02 Thread orschiro
I want to represent a price in my model in the form of 0,00. This is the part of my model. price = models.DecimalField(max_digits=5, decimal_places=2, default=Decimal('0.00')) However, prices such as 2.10 are still represented as 2.1. The second issue would be to replace the . with a ,. However

DecimalField values changing on save()

2011-09-05 Thread Wilfred Hughes
Hi all I know this is a bit of a corner case, but I was slightly surprised by the behaviour of DecimalField with the value -0.0. Given the model: class Word(models.Model): word = models.CharField(max_length=50, unique=True) number = models.DecimalField(max_digits=8, decimal_places=5

Re: select_related() changes type of DecimalField?

2011-04-05 Thread Carsten Fuchs
Dear Ian, Am 04.04.2011 22:27, schrieb Ian: Yes, this appears to be a bug. If you would, please create a ticket for it in the Django Trac so that we don't forget about it. Gladly: http://code.djangoproject.com/ticket/15766 Best regards, Carsten -- Cafu - the open-source Game and Graphi

Re: select_related() changes type of DecimalField?

2011-04-04 Thread Ian
On Apr 4, 12:05 pm, Carsten Fuchs wrote: > Is this a bug in Django? > If not, is there a better solution to the problem than using > isinstance() in every place where I have to compare DecimalField values? > (I'm still quite new to Python, and might be overlooking something &

select_related() changes type of DecimalField?

2011-04-04 Thread Carsten Fuchs
Dear Django list, using Django 1.3 with Python 2.6.5 on Ubuntu 10.04 and mod_wsgi, with Oracle database, I've just experienced a case where the use of select_related() changes the result type of a DecimalField in a related object from decimal.Decimal to float (which in turn brea

Re: DecimalField, how to accept $ character

2010-07-20 Thread Franklin Einspruch
Or change it to a CharField and do the string-to-decimal conversion yourself. Javier's solution is better, though. Franklin On Tue, Jul 20, 2010 at 10:33 AM, Javier Guerra Giraldez wrote: > On Tue, Jul 20, 2010 at 9:10 AM, reduxdj wrote: >> Users on my site can't type dollar signs without a for

Re: DecimalField, how to accept $ character

2010-07-20 Thread Bill Freeman
Example, no, but you could create a custom field, based on the DecimalField, which a custom validator that checks for and removes a leading dollar sign. I think that django snippets has a good chance of having examples of "currency" fields, and if not, Satchmo has one. Perhaps they do

Re: DecimalField, how to accept $ character

2010-07-20 Thread Javier Guerra Giraldez
On Tue, Jul 20, 2010 at 9:10 AM, reduxdj wrote: > Users on my site can't type dollar signs without a form error showing. > I'd rather allow them > to type a dollar sign then clean it away after the fact? Can i see an > example for this procedure please. just put the $ sign on the field's label, t

DecimalField, how to accept $ character

2010-07-20 Thread reduxdj
Hi, Users on my site can't type dollar signs without a form error showing. I'd rather allow them to type a dollar sign then clean it away after the fact? Can i see an example for this procedure please. Thanks, Patrick -- You received this message because you are subscribed to the Google Groups

Re: Problem with L10N of DecimalField

2010-07-06 Thread Simon Westphahl
I'm using Django 1.2.1 and it doesn't work any longer ;) Just switched back to Django 1.2 and it works. But I think that's not a solution. Regards Simon On 6 Jul., 15:21, saboter wrote: > I used the workaround in project that runs under django 1.2 and it > looks good in admin even after repeated

Re: Problem with L10N of DecimalField

2010-07-06 Thread saboter
er why the DateTimeField is localized by default and the > DecimalField is not. > > Regards > Simon > > On 5 Jul., 19:33, saboter wrote: > > > > > I have mixed models with admin in my example. Sorry. > > > It should be like this: > > > ### models.py >

Re: Problem with L10N of DecimalField

2010-07-05 Thread Simon Westphahl
DateTimeField is localized by default and the DecimalField is not. Regards Simon On 5 Jul., 19:33, saboter wrote: > I have mixed models with admin in my example. Sorry. > > It should be like this: > > ### models.py > [...] > class JobForm(ModelForm): >     def __init

Re: Problem with L10N of DecimalField

2010-07-05 Thread saboter
gt; localized by default ... > > > On 4 Jul., 11:03, Simon Westphahl wrote: > > > > For clarification: The output in the admin list view is properly > > > localized. Only the input doesn't work. > > > I'm using Django 1.2.1 and a almost vanilla Dj

Re: Problem with L10N of DecimalField

2010-07-05 Thread saboter
tphahl wrote: > > > > > For clarification: The output in the admin list view is properly > > localized. Only the input doesn't work. > > I'm using Django 1.2.1 and a almost vanilla Django project only with > > this one test app installed. > > > On 3

Re: Problem with L10N of DecimalField

2010-07-04 Thread Simon Westphahl
ut in the admin list view is properly > localized. Only the input doesn't work. > I'm using Django 1.2.1 and a almost vanilla Django project only with > this one test app installed. > > On 3 Jul., 22:07, Simon Westphahl wrote: > > > > > Hi, > > > I

Re: Problem with L10N of DecimalField

2010-07-04 Thread Simon Westphahl
plement a localized "DecimalField" but it doesn't seem to > work. When entering a decimal number with a German decimal seperator > ( , ) the admin interface tells me to "Enter a number". Is there some > setting/middleware/etc. I overlooked? > > My "settings.

Problem with L10N of DecimalField

2010-07-03 Thread Simon Westphahl
Hi, I tried to implement a localized "DecimalField" but it doesn't seem to work. When entering a decimal number with a German decimal seperator ( , ) the admin interface tells me to "Enter a number". Is there some setting/middleware/etc. I overlooked? My "se

Re: django version 1.1.1 decimalfield invalidoperation

2010-05-14 Thread mendes.rich...@gmail.com
decimal_places digits to > the right of the decimal point, so you can only have up to five on the > left.) Here you are trying to store a number that has six digits to the left > of the decimal point, which won't fit in the DecimalField you have > specified. > > Traceback (most r

Re: django version 1.1.1 decimalfield invalidoperation

2010-05-14 Thread Karen Tracey
Here you are trying to store a number that has six digits to the left of the decimal point, which won't fit in the DecimalField you have specified. Traceback (most recent call last): > [traceback snipped] > File "/usr/lib/python2.4/decimal.py", line 2267, in _raise_er

Re: django version 1.1.1 decimalfield invalidoperation

2010-05-14 Thread mendes.rich...@gmail.com
Hello Karen, Thanks for your reply, i checked the code from the ticket and it was indeed already changed in the current version. The specs of the system i',m using are; Python 2.4.3 Django 1.1.1 final Database Postgresql Interface postgresql_psycopg2 The problem i'm having is with the following

Re: django version 1.1.1 decimalfield invalidoperation

2010-05-11 Thread Karen Tracey
On Tue, May 11, 2010 at 9:49 AM, mendes.rich...@gmail.com < mendes...@gmail.com> wrote: > On our production server we are running the last official release > 1.1.1, > When i started uploading big decimal values i ran into trouble and > came across a ticket which described the error. > > This was t

django version 1.1.1 decimalfield invalidoperation

2010-05-11 Thread mendes.rich...@gmail.com
Hello Django Users, On our production server we are running the last official release 1.1.1, When i started uploading big decimal values i ran into trouble and came across a ticket which described the error. This was ticket 10692 and it was solved. Unfortunately i couldn't track down which files

pickle error in DecimalField

2010-01-06 Thread Akash
I am using DecimalField in django table for pricing. It works fine sometimes but sometimes it throws an Pickle error (PicklingError: Can't pickle : it's not the same object as decimal.Decimal). I am importing decimal module in views also. Have anyone encountered this issue? Can anyo

DecimalField / floatField format

2009-11-26 Thread Benjamin Wolf
Hi there, I need another decimalField / floatField format (',' instaed of '.') I've found this: http://groups.google.com/group/django-users/browse_thread/thread/9ff4db80932d334f But I ask myself if there isn't a simpler method for such a common task. (Like

ifequals Decimalfield comparison

2009-01-14 Thread Ardesco
So, I have a decimalfield that can be 3 different values. In my view, I pass in a dictionary of values that contains the appropriate decimal values as keys. {% for item in booklist %} {% for key, value in numvec.items %} {{item.number}} {% ifequals item.number value %} {{value}} {% endifequals

My DecimalField is showing (None) in the list_display in my admin...when empty

2008-04-03 Thread Greg
Hello, I have the following field in my Order class: payment = models.DecimalField("Payment Amount", max_digits=6, decimal_places=2, blank=True, null=True) As as example let's say I create a new Order and don't put anything in the payment field. For some reason when I'm viewing Orders in the Li

Re: DecimalField format

2007-07-01 Thread Mitja Martini
Do you know Satchmo's currency filter? http://www.satchmoproject.com/trac/browser/trunk/satchmo/shop/templatetags/currency_filter.py?rev=195 Regards, Mitja --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: DecimalField format

2007-07-01 Thread Malcolm Tredinnick
On Sun, 2007-07-01 at 21:06 -0700, Ceschiatti wrote: > Hi. > > Is it possible to change the DecimalField format so that it uses "," > instead of "." for the decimal part separation? Not at the moment, no. Eventually we will format (and validate form input) base

DecimalField format

2007-07-01 Thread Ceschiatti
Hi. Is it possible to change the DecimalField format so that it uses "," instead of "." for the decimal part separation? []s Ceschiatti --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups &quo

Re: form_for_model, DecimalFIeld, and decimal_places

2007-06-05 Thread ringemup
OK, I wasn't really sure how to do this correctly, but I just filed ticket #4486 ( http://code.djangoproject.com/ticket/4486 ) -- hopefully in a useful form! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: form_for_model, DecimalFIeld, and decimal_places

2007-06-05 Thread Russell Keith-Magee
On 6/6/07, ringemup <[EMAIL PROTECTED]> wrote: > > > 1) This sounds like it could be a bug. If your model defines 2 decimal > > places, my initial reaction is that the form should show 2 decimal > > places by default. > > Well, I figured that with currency being such a common use, if it were > a b

Re: form_for_model, DecimalFIeld, and decimal_places

2007-06-05 Thread ringemup
> 1) This sounds like it could be a bug. If your model defines 2 decimal > places, my initial reaction is that the form should show 2 decimal > places by default. Well, I figured that with currency being such a common use, if it were a bug it would already have been found and squashed. But mayb

Re: form_for_model, DecimalFIeld, and decimal_places

2007-06-05 Thread Russell Keith-Magee
On 6/6/07, ringemup <[EMAIL PROTECTED]> wrote: > > Hello again -- > > I'm creating a form using form_for_model. The model in question has a > decimal field with 2 decimal places. The form, however, is displaying > the field with one decimal place. I've googled and poked through the > tests, but

form_for_model, DecimalFIeld, and decimal_places

2007-06-05 Thread ringemup
Hello again -- I'm creating a form using form_for_model. The model in question has a decimal field with 2 decimal places. The form, however, is displaying the field with one decimal place. I've googled and poked through the tests, but I can't figure out how to override this without creating an