override django.forms with html5 forms

2010-12-06 Thread Alexandre González
Hi! Is any easy way to use html5 forms instead normal forms? For example overriding the django.forms importing other package that inherits all from it, except the widgets. Thanks! Álex González -- @agonzalezro Please, don't send me files with extensions: .doc,

Re: 2 paypal forms in a view with django-paypal

2010-12-06 Thread Alexandre González
I'm using johnboxall django-paypal, I solved this problem creating a view that only shows the form, and after it load this forms with 3 ajax petitions. Anyway, thanks for your help :) On Tue, Nov 30, 2010 at 14:31, Venkatraman S <venka...@gmail.com> wrote: > 2010/11/30 Alexandre

2 paypal forms in a view with django-paypal

2010-11-30 Thread Alexandre González
Hi! I like to show 2 different paypal forms using django-paypal, this is my code: def payments(request): paypal_dict = { 'amount': None, 'business': settings.PAYPAL_RECEIVER_EMAIL, 'item_name': None, 'notify_url': settings.PAYPAL_NOTIFY, 'return_url':

Re: Two ForeignKeys to show a combo in admin

2010-10-25 Thread Alexandre González
> look at: > http://www.stereoplex.com/blog/filtering-dropdown-lists-in-the-django-admin > and > > http://www.artfulcode.net/articles/runtime-choicefield-filtering-in-djangos-admin/ > > On Oct 23, 4:58 pm, Alexandre González <agonzale...@gmail.com> wrote: > > Hi! I

Two ForeignKeys to show a combo in admin

2010-10-23 Thread Alexandre González
Hi! I have a model as this: class User: id class Type: user = ForeignKey(User) class B: user = ForeignKey(User) type = ForeignKey(Type) When I'm creating a B object in the admin I like to show a combo with all the users, and after select the user in the first combo, fill the second

show mail as the option instead username in admin

2010-09-24 Thread Alexandre González
Hi! I like to show the email instead the username in the that django uses when you define you attrib as ForeignKey in your model. Anybody know how can I do this? Thanks! -- @agonzalezro Please, don't send me files with extensions: .doc, .docx, .xls, .xlsx,

Re: REST XML + HTML API suggestions

2010-09-21 Thread Alexandre González
I'm using django-piston in my app, and it's incredible. You can use XML in your RESTful API, but if you like to user another emitter as JSON, Pickle... you can do at-the-moment! Incredible! On Tue, Sep 21, 2010 at 11:11, vikalp sahni wrote: > Hi, > > You might want to

Re: Translating Google Chart API parameters to Django

2010-09-07 Thread Alexandre González
I'm using this snippet: http://djangosnippets.org/snippets/1494/ I hope that this works for you! On Mon, Sep 6, 2010 at 13:30, tbb wrote: > Is there a table that translates the Google Chart API parameters to > Django tags? > > The parameters for creating a chart using the

Save a ManyToMany via code

2010-09-06 Thread Alexandre González
Hi! I'm using this plugin: http://code.google.com/p/django-countries/ that gives me a model Country. I use it to a ManyToMany relation class A(models.Model): b = models.ManyToMany(Country) I must save a A object with servarl countries object on it... how can I do it? I had same problem but

Re: customize url for GET form

2010-09-03 Thread Alexandre González
, Tom Evans <tevans...@googlemail.com> wrote: > 2010/9/3 Alexandre González <agonzale...@gmail.com>: > > I think that if you use id=1=2=3 you are overriding the id value... > > It's no way to do that with GET > > > > Au contraire: > > >>> from

Re: customize url for GET form

2010-09-03 Thread Alexandre González
I think that if you use id=1=2=3 you are overriding the id value... It's no way to do that with GET On Fri, Sep 3, 2010 at 15:20, jean polo wrote: > hello > while using GET form, I can select several objects with an URL like: > xx?id=1=2=3 etc.. > > How could I

Re: Chat application in Django

2010-08-31 Thread Alexandre González
I've seen this project: http://code.google.com/p/django-chat/ but I don't test it... perhaps the code can helps you. What about use a free protocol as XMPP (jabber) and write a "client" for django? On Tue, Aug 31, 2010 at 14:08, Jeff Bell wrote: > Pretty sure fb

Re: urlencode in Django

2010-08-30 Thread Alexandre González
character "ñ" isn't a > problem, and for this reason is not converted. > > Thanks for read. > > On 30 ago, 17:13, Alexandre González <agonzale...@gmail.com> wrote: > > With django you can define you url in urls.py as: > > > > url(r'^sample$', sample,

Re: urlencode in Django

2010-08-30 Thread Alexandre González
aa='.urlencode($aaa).'>link'; > -- > because $aaa can have some special characters. > > I thought that the urlencode filter do this in django. I must to build > an url in the template with parameters for a filtered pagination. > > On 30 ago, 16:44, Alexandre González <agonzale...@gma

Re: urlencode in Django

2010-08-30 Thread Alexandre González
Why do you like to do it? I think that your problem is with codification, and not with urlenconde... try to search about utf8 and html On Mon, Aug 30, 2010 at 22:09, refreegrata wrote: > i'm sorry in my last time accidentally send the post before of > finish. > I try to

Re: urlencode in Django

2010-08-30 Thread Alexandre González
example from one of my codes... import urllib parameters = ({'langpair': '%s|%s' % (self.detected_language, 'en'), 'v': '1.0', 'q': self.words_list.encode('utf-8') }) urllib.urlencode(parameters) but what do you need this? Becasue you can find a

Bidirectional syncdb and fixtures save

2010-08-30 Thread Alexandre González
Hi! I'm developing a little project, so I'm using sqlite at the moment only to test... when I change something on my model most times I must delete my db.sqlite and create it again with syncdb to the changes made effect... Is it any module or another way to automagically create the fields (or

Re: App for Registration/Authorization which is Email & Password based (not username)

2010-08-28 Thread Alexandre González
exandre, I also found this one: > http://github.com/redvasily/django-emailauth > > Given I'm a newbie, which path do you recommend I pursue? > > On Aug 27, 11:33 am, Alexandre González <agonzale...@gmail.com> wrote: > > I've using django-registration to do that...

Re: App for Registration/Authorization which is Email & Password based (not username)

2010-08-27 Thread Alexandre González
I've using django-registration to do that... class RegistrationFormTOSAndUniqueEmail(RegistrationFormTermsOfService, RegistrationFormUniqueEmail): def __init__(self, *args, **kwargs): super(RegistrationFormTOSAndUniqueEmail, self).__init__(*args, **kwargs) def clean_email(self):

Refer to an object directly from code or API/curl

2010-08-27 Thread Alexandre González
Hi! I have 2 models in my program, and I like to refer to one of them withou getting the object "manually". As I have writted them, I can do curl -F languages="es, en, it" and then the get_languages method split by comma and get the objects, but... can I directly send from the API the correct

Re: first time app - admin site importerror

2010-08-23 Thread Alexandre González
I think that you must write models, not model On Mon, Aug 23, 2010 at 11:50, maclin kallat wrote: > Try and check if all the imports in your models.py file are OK. > > -- > *From:* burnsr77 > *To:* Django users

Re: VersionConflict with pip but django updated

2010-08-18 Thread Alexandre González
I solved it with: sudo aptitude install python2.6-dev libxml2-dev libxslt-dev sudo pip install *--upgrade* django-easymode Thanks anyway! 2010/8/17 Alexandre González <agonzale...@gmail.com> > Hi! > > I'm trying to install django-easymode, I get a version conflict, so I > rem

VersionConflict with pip but django updated

2010-08-17 Thread Alexandre González
Hi! I'm trying to install django-easymode, I get a version conflict, so I remove my django from /usr/local/lib/python2.6/dist-packages as [1] says. And after it reinstall my django from sources with python setup.py install. When I run python -c "import django; print django.VERSION" I get the

Translate data from Database

2010-08-17 Thread Alexandre González
Hi! I need a model to complete a combo in my app. The models have only code and name, but I need to translate this name. I think about do something similar to this: class ComboFill(models.Model): code = models.CharField... language = models.CharField... name = models.CharField...

Re: Interpolation and comparation between 2 dates: easy and difficult at the same time

2010-08-06 Thread Alexandre González
= min(case1, case2) > return (diff / mydiff) > > def diff_in_seconds(d1,d2): > timedelta = d2 - d1 > return float(timedelta) > > print match(0,100,40,90) > > > 2010/8/5 Alexandre González <agonzale...@gmail.com> > >> I've develope a "sim

Interpolation and comparation between 2 dates: easy and difficult at the same time

2010-08-05 Thread Alexandre González
I've develope a "simple" function to calculate the difference between 2 dates, and the time that they are interpolated. I need it to: I arrive to a site at a hour (my_from), I go out from the site at a hour (my_to). Some friend arrive at the site at a hour (his_from) and let it at a hour (his_to)

Re: no such table: django_session when doing the tutorial

2010-08-05 Thread Alexandre González
ug 4, 2010 at 8:39 PM, Yoji H <mera...@gmail.com> wrote: > >> i did as i wrote above. >> >> 2010/8/4 Alexandre González <agonzale...@gmail.com> >> >> Have you run the script manage.py with syncdb option? >>> >>> python manage.py syncdb

Re: no such table: django_session when doing the tutorial

2010-08-04 Thread Alexandre González
Have you run the script manage.py with syncdb option? python manage.py syncdb On Wed, Aug 4, 2010 at 12:44, merabi wrote: > Hi. > im using python 2.6, django 1.1, eclipse3.4, and pydev 1.6, macbook > pro mac os 10.6.4. > trying to do the tutorial: >

Re: Django, Rails but a cost to pay ?

2010-08-03 Thread Alexandre González
Excuse if my answer was hard. I didn't know that you were the author, but I think that compare the Open Source community with things as Apple consumers is a stupid point of view IMHO. Some of the points are correct, but not all, I agree with James Benett arguments. Your post is an opinion, and

Re: Django, Rails but a cost to pay ?

2010-08-03 Thread Alexandre González
I think that this argument is stupid: "Be part of a small and smart community. Finally, we think to be special ;) “Think different” then I have an iPhone, MacBook Air… " Ok, be part of a community is the best, but compare the FLOSS community with the "Think different"... On Tue, Aug 3, 2010 at

Show mail instead user name in ForeignKey at admin

2010-07-30 Thread Alexandre González
Hi! When I'm using user as ForeignField in some of my models I get a box with the username, can I override this with the mail instead the username? I've tested making a Proxy class, but I think that the proxy classes isn't for this. I heard about MonkeyPatch but I don't know how to use it, or

Re: LANGUAGES var isn't in all views

2010-07-30 Thread Alexandre González
If I add: import settings LANGUAGES=settings.LANGUAGES and return it in the render_to_response it works perfectly, but can I automatice this in all views? On Fri, Jul 30, 2010 at 10:55, Baurzhan Ismagulov <i...@radix50.net> wrote: > On Thu, Jul 29, 2010 at 11:52:31PM +0200, Alexandre

Best way to find near people

2010-07-29 Thread Alexandre González
Hi! I'm searching near people in my app. I'm doing it a this way: 37 people = Person.objects.all().exclude(user=request.user) 38 39 near_people = list() 40 for person in people: 41 if self.is_near(me.coordinates, person.coordinates):

LANGUAGES var isn't in all views

2010-07-29 Thread Alexandre González
Hi! I have this templates: 39 40 41 42 {% for lang in LANGUAGES %} 43 {{ lang.1 }} 44 {% endfor %} 45 46 47 That show my languages in the webpage. I made it with tutorial:

Re: error loading sqlite3 module

2010-07-29 Thread Alexandre González
You need to install the python sqlite libraries. On Thu, Jul 29, 2010 at 15:27, jose antunes wrote: > Can anyone please help figuring out why I get the following error: > django.core.exceptions.ImproperlyConfigured: Error loading sqlite3 module: > No module named _sqlite3

Re: Calculate distance between 2 latitude/longitude Point

2010-07-29 Thread Alexandre González
, -5.661885738372803) destiny = (40.96116097790996, -5.66283792257309) print distance(origin, destiny) 2010/7/29 Alexandre González <agonzale...@gmail.com> > I going to try it now, but the unique results that I obtain in google > searching [1] gd2gcc is this thread :) > > [1] > http://

