Re: How to model postal address in django ???

2012-04-01 Thread Mario Gudelj
You can use django-countries for county names and codes - http://code.google.com/p/django-countries/ or https://bitbucket.org/smileychris/django-countries There are probably more apps out there. For geo-coding you can try http://geodjango.org/. It's awesome but it may be a bit hard to implement.

Re: getting POST 500 (OK), when using $.ajax on that url

2012-04-01 Thread Daniel Roseman
On Saturday, 31 March 2012 23:23:26 UTC+1, Ahmad wrote: > > I trying to use jquery ajax to send json data to django > > sorry if providing javascript code but it may help solving my problem > > $("#send").click(function() { > events = $('#calendar').fullCalendar('clientEvents')

Re: Filtering results before & after update?

2012-04-01 Thread akaariai
On Apr 1, 4:24 am, symmitchry wrote: > I have a straightforward form that simply reduces an item count by 1, for a > selected product. (The form essentially "ships" a product, so need to > decrease remaining term_length by 1). > > I have the following code: > >             cd = form.cleaned_data

Setup A Django VM with Vagrant, VirtualBox, and Chef

2012-04-01 Thread michaeljsmalley
I just wanted to let everyone here know that I've written an article about getting a Django development environment configured with Vagrant, Chef, and VirtualBox. It's been pretty popular among friends, and I thought it's time to share. I genuinely hope some of you find it useful. http://blog.sma

sorting a list of objects when objects is returning two fields

2012-04-01 Thread Nikhil Verma
Hi All I have a model structure like this :- class Visit(Model): patient = models.ForeignKey(Patient) ... and so on topics = models.ManyToManyField(Topic, limit_choices_to={'reporting':False}) research_protocol

plugins django-apps in sidebar with eval()

2012-04-01 Thread kase
i want made a plugin sistem for one CMS my idea is: #plugin def plugin (): do somting return render_to_string('plugin.html',{}) and one database whit plugins method name "Plugin_sidebar" #view def home(request): ps = Plugin_sidebar.objects.all() return render_to_response('ho

Preprocess data before showing it on Admin

2012-04-01 Thread Pedro Vasconcelos
Hello! Anyone knows how preprocess data before showing it on Admin (change page)? __ __ ___ / \/ \/ \ | DB | -> | PREPROCESSOR | -> | ADMIN | \__/\__/\___/ I want to edit data (in Admin) in a human-frie

Re: Preprocess data before showing it on Admin

2012-04-01 Thread Marc Aymerich
On Sun, Apr 1, 2012 at 9:25 PM, Pedro Vasconcelos wrote: > Hello! > > Anyone knows how preprocess data before showing it on Admin (change page)? > >  __      __      ___ > /      \    /              \    /       \ > |  DB  | -> | PREPROCESSOR | -> | ADMIN | > \__/    \_

Re: Preprocess data before showing it on Admin

2012-04-01 Thread Pedro Vasconcelos
Hello Marc! Thanks for replying. Unfortunately I cant realised how to get the current value, change it and populate the form using a ModelForm. I've tried it actually. I appreciate if you send me tips on that direction! Thanks a lot! On Sun, Apr 1, 2012 at 4:36 PM, Marc Aymerich wrote: > On S

Looking for Django IDE

2012-04-01 Thread Mark Phillips
What IDE do you use/recommend for developing django web sites? Or, if not an IDE, what editor/setup is most useful? I am developing on Linux version 3.1.0-1-amd64 (Debian 3.1.8-2). I would rather use something open source. I use eclipse for developing android/java projects. Since I am using django

Re: Preprocess data before showing it on Admin

2012-04-01 Thread Marc Aymerich
On Sun, Apr 1, 2012 at 9:42 PM, Pedro Vasconcelos wrote: > Hello Marc! > > Thanks for replying. Unfortunately I cant realised how to get the current > value, change it and populate the form using a ModelForm. I've tried it > actually. > sure, you can do it on form __init__ method something like

Re: Looking for Django IDE

2012-04-01 Thread Alexandros Karypidis
Hi, I'm using PyDev in Eclipse and it seems quite nice: http://pydev.org/ Have a look at the Django-specific stuff: http://pydev.org/manual_adv_django.html Please note that you must use a nightly build for Django 1.4 due to this: http://sourceforge.net/projects/pydev/forums/forum/293649/topic

Re: Looking for Django IDE

2012-04-01 Thread Alexandros Karypidis
Oh, regarding your problem of the 'annoying switching of perspectives': 1) Start eclipse 2) Open your java project, switch to the Java perspective 3) From the menu: Window->New Window 4) In the new window, open your django project and switch to the PyDev perspective 5) Alt-tab between the two Ec

Re: Looking for Django IDE

