Re: OnChange or OnBlur event in javascript to run python function in Django and return the results???

2012-12-12 Thread Mario Gudelj
Hey, First you need to add some id to that field and then use a jQuery selector to get the value from it on blur or input: $('#some_id).on("blur", function(){ //make your ajax call here }); To make the Ajax call you can use jQuery's .post() or .get(). I guess post method would make a bit

Re: Datastructure using django.

2012-12-12 Thread b1-
On Monday, December 10, 2012 8:15:41 PM UTC+2, Subhodip Biswas wrote: > > Hi all, > > I am trying to implement a tree structure using django. There are two > packages I am looking at mptt and treebeard. Treebeard seems easy. > > I have however two questions: > > 1. With mptt I found that if

Re: JSONResponseMixin: Best handle "context" before dumping it to JSON?

2012-12-12 Thread Micky Hulse
Hi Russ! Wow, thanks so much for the quick reply and additional details! :) On Wed, Dec 12, 2012 at 7:12 PM, Russell Keith-Magee wrote: > Can you use a try-catch to flag encoding problems? Sure - that's a > completely reasonable solution. > Is a blanket try-catch a bad

Re: JSONResponseMixin: Best handle "context" before dumping it to JSON?

2012-12-12 Thread Russell Keith-Magee
On Thu, Dec 13, 2012 at 11:03 AM, Micky Hulse wrote: > Hello Russ! Thank you so much for your pro help and informative reply. > I really appreciate it. :) > > No worries at all. Glad I could be of assistance. > I've been wondering if I could just add a simple try/catch, like

OnChange or OnBlur event in javascript to run python function in Django and return the results???

2012-12-12 Thread Murtaza
Hello All, I have developed an internal tool with Django and Python in the backend, now it seems like I have hit a road block. I am very new to Javascript. And the site has to be very dynamic and it needs to be able to do something like the following: In the input box, 1. The user has

Re: Problem at activating the admin site (Django tutorial part 2)

2012-12-12 Thread mdr9572
Same for me as well with a FreeBSD system and normal username, LANGUAGE_CODE = 'en_us', database is postgresql with UTF-8 encoding. I went through the steps in tutorial_02 to set up the admin site, and got the same error as pasztilla. The django_site table in my database is empty. We are

Re: JSONResponseMixin: Best handle "context" before dumping it to JSON?

2012-12-12 Thread Micky Hulse
Hello Russ! Thank you so much for your pro help and informative reply. I really appreciate it. :) Sorry for my late reply... A few non-Django projects jumped in the way of me tending to my list e-mails. See my replies, inline, below: On Tue, Dec 11, 2012 at 3:51 PM, Russell Keith-Magee

Question on Multiple Database Connections

2012-12-12 Thread Matthew Woodward
I'm working on an application that uses two databases -- one is the main database that Django ORM talks to, where sessions are stored, etc. and the other is an external database where we need to run some storedprocs to retrieve some data. This is all working fine for the most part but I ran into

validation error in Django Admin

2012-12-12 Thread Mike Dewhirst
I'm getting an unexpected validation error in Admin which baffles me. Any hints appreciated ... here is the traceback http://dpaste.com/844972/ At the bottom of the traceback where the error is raised, the local vars are ... self value u'33' key 'pk' When I save the item, it

django-registration fork for 1.5?

2012-12-12 Thread mikegolf
Hi, is there any django-registration fork that works on Django 1.5? thanks, mg -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/kia2ThjwpSwJ. To post to

Re: select_for_update().get(...), what happens on DoesNotExist?

2012-12-12 Thread Chris Cogdon
The question is going to be very database specific. "select for update" works by putting in row-level locks in the database. If the row does not exist, then it won't get a lock on it, and I know of no databases that will maintain the query so that any newly created rows automatically get a lock

Re: ImageField in admin always required

2012-12-12 Thread Chris Cogdon
NOTE: I tried adding null=True, blank=True to forms.ImageField however I > get errors __init__() got an unexpected keyword argument so I guess I can't > use them options. If I comment out the def formfield_for_dbfield(self, > db_field, **kwargs): then the ImageField is not required as

Re: Project path

2012-12-12 Thread Chris Cogdon
Not sure if you're willing to consider an alternate, here, but this is a issue Iv'e gone through a lot, and came up with my own solution. The major issue is that I not only want to change the top level paths, but also need to change database targets and a few other settings, between all the

Re: Datastructure using django.

2012-12-12 Thread Chris Cogdon
I've no answers for you, but you might want to have a look at other applications that use those products and see how they work. I know that "zinnia", a Django-based blog framework, uses "mptt", so you might want to have a look there. I've used zinnia, and I've never had to do any "reload" so