Re: Calculate distance between 2 latitude/longitude Point

2010-07-29 Thread Alexandre González
> > dis = sqrt(sum(pow(p1_gcc-p2-gcc, 2))) > > cheers, > > 2010/7/28 Alexandre González <agonzale...@gmail.com>: > > Hi! I'm using the Django GEOS API [1] in my project to see the distance > > between two users. > > I get the coordinates from google maps in lat

Re: Calculate distance between 2 latitude/longitude Point

2010-07-28 Thread Alexandre González
here, and typically in radians. > > Bill > > 2010/7/28 Alexandre González <agonzale...@gmail.com>: > > Hi! I'm using the Django GEOS API [1] in my project to see the distance > > between two users. > > I get the coordinates from google maps in latitude/longitu

Calculate distance between 2 latitude/longitude Point

2010-07-28 Thread Alexandre González
Hi! I'm using the Django GEOS API [1] in my project to see the distance between two users. I get the coordinates from google maps in latitude/longitude mode and I need to calculate the distance between them. I'm testing with .distance() method at GEOSGeometry but I receive a strange value. This

Re: intcomma ini django admin

2010-07-24 Thread Alexandre González
Try with this: http://docs.djangoproject.com/en/dev/ref/contrib/humanize/ On Sat, Jul 24, 2010 at 06:54, Ronald wrote: > Hi there, > > Im a new django guy here so apology if i am asking a stupid question. > > Can you comma separate an integer field in the admin