2012-04-01 Thread Masklinn
On 2012-04-01, at 20:30 , Mark Phillips wrote: > What IDE do you use/recommend for developing django web sites? Or, if not > an IDE, what editor/setup is most useful? I am developing on Linux version > 3.1.0-1-amd64 (Debian 3.1.8-2). I would rather use something open source. I > use eclipse for de

Re: Looking for Django IDE

2012-04-01 Thread Alexandr Aibulatov
Try to use vim with plugins for django. 02.04.2012 1:48 пользователь "Mark Phillips" написал: > What IDE do you use/recommend for developing django web sites? Or, if not > an IDE, what editor/setup is most useful? I am developing on Linux version > 3.1.0-1-amd64 (Debian 3.1.8-2). I would rather u

Re: Looking for Django IDE

2012-04-01 Thread yati sagade
Aptana Studio 3 is basically Eclipse beefed up with PyDev and other useful plugins, targeted towards web devel. I use it regularly, and besides the cool colour schemes, the thing is pretty stable (I was really tired of scouring the web just to get my Eclipse builds running prop

URL encoding, templates and apps: are apps not portlets?

2012-04-01 Thread Alexandros Karypidis
Hi, My fondness of Python (while scripting things for work) grew to the point where I decided to try web development with it. Having (apparently) nothing better to do on a Sunday afternoon, I went through the Django tutorials. The tutorial goes to some length to keep the "polls" app self-con

Re: Preprocess data before showing it on Admin

2012-04-01 Thread Pedro Vasconcelos
Thanks for your time and your tips Marc! I had tried earlie what you suggested but it didnt solved my problem because it only assigns initial values to new records and not to existents ones. But i finally figured out a small change on code which does it well. I just replaced "self.fields['your_fi

Re: URL encoding, templates and apps: are apps not portlets?

2012-04-01 Thread Alexandros Karypidis
So, having discovered how to extend the context of a generic view, I've now managed to make things a bit more self-contained: 1) In polls.urls add a name for the index page (just like for the 'poll_results' case) -- urlpatterns = patterns('', # ... name='poll_index'), 2) In

Re: Questions about UnicodeDecodeError

2012-04-01 Thread Bill Freeman
If you can, switch to UTF-8 in the db. Web traffic can arrive in a variety of encodings, and while the headers tell the server how to make unicode out of it, but by having the db set for ASCII, you limit what you can store (since not all unicode characters can be converted to ASCII. On Fri, Mar 3

Re: Looking for Django IDE

2012-04-01 Thread kase
komodo edit http://www.activestate.com/komodo-edit El domingo 1 de abril de 2012 13:30:03 UTC-5, mark escribió: > > What IDE do you use/recommend for developing django web sites? Or, if not > an IDE, what editor/setup is most useful? I am developing on Linux version > 3.1.0-1-amd64 (Debian

Re: Looking for Django IDE

2012-04-01 Thread thongor
I use vim with a plugin called "python mode" which can be found here. It's a collection of several python plugins that gives you a lot of options. You can also check out various vimrc files on github for other ideas. On Sunday, April 1, 2012 2:30:03 PM UTC

Re: canceling account

2012-04-01 Thread Python_Junkie
It does not appear that anyone truly answered your question. The accounts are maintained in a database. Figure out which table and which columns the account that you want to remove are maintained. You can accomplish this by viewing a development server that you may have in house and spinning u

form.Forms + POST + forms.ChoiceField

2012-04-01 Thread Barry Morrison
Full Disclosure: I've been using Python for 5-6 months. Django for maybe 3 I have this: https://gist.github.com/a934fe08643e0c3ee017 In an effort to teach myself, I'm simply building a Django app. For teaching purposes only. It's an aggregator of favorites across multiple sites. Right now, I'm

Bulk Creating Django Models from CSV File?

2012-04-01 Thread Victor Hooi
Hi, I have several large CSV files that I'm hoping to parse, and use to create Django objects. Each line looks might look something like this: "Server Hostname", "Classification", "Country", "Operating System" "foo.bar.com", "Prod", "Australia", "Solaris" "alex.john.com", "Dev", "UK", "Linux"

RE: Looking for Django IDE

2012-04-01 Thread Sells, Fred
Is there a Django 1.4.1 in the works that would solve this problem? I also use Eclipse+PyDev and am planning to upgrade to Django 1.4 shortly. However my management is not going to allow using a nightly build in a production system regardless of the justification. I guess my options are to stick

Doubt regarding endless pagination

2012-04-01 Thread Swaroop Shankar V
Hi All, This question is regarding a django app called endless pagination. I want to add a '|' in between the pagination numbers so that it will look like <> I went through the documents but could not figure out how to do this. If anyone have already implemented something like this please tell me