Re: Model method versus overriding save()

2012-12-12 Thread Chris Cogdon
On Sunday, December 9, 2012 9:08:18 PM UTC-8, Mike Dewhirst wrote: > > On 10/12/2012 10:59am, Victor Hooi wrote: > > Also - in terms of using them with QuerySets - there aren't any > > workarounds to use model methods with QuerySets are there? It seems like > > that would be a definite argument

GeoDjango annotate distance

2012-12-12 Thread mikegolf
Hi, I've recently started learning GeoDjango and I'm a bit confused. There's a GeoQuerySet method "distance" which annotates each object with the distance to the given point, like that: pnt = 'POINT(coords... coords ...)' MyModel.objects.all().distance(pnt) but what field of the object does it

django-registration customization

2012-12-12 Thread sri
Hi, I am using django-registration (http://pypi.python.org/pypi/django-registration) app for my project and i have added an extra page which shows both login and registration forms together. But on this new page, the validation for registration form does not work. It works if i display the

select_for_update().get(...), what happens on DoesNotExist?

2012-12-12 Thread Carsten Fuchs
Dear Django group, we try to understand and solve a concurrency problem, and would kindly like to ask for your help. We use Django 1.4, and a model like this: class MonatsSalden(models.Model): id= models.AutoField(primary_key=True) key =

Re: Templates not found

2012-12-12 Thread donarb
When you used the shell, you imported 'tracks.views' but in your urls.py, you have musicsite.views.home. The two don't match. On Wednesday, December 12, 2012 6:11:54 AM UTC-8, Lloyd Dube wrote: > > urls.py: > > urlpatterns = patterns('', > # Examples: > url(r'^$', 'musicsite.views.home',

Re: Templates not found

2012-12-12 Thread Sergiy Khohlov
could you please repeat your not view error ? Look like urls,oy has no access to views.py Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/12 Sithembewena Lloyd Dube : > urls.py: > > urlpatterns = patterns('', > # Examples: > url(r'^$',

Re: Foreignkey Form

2012-12-12 Thread Sergiy Khohlov
https://docs.djangoproject.com/en/dev/ref/class-based-views/generic-display/#detailview Many thanks, Serge +380 636150445 skype: skhohlov 2012/12/12 Jonas Geiregat : > Thanks for the response Serge, > > So basically I was on the right path. > > But I don't see what the

Re: Unique Id issue

2012-12-12 Thread Jani Tiainen
12.12.2012 8:55, ephan kirjoitti: Hi all, Am in a bit of a fix which I put myself in,I have the following models: class Town(...): name = models.CharField(unique=true) province = models.foreignKey(Province) class Area(): name = models.CharField(unique=true,max_length=120)

Re: Implementing a monitoring system with django.

2012-12-12 Thread Ken Hill
I've been considering a very similar Django to help simplify some of my daily server system admin tasks (e.g. monitor and trend CPU uase, memory usage, disk space, etc.). I'd like to try CouchDB to store the data with a Django UI to make the app usable to non-technical users. On Monday,

Re: Foreignkey Form

2012-12-12 Thread Jonas Geiregat
Thanks for the response Serge, So basically I was on the right path. But I don't see what the DetailView has to do with this ? Don't you mean the CreateView ? Jonas. > 1) you should create a form for building > 2) you should create a form for inhabitant and set key to the correct > value

Re: Implementing a monitoring system with django.

2012-12-12 Thread Tom Evans
On Mon, Dec 10, 2012 at 7:41 PM, Marc Aymerich wrote: > Hi, > I'm considering to implement a simple monitorization system that > basically gathers some data from a set of nodes (<1000 nodes). The > gathered data should be stored in order to let users perform some > queries

Re: Foreignkey Form

2012-12-12 Thread Sergiy Khohlov
1) you should create a form for building 2) you should create a form for inhabitant and set key to the correct value before saving IMHO simple way is create a edit form for buiding which has buttons add/remove inhabitant . check DetailView in docs please thanks, Serge skype: skhohlov

Re: ImageField in admin always required

2012-12-12 Thread Detectedstealth
Update: Looks like it was an issue with the admin.py file custom code, I was following a code sample to display images inline which is causing the field to become required. Any suggestions on how to fix this? (See code below) class AdminImageFieldWithThumbWidget(forms.widgets.FileInput):

Foreignkey Form

2012-12-12 Thread Jonas Geiregat
Hello, Suppose I have a model with a foreign key. class Building(models.Model): pass class Inhabitant(models.Model): building = models.ForeignKey(Building) I would like to display a form where all fields from the Building model and Inhabitant model are visible (but only once) Should