Re: finding current url

2010-07-22 Thread Alexandre González
Take a look to django.contrib.sites http://djangobook.com/en/2.0/chapter16/ You can use: site.objects.get_current() I hope that this helps you. On Thu, Jul 22, 2010 at 22:58, Tony wrote: > Hi, > So I have many domains pointing to

Re: problem models.py code

2010-07-14 Thread Alexandre González
Are you talking about this: http://www.djangoproject.com/documentation/models/custom_pk/ ?? You must declar jono as: jono = models.PositiveIntergerField(primary_key=True) On Wed, Jul 14, 2010 at 19:38, Jagdeep Singh Malhi wrote: > I try this code to create database in

Re: problem models.py code

2010-07-14 Thread Alexandre González
Are you talking about this: http://www.djangoproject.com/documentation/models/custom_pk/ ?? You must declar jono as: jono = models.PositiveIntergerField(primary_key=True) On Wed, Jul 14, 2010 at 19:38, Jagdeep Singh Malhi wrote: > I try this code to create database in

Re: Saving File/Image in tmp. I'm in trouble ...

2010-07-13 Thread Alexandre González
I think that if python can save in /tmp you can remove it... Can you test in a simple python script if you can remove a file owned by you in /tmp? On Tue, Jul 13, 2010 at 13:06, The Danny Bos wrote: > I can't get access to the servers own tmp path, only my own "/home/ >

