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: Admin Site m2m Inline get_or_create

2013-02-04 Thread Pedro J. Aramburu
Anyone? Please? El viernes, 1 de febrero de 2013 19:43:24 UTC-3, Pedro J. Aramburu escribió: > > Dear Djangonauts, > I'm in a bit of a pickle here and I would appreciate your help. I have a > model which needs multiple dates. I thought on serializing them onto a > TextField

Admin Site m2m Inline get_or_create

2013-02-01 Thread Pedro J. Aramburu
Dear Djangonauts, I'm in a bit of a pickle here and I would appreciate your help. I have a model which needs multiple dates. I thought on serializing them onto a TextField but it isn't pretty and a query-hell so instead settled for a m2m field. Now, on the django admin site I want to be able t

Re: How to create superuser?

2013-01-07 Thread Pedro J. Aramburu
If you're using bash, you should set it up on ~/.bashrc file, that way it will always load, for every virtualenv and every terminal session. BTW ~/ stands for the home directory and instead of LC_ALL try something like this: export LANG="en_US.UTF-8" That would give less trouble with other pro

Re: Change label/title from an application added to django admin

2013-01-06 Thread Pedro J. Aramburu
Currently, there isn't a proper way of doing it. I will say that your best choice is to edit the template for the admin "index" and the "app index" so if app_name is "Emp" call it other way. I know it's a dirty hack but currently there is no "standard" application on django so there isn't an ed

Re: Modelforms and class based views

2013-01-06 Thread Pedro J. Aramburu
https://docs.djangoproject.com/en/1.4/topics/forms/modelforms/#model-formsets El domingo, 6 de enero de 2013 11:46:40 UTC-3, Pedro J. Aramburu escribió: > > Have you tried merging the forms with formsets? > https://docs.djangoproject.com/en/1.4/topics/forms/formsets/ > > El viernes

Re: Modelforms and class based views

2013-01-06 Thread Pedro J. Aramburu
Have you tried merging the forms with formsets? https://docs.djangoproject.com/en/1.4/topics/forms/formsets/ El viernes, 4 de enero de 2013 13:51:41 UTC-3, Marco A Morales escribió: > > Hi everyone, > > I'm still wraping my head around class based views and I'm trying my first > project with clas

Re: InMemoryUploadedFile no `encoding` Attribute

2013-01-06 Thread Pedro J. Aramburu
I believe that as InMemoryUploadedFile is "InMemory", internally uses a cStringIO as the "container" for the file. So basically the class it's just a wrapper that returns the StringO object, a string representation of the file. You should check for the attributes of StringO or maybe use SimpleU

Re: Can't set static file directory.

2013-01-06 Thread Pedro J. Aramburu
That is in a development server? Why not use ./manage.py runserver? If not you can point apache to the wsgi file and use django itself to serve the static files modifying a little bit urls.py. But it's not recommended for production use. https://docs.djangoproject.com/en/1.4/howto/static-files/

Re: Can't set static file directory.

2013-01-06 Thread Pedro J. Aramburu
Because it's configured that way in apache, not in django, and it doesn't exist ergo the error message. El sábado, 5 de enero de 2013 15:38:32 UTC-3, Mārtiņš Jakubovičs escribió: > > Hello. > > I try a lot of things and can't understand, why not working STATIC_ROOT > and MEDIA_ROOT in settings.p

Re: Help implement CSS into Django!!!!

2013-01-06 Thread Pedro J. Aramburu
Czaro, to better understand the problem it will be good if you could tell us something more about how are you calling your css files from your templates and where are they located. I will also assume Django 1.4 to tell you some tips (mostly already covered). - Set your STATIC_ROOT. I use

Re: Django app custom settings testing

2013-01-04 Thread Pedro J. Aramburu
Source the app it won't be a piece of sh... Sorry again, I got carried away. -- Tres42 Pedro J. Aramburu On Fri, Jan 4, 2013 at 12:59 PM, nkryptic wrote: > The only thing I've seen which handles all the cases you mention is > http://passingcuriosity.com/2010/default-settings-for-dja

Re: Django app custom settings testing

2013-01-03 Thread Pedro J. Aramburu
nside. Just want to know if my approach would work. As I see it, it's like lazy loading the settings so if the settings change in the project environment, they should also change in the app. Or something like that is what I'm trying to do. What do you think? What would you do? Thank yo

Django app custom settings testing

2013-01-02 Thread Pedro J. Aramburu
Hi, I'm having troubles using the override_settings decorator. The thing is I'm writing an app that has it's own settings and I'm doing it with the approach of putting a settings.py file on the app folder with something like this: from django.conf import settings from django.core.exceptions imp

Re: HELP!!! Admin Site app name rename

2012-12-06 Thread Pedro J. Aramburu
t; If you want to change the "Django Administration" name to something app > specific, then I would supply a new admin/base_site.html template (copy the > one from django-source/contrib/admin/templates/admin, modify it, and put it > into a templates/admin folder in your own app)

Re: How to introduce a text area as a field of a database entry

2012-12-06 Thread Pedro J. Aramburu
CharField is for "short" strings mostly under 255 of length. TextField is for "unlimited" text (the length depends of the database engine). If you just want a textarea for the CharField then you will need to replace the default widget. You'll need to read a little about Forms to change the widg

Re: how to include html in your text area

2012-12-06 Thread Pedro J. Aramburu
Joy, look into the database if it is being saved without escaping. If that's the case you need to render it without escaping marking it as safe with the safe filter. For example: This will not be escaped: {{ data|safe }} or you can use a template block like this: {% autoescape off %} Hello

HELP!!! Admin Site app name rename

2012-12-05 Thread Pedro J. Aramburu
I hope someone could help me. My main language is Spanish but when I write code I like it to be en english. Being that way it will be easier to open source something in the future. The main problem is the app name in the Admin Site. For example, I'm writing a kind of eCommerce site without the