Re: must be μ

2010-07-13 Thread Alexandre González
Alessandro, days ago I have the same problem, with |safe the chars aren't scaped, so I started to use mark_safe() from the view, try it, and let us know if it works. 2010/7/13 Alessandro Ronchi > > > 2010/7/12 Martin Melin > > 2010/7/12 Alessandro

Re: Saving File/Image in tmp. I'm in trouble ...

2010-07-13 Thread Alexandre González
Can't you erase the /tmp file after use it? os.remove(path) On Tue, Jul 13, 2010 at 12:11, The Danny Bos wrote: > > Forgot to mention, my files are all under 20k. > Very small JPGs. > > Cheers, > > Danny > > -- > You received this message because you are subscribed to the

Go to the admin change password page instead my template since django-registration update

2010-07-12 Thread Alexandre González
Hi! Since I update my django-registration installation to be able to use signals, I lost my templates to change password, reset password... There is now the default django admin templates to do that. How can I use again my templates? Do you need some paste or more info? This is my urls.py, it

Re: must be μ

2010-07-12 Thread Alexandre González
Try mark_safe. from django.utils.safestring import mark_safe mark_safe('μ') 2010/7/12 Alessandro Ronchi > I want django to return μ instead of the html enscaped form in my > views, because I need it to return a reportlab template wich doesn't handle > the

Re: Please unsubscribe this email

2010-07-12 Thread Alexandre González
;? Have you tried to read the signature? On Mon, Jul 12, 2010 at 13:34, David Ally wrote: > Please unsubscribe this email. > > > David > > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group,

Re: default is_active to true on new users

2010-07-09 Thread Alexandre González
;Test.") 2010/7/9 Alexandre González <a...@mirblu.com> > Hi! > > Perhaps you can do it easily with signals instead override the save method, > take a look to this: > http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html > > > <http://ww

Re: default is_active to true on new users

2010-07-09 Thread Alexandre González
Hi! Perhaps you can do it easily with signals instead override the save method, take a look to this: http://www.ibm.com/developerworks/opensource/library/os-django-admin/index.html Good luck and ask again if they

Re: How can I access attributes in intermediate class

2010-06-29 Thread Alexandre González
I was intrigued so I did it, I get this solution: from models import User, Group, Membership def example(request): example_group_id = 1 #I create only one group to test, this is his id group = Group.objects.get(pk=example_group_id) for user in group.members.iterator(): #Get all user

Re: Autologin after activation in django-registration

2010-06-28 Thread Alexandre González
; signals. You need to grab the latest unreleased code from bitbucket: > > http://bitbucket.org/ubernostrum/django-registration/ > > On Jun 27, 10:34 pm, Alexandre González <agonzale...@gmail.com> wrote: > > Hi! > > > > I like to autologin the user after

Autologin after activation in django-registration

2010-06-27 Thread Alexandre González
Hi! I like to autologin the user after they activate their account with the mail-link. I saw this snippet: http://djangosnippets.org/snippets/1960/ but I can't do it work. I saw the django-registration code and I don't see any emmited signals. I was reading the django registration documentation

Search near people with geoposition or charfield

2010-06-22 Thread Alexandre González
Hi! I like to user something as django-people have to search people near to me. I have a charfield in my model that could be a address as "Salamanca, Spain" or a GPS position sended by the mobile app. Where can I start to read about that? And please, don't say me that read the django-people code

Control blank=False when creating/updating with code

2010-06-19 Thread Alexandre González
Hi! I have some models with mix attribs: blank=False or blank=True, when I try to create/update object form admin interface, the restrictions works without problem, but I'm doing it from django-piston (API) so I need to do it by code with this. I do that with this code: object =

Generate QR Code in a view

2010-06-15 Thread Alexandre González
Hi! What's the best way to generate a QR code in a view? I saw a snippet to generate it in a template, but I don't know if it's the best way. I need to generate on-fly codes from database info... This is the snippet: http://djangosnippets.org/snippets/1494/ perhaps, I can send data to the

Re: syncdb always indicates there are no fixtures

2010-06-11 Thread Alexandre González
ntry(iso_code='IT', name='Italy')) > countries.append(Country(iso_code='SP', name='Spain')) > countries.append(Country(iso_code='CR', name='Croatia')) > countries.append(Country(iso_code='HU', name='Hungary')) > for ctry in countries: > ctry.save() > > [/code] > > > >

Re: syncdb always indicates there are no fixtures

2010-06-11 Thread Alexandre González
¿Are you setting the variable FIXTURES_DIR in settings.py? On Fri, Jun 11, 2010 at 12:03, Kenneth Gonsalves wrote: > On Friday 11 June 2010 14:20:59 tsmets wrote: > > But I have json's files in multiple "fixtures" directories. > > [code] > >

piston and related models

2010-05-28 Thread Alexandre González
Hi! I don't know how to make django-piston save my related objects. This is my handler file: from piston.handler import BaseHandler, AnonymousBaseHandler from piston.utils import rc, require_mime, require_extended from test.networking.models import NetworkingProfile class

Re: API with django

2010-05-24 Thread Alexandre González
Thanks for your 2c :D It works for me now with curl, I've read about serialization and test again with a ajax request thanks! On Mon, May 24, 2010 at 17:45, Ovnicraft <ovnicr...@gmail.com> wrote: > > > El 23 de mayo de 2010 22:05, Alexandre González <a...@mirblu.com>escr

Re: API with django

2010-05-24 Thread Alexandre González
stHeader('Authorization', 'Base ' + key);* *},* *success: function(json, textStatus) { document.getElementById("body").innerHTML = json.title },* * error: function() { document.getElementById("body").innerHTML = "error" }* *};* *

Re: API with django

2010-05-24 Thread Alexandre González
la <simoda...@gmail.com> wrote: > > > 2010/5/24 Alexandre González <a...@mirblu.com> > >> Hi! >> >> I must develop a django app that receives XML and returns XML. >> >> What's the best way to do this? Create a view that receive the XML and >>

API with django

2010-05-23 Thread Alexandre González
Hi! I must develop a django app that receives XML and returns XML. What's the best way to do this? Create a view that receive the XML and parse it to return a template with the XML resultant? I'm newbie in django and need your tips :) Regards, Álex González -- Please, don't send me files

Re: Extend User

2010-05-18 Thread Alexandre González
ollapse']}), ] inlines = [UserProfileAdmin] admin.site.unregister(User) admin.site.register(User, UserAdmin) 2010/5/18 Alexandre González <a...@mirblu.com> > Perfect, thanks for your help! > > > On Tue, May 18, 2010 at 14:03, zinckiwi <zinck...@gmail.com> wrote: > &

Re: Extend User

2010-05-18 Thread Alexandre González
Perfect, thanks for your help! On Tue, May 18, 2010 at 14:03, zinckiwi <zinck...@gmail.com> wrote: > On May 18, 7:57 am, Alexandre González <a...@mirblu.com> wrote: > > But don't you think that have attributes that I don't need is a > perfomance > > lost? I

Re: Extend User

2010-05-18 Thread Alexandre González
ile model and set the model in AUTH_PROFILE_MODULE. That will > allow you to get the information from the user via the get_profile() > method. > > See: http://docs.djangoproject.com/en/dev/topics/auth/#auth-profiles > > 2010/5/18 Alexandre González <a...@mirblu.com>: &g

Extend User

2010-05-18 Thread Alexandre González
Hi everybody! I need a User model with normal attributes inherit from models.User, but I need some differences: - I dont' need name, surname and another attributes - I need that email are unique between different Users Can I inherit and use most of models.User? Or I need to create a new

Re: coltrane sample at "practical django projects" book has a templates error

2010-04-22 Thread Alexandre González
I was searching for the error in google and I solve it, I don't know if I solve it at good way, but... It works :p from django.conf.urls.defaults import * from coltrane.models import Category urlpatterns = patterns('', (r'^$', 'django.views.generic.list_detail.object_list', { 'queryset':