Re: psycopg2 and "idle in transaction" messages

2009-12-11 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-12-10, o godz. 13:41, przez Alexander Dutton: > As of last Thursday we've been seeing ~100% CPU usage from Apache, > which > we believe was caused by Debian Bug #528529[0], whereby psycopg2 was > attempting to double free pointers, resulting in segfaults. This wa

Re: Django-admin edit-form & change-list doesn't show to_field column

2009-12-11 Thread Kostas M
> It seems like Django-admin doesn't take in account the 'to_field' > directive. > > (Django Version 1.1.0) I found out that this problem was already reported in Ticket #8648 (http://code.djangoproject.com/ticket/8648) with the title 'Admin ignores to_field on ForeignKey'. The proposed fix, isn't

Re: sitemap how to publish many to many field?

2009-12-11 Thread Michael
Alright, so I have taken it one step further. In the code below all the items appear in the sitemap (shops from category prepaid and shops from the category tv). Next step is to add the productgroup in the custom sitemap url (see location code). When I try to do this, only the first item of the slu

forms searh foreing key object

2009-12-11 Thread Manuel Ignacio
Hello I have a form with some required fields: date : required patient : (foreing key) descritpion: required The patient table can have at least 1000 records, i don't want to show on a select list, i want to implement another form where i can searh the patient, i want to know how to do this wit

Re: How can child objects inherit data from parents?

2009-12-11 Thread Eric Chamberlain
On Dec 9, 2009, at 9:41 AM, bruno desthuilliers wrote: > On 9 déc, 14:10, Eric Chamberlain wrote: >> Hello, >> >> We're not sure how can we represent the following data structure in the >> django model? >> >> Grandparent Object >> First Name - NULL >> Last Name - NULL >>

Re: Separate views for form display and handling

2009-12-11 Thread Aaron
On Dec 10, 6:04 pm, aa56280 wrote: > if form.is_valid(): >   # do something and redirect > else: >   render_to_response('foo.html', {'form' : form'}) Would that leave the URL as displayed in the browser the same as the one for the form handling view? -- You received this message because you are

Any way to serialize a pagination object in Django?

2009-12-11 Thread jul
hi, I'm using Django pagination with jQuery. I can serialize the objects list of the pagination object, but I'd like to serialize the whole object to get more data (page number, total number of pages...). How can I serialize the whole pagination object? Thanks ***javascript*** function getResta

Couldn't create tables.

2009-12-11 Thread rhce.san
I have created the django project with necessary apps and trying to link it to the db. ( oracle 11g) Further info : python 2.5 django : 1.1.1 I am trying to integrate my django application to ldap , was successfull .. but while logging in in got the following error. ORA-00942: table or view does

Re: Queryset filter on foreign key

2009-12-11 Thread Daniel Roseman
On Dec 11, 3:33 am, Mark Schuuring wrote: > Hey Daniel, > First of all thanks a lot for your response. You understood it right > that i just want to split up the columns by the blog id so the > defintion of blogs_one and blogs_two was really helpful, thanks. So in > the shell i found out the blogs

Re: One to many mixins?

2009-12-11 Thread Shai
Thanks for the reply, but that would force me to link each SubForm1 object with both a Form1 & Form2 object. I would like to link them with either Form1 or Form2 Shai On Dec 10, 5:22 pm, Superman wrote: > Can you not create another Field in SubForm 1 model? Like so: > > class SubForm1(models.Mod

Re: Separate views for form display and handling

2009-12-11 Thread Preston Holmes
On Dec 11, 5:20 am, Aaron wrote: > On Dec 10, 6:04 pm, aa56280 wrote: > > > if form.is_valid(): > >   # do something and redirect > > else: > >   render_to_response('foo.html', {'form' : form'}) > > Would that leave the URL as displayed in the browser the same as the > one for the form handling

Incorrect key file for temporary table

2009-12-11 Thread Stuart Marsh
Hi, When trying to view a Userprofile list view in the admin, I get the error: Caught an exception while rendering: (126, "Incorrect key file for table '/tmp/#sql_2f52_0.MYI'; try to repair it") This is a recent error, and I'm not sure what's causing it. The Userprofile model has a foreign key

Re: making RequestContext the default context_instance

2009-12-11 Thread james_stevenson
Off-hand the only solution I can think of would be to monkeypatch django's render_to_response method to include the RequestContext object. It's not a particularly pleasant option, but should work. The Django devs have refused requests to make RequestContext part of every template rendering functio

Re: Raise error based on both form and inline_formset

2009-12-11 Thread Preston Holmes
On Dec 10, 9:05 am, cerberos wrote: > I'm building a library system and have models Member, Loan and > LoanItem (relationships as you'd expect), and an inline formset to > enter a new loan (Loan and LoanItems). > > A member can borrow up to 6 books at a time, so my form contains 7 > individual f

speed of calculations - combining query improves speed?

2009-12-11 Thread mbdtsmh
Hi all - can someone put me out of my misery on this one please? I have a piece of code that uses the request.GET keys in the url to produce the following in my views.py objects = Issue.objects.all() objects = objects.filter (designset__project__RA__RA=request.GET.__getitem__('RA')).distinct() ob

No output in response or stdout

2009-12-11 Thread Michiel
Hi, I added a custom view to a ModelAdmin subclass of my app. And when something goes wrong in that view (import errors, undefined variables or methods, ... even syntax errors) I get no indication about it whatsoever. The nice debug template is not shown in the browser, not even the simple stack t

Re: Issue with Django form when submitted using jQuery form plugin

2009-12-11 Thread Preston Holmes
On Dec 10, 11:02 am, jul wrote: > hi, > > when submitting my form using jQuery form plugin, the request received > by the target view is different than that received when the form is > submitted in the standard way (with no javascript), and my Django > template does not render as expected. When

Re: many permission sets for same user

2009-12-11 Thread Preston Holmes
On Dec 10, 8:41 am, Adonis wrote: > Hi, > > I am trying to figure out the best way to do this. > I have built a django application where users are members in projects. > Thus, i need to assign users different permission sets that correspond > to different projects. The django core permission sys

Re: Django-admin edit-form & change-list doesn't show to_field column

2009-12-11 Thread Karen Tracey
On Fri, Dec 11, 2009 at 5:04 AM, Kostas M wrote: > > > It seems like Django-admin doesn't take in account the 'to_field' > > directive. > > > > (Django Version 1.1.0) > > I found out that this problem was already reported in Ticket #8648 > (http://code.djangoproject.com/ticket/8648) with the titl

Re: Upload Progress Bar

2009-12-11 Thread Nemo
mattimck, could you please tell how exactly you turned out nginx? I've exactly the same configuration as yours, and still js receives NULL each time. The progress bar doesn't work.. Many thanks. Highly appreciated. On Oct 16, 4:01 am, mattimck wrote: > Well, John at fariviewcomputing ended up

Re: Tricky Django tables setup

2009-12-11 Thread Preston Holmes
On Dec 10, 7:53 am, Superman wrote: > Thank you DR for your response. > > Yes that helps in a way, as that is what I am planning to do. But at > the moment I can store the name of Projects, Categories and Specs in > the three different models. Where can I store the values for the Specs > for eac

Re: Upload Progress Bar

2009-12-11 Thread Nemo
patrickk, is "django-filebrowser" works with firefox on linux? or any other linux-based browsers? (I mean progress-bar) It turns out that flash-based progress bars (like SWFupload also) have a trouble with the progress upload. The flash does the update only once, see http://demo.swfupload.org/Docu

How to avoid listing all objects initially until searching

2009-12-11 Thread Jean Stebens
Hi there, I have a rather large set of objects in my database, around 200k, using the django admin interface and listing them is always terrible slow as it always fetches all entries (paginated). I usually just run a few searches or add some filters on the list. Is there a way to have the list not

Re: One to many mixins?

2009-12-11 Thread Preston Holmes
On Dec 10, 5:53 am, Shai wrote: > Hi all, > > I'm not sure my title is correct. Here Is my problem: I want to use > the django admin for data entry into some models. The models are based > on actual paper forms. There are several forms. and they share some > fields. I would like to follow the pr

Re: How to choose one row of data

2009-12-11 Thread Andy
Thanks for the response Shawn. I have done what you suggested, assigning a variable named order_info and can use it if I use render_to_response in my order view. But I want to use HttpResponseRedirect after the form is saved. I'm thinking I need to get the order_info variable into my order_compl

Re: speed of calculations - combining query improves speed?

2009-12-11 Thread Daniel Roseman
On Dec 11, 2:22 pm, mbdtsmh wrote: > Hi all - can someone put me out of my misery on this one please? > > I have a piece of code that uses the request.GET keys in the url to > produce the following in my views.py > > objects = Issue.objects.all() > objects = objects.filter > (designset__project__R

Javascript and the 'url' tag?

2009-12-11 Thread Stodge
I'm writing some javascript for my django app and I need to use 'url' to lookup an... url! But I can't see how to do it for urls that require parameters. It works for urls without parameters, otherwise I get syntax errors. Any pointers? I'm searching the groups and Google but nothing jumps out so a

Re: How to choose one row of data

2009-12-11 Thread Daniel Roseman
On Dec 11, 3:13 pm, Andy wrote: > Thanks for the response Shawn.  I have done what you suggested, > assigning a variable named order_info and can use it if I use > render_to_response in my order view.  But I want to use > HttpResponseRedirect after the form is saved.  I'm thinking I need to > get

Re: How to choose one row of data

2009-12-11 Thread Tom Evans
On Fri, Dec 11, 2009 at 3:13 PM, Andy wrote: > Thanks for the response Shawn.  I have done what you suggested, > assigning a variable named order_info and can use it if I use > render_to_response in my order view.  But I want to use > HttpResponseRedirect after the form is saved.  I'm thinking I n

Re: Javascript and the 'url' tag?

2009-12-11 Thread Tom Evans
On Fri, Dec 11, 2009 at 3:25 PM, Stodge wrote: > I'm writing some javascript for my django app and I need to use 'url' > to lookup an... url! But I can't see how to do it for urls that > require parameters. It works for urls without parameters, otherwise I > get syntax errors. Any pointers? I'm se

Re: Should empty formsets call their own clean method?

2009-12-11 Thread Tom Evans
On Tue, Dec 1, 2009 at 5:02 PM, Tom Evans wrote: > On Tue, Dec 1, 2009 at 4:14 PM, Tom Evans wrote: >> Hi all >> >> We encountered a strange issue today. When a user submits a formset >> that is empty, we call is_valid() on the formset, expecting the >> clean() method to be called. We then subseq

Re: Javascript and the 'url' tag?

2009-12-11 Thread Stodge
Thanks. Bear with me - I'm new to javascript. I have this, rather this is what I want to do: function view_document() { id = get_document_id(); if (id != -1) { url = "/document/view/" + id + "/"; window.open(ur

Re: Javascript and the 'url' tag?

2009-12-11 Thread Tom Evans
On Fri, Dec 11, 2009 at 3:37 PM, Stodge wrote: > Thanks. Bear with me - I'm new to javascript. I have this, rather this > is what I want to do: > >        function view_document() { >                id = get_document_id(); >                if (id != -1) { >                        url = "/document/

Re: How to avoid listing all objects initially until searching

2009-12-11 Thread Daniel Roseman
On Dec 11, 2:51 pm, Jean Stebens wrote: > Hi there, > > I have a rather large set of objects in my database, around 200k, using > the django admin interface and listing them is always terrible slow as > it always fetches all entries (paginated). I usually just run a few > searches or add some filt

Re: How to avoid listing all objects initially until searching

2009-12-11 Thread Jean Stebens
Daniel Roseman wrote: > On Dec 11, 2:51 pm, Jean Stebens wrote: >> Hi there, >> >> I have a rather large set of objects in my database, around 200k, using >> the django admin interface and listing them is always terrible slow as >> it always fetches all entries (paginated). I usually just run a fe

Re: How to avoid listing all objects initially until searching

2009-12-11 Thread Javier Guerra
On Fri, Dec 11, 2009 at 11:04 AM, Jean Stebens wrote: > my best guess is the initial > "show all" queryset set off by the framework. the paginator turns that queryset into a "query[0:20]", (or something like this). my guess is that this list might be sorted by a non-indexed field. -- Javier -

Re: How to avoid listing all objects initially until searching

2009-12-11 Thread Tom Evans
On Fri, Dec 11, 2009 at 4:04 PM, Jean Stebens wrote: > Daniel Roseman wrote: >> On Dec 11, 2:51 pm, Jean Stebens wrote: >>> Hi there, >>> >>> I have a rather large set of objects in my database, around 200k, using >>> the django admin interface and listing them is always terrible slow as >>> it a

Re: How to avoid listing all objects initially until searching

2009-12-11 Thread Jean Stebens
Tom Evans wrote: > On Fri, Dec 11, 2009 at 4:04 PM, Jean Stebens wrote: >> Daniel Roseman wrote: >>> On Dec 11, 2:51 pm, Jean Stebens wrote: Hi there, I have a rather large set of objects in my database, around 200k, using the django admin interface and listing them is always

How to execute linux command in django view

2009-12-11 Thread Kashif Azeem
Hello, Can anyone guide me please how to execute Linux command (e.g fdisk) in django view?. I have tried os.system() and commands module of python but the browser goes to busy/loading state and never finishes loading the page for quite a while. How to handle this please? -- Kashif -- You recei

Re: How to choose one row of data

2009-12-11 Thread Andy
Thank you DR. For other newbies out there I changed my views to this and it worked great: articles = Context({'articles': Articles.objects.all()}) def order(request): if request.method == 'POST': form = OrderForm(request.POST) if form.is_valid():

Re: How to avoid listing all objects initially until searching

2009-12-11 Thread Tom Evans
On Fri, Dec 11, 2009 at 4:23 PM, Jean Stebens wrote: > The default ordering for the object is set on it's id, which is defined > as primary key for the object. The complete database is optimized in > terms of indexes as this is a live monitoring system with more than 40k > servers. > > Any idea ho

Re: How to choose one row of data

2009-12-11 Thread Tom Evans
On Fri, Dec 11, 2009 at 4:44 PM, Andy wrote: > Thank you DR.  For other newbies out there I changed my views to this > and it worked great: > > articles = Context({'articles': Articles.objects.all()}) > > def order(request): >        if request.method == 'POST': >                form = OrderForm(r

Re: How to execute linux command in django view

2009-12-11 Thread Shawn Milochik
The proper way to do that is to use the subprocess module. http://docs.python.org/library/subprocess.html If you don't want to do much reading, you'll just want to look at section 18.1.3.1, which gives the way to call a simple shell command the way you'd do with backticks in Perl. However, sin

Can I change the models.py of an existing django app?

2009-12-11 Thread Zeynel
I just want to add 2 new fields to the model. If I upload the new models.py would the app work as before? I asked the same question in OS that includes the models. Thanks for the help. http://stackoverflow.com/questions/1889622/how-to-replace-models-py-in-django-app-in-the-production-server -- Y

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread bax...@gretschpages.com
On Dec 11, 11:39 am, Zeynel wrote: > I just want to add 2 new fields to the model. If I upload the new > models.py would the app work as before? Yes, but you'll have to manually adjust your database to have the new fields. -- You received this message because you are subscribed to the Google Gr

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Phlip
> > I just want to add 2 new fields to the model. If I upload the new > > models.py would the app work as before? > > Yes, but you'll have to manually adjust your database to have the new > fields. What does manage.py syncdb do? -- You received this message because you are subscribed to the Goog

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Zeynel
Ok. What else do I need to do after uploading the new models.py with new fields to the server and run manage.py syncdb? On Dec 11, 12:50 pm, "bax...@gretschpages.com" wrote: > On Dec 11, 11:39 am, Zeynel wrote: > > > I just want to add 2 new fields to the model. If I upload the new > > models.p

Re: How to choose one row of data

2009-12-11 Thread Andy
Tom - DR's method is simple and effective, but I'm guessing you say it's the worst way because it creates an unnecessary database request. Is this a correct assumption? If not, please explain. On Dec 11, 10:58 am, Tom Evans wrote: > On Fri, Dec 11, 2009 at 4:44 PM, Andy wrote: > > Thank you D

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Zeynel
On Dec 11, 1:21 pm, Phlip wrote: > What does manage.py syncdb do? I think it sets up the new database: http://stackoverflow.com/questions/1889622/how-to-replace-models-py-in-django-app-in-the-production-server/1889650#1889650 -- You received this message because you are subscribed to the Googl

Re: How to execute linux command in django view

2009-12-11 Thread Kashif Azeem
Thank you Shawn for the reply now i have another problem i.e. on executing some commands like 'vgs' or 'lvs' it didnt executed and the warning generated as "Running as a non-root user. Functionality may be unavailable". Any idea how to solve this user issue please? -- Kashif On Fri, Dec 11, 2009

Re: Couldn't create tables.

2009-12-11 Thread Ian
On Dec 11, 6:41 am, "rhce.san" wrote: > I have created the django project with necessary apps and trying to > link it to the db. ( oracle 11g) > > Further info : python 2.5 > django : 1.1.1 > > I am trying to integrate my django application to ldap , was > successfull .. but while logging in in go

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread bax...@gretschpages.com
On Dec 11, 12:21 pm, Zeynel wrote: > Ok. What else do I need to do after uploading the new models.py with > new fields to the server and run manage.py syncdb? > syncdb will not alter an existing database. You can run it (it won't hurt) but it won't insert the new fields. You'll need to go to your

HTML text editing

2009-12-11 Thread Riku
Hi, I just got a wysiwyg editor to work in my forms, but then I noticed that HTML is autoescaped, so I can't really use it. What should I use in order to allow users to use a wysiwyg editor to input text and then show it with the same formatting on the webpage? By default all the entered text is

Re: How to execute linux command in django view

2009-12-11 Thread Preston Holmes
On Dec 11, 10:40 am, Kashif Azeem wrote: > Thank you Shawn for the reply now i have another problem i.e. on executing > some commands like 'vgs' or 'lvs' it didnt executed and the warning > generated as "Running as a non-root user. Functionality may be unavailable". > Any idea how to solve this

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Zeynel
On Dec 11, 1:52 pm, "bax...@gretschpages.com" wrote: > On Dec 11, 12:21 pm, Zeynel wrote: > > syncdb will not alter an existing database. You can run it (it won't > hurt) but it won't insert the new fields. I am confused about this because the django documentation here http://docs.djangoproject

Re: How to choose one row of data

2009-12-11 Thread TiNo
Why wouldn't you fetch the latest (completed) order by that particular user from the db? No id passing around, and it should give you only one result. If you pass an id, and don't use the session, make sure the order belongs to the user, otherwise users could see other users orders based on id gue

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread bax...@gretschpages.com
On Dec 11, 1:36 pm, Zeynel wrote: > I am confused about this because the django documentation here > > http://docs.djangoproject.com/en/dev/intro/tutorial01/#activating-models > > says that, > > >> Now, run syncdb again to create those model tables in your database: > >> python manage.py syncdb >

Re: How to execute linux command in django view

2009-12-11 Thread Kashif Azeem
Thank you Preston for the clarification. I am thinking to handle this by just making a python daemon process that will be started as root through shell and this daemon will execute all required shell commands. Daemon will check the actions queue (that can be slq table) and will perform the posted a

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread tezro
Seems like no clues... On Dec 10, 12:21 am, bruno desthuilliers wrote: > On 9 déc, 18:58, tezro wrote: > (snip) > > > > > That throws an error: TypeError: 'slug' is an invalid keyword argument > > for this function. > > > What am I doing wrong? > > Not posting the full traceback - tracebacks are

Re: HTML text editing

2009-12-11 Thread Shawn Milochik
Look at safestring. from django.utils import safestring The docs will explain all, but basically you do this: the_html = safestring.mark_safe(your_html) The text in "the_html," if passed in your template, will not be escaped. The standard warning should be repeated here -- be sure you trust yo

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread Shawn Milochik
On Dec 11, 2009, at 4:51 PM, tezro wrote: > Seems like no clues... > > On Dec 10, 12:21 am, bruno desthuilliers > wrote: >> On 9 déc, 18:58, tezro wrote: >> (snip) >> >> >> >>> That throws an error: TypeError: 'slug' is an invalid keyword argument >>> for this function. >> >>> What am I do

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Zeynel
On Dec 11, 2:42 pm, "bax...@gretschpages.com" wrote: > If the table already exists, you will need to manually modify it. For > sqlite3, I would suggest the Firefox sqllite manager plugin, which > makes editing the tables pretty easy. You are right. I did upload the new models.py and run python2.

Re: Upload Progress Bar

2009-12-11 Thread Phil Mocek
On Fri, Dec 11, 2009 at 06:55:22AM -0800, Nemo wrote: > It turns out that flash-based progress bars (like SWFupload > also) have a trouble with the progress upload. The flash does > the update only once, see > http://demo.swfupload.org/Documentation/#uploadProgress The information on that site is

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread tezro
Wooof, thanks for reply. Well, look. I had a "news/models.py" file with definitions of Source (type of news) and Element(the news elements theirselves) with a foreign key "Source". The script I used to gather news from different sites looks like this: --- title = "title" date=datetime.now()) new_e

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Nick Arnett
On Fri, Dec 11, 2009 at 11:36 AM, Zeynel wrote: > > > So, it seems that, according to documentation, syncdb will create the > new tables? Yes, it will create *new* tables. It will not alter existing tables. If you don't need to save your existing data, the easiest thing is to drop the old dat

Passing data from view to template

2009-12-11 Thread David
hello, This is my first time to work in the Ajax filed. What I need to do is to pass an object from view to a javaScript function in template. The javaScript is Ajax. I have googled online and read some posts about json, ajax, etc, but I am still not quite clear. Can anybody tell me how to do thi

Internationalization. compilemessages.

2009-12-11 Thread Chirolo
Hi. Does any of you have had problems using django-admin.py compilemessages? I trying to change the language in a project from Spanish to English. I have follow all the django steps. 1-Translating strings> {% trans 'string' %} 2- Traslating some forms---> name= forms.CharField(label=_ (

Re: Should empty formsets call their own clean method?

2009-12-11 Thread Preston Holmes
Well something wonky is going on. >From my readthrough of the code, it *should* get called on empty formsets: is_valid calls total_form_count to get a loop count total_form_count should be positive even if forms are blank is_valid then accesses form.errors inside that loop (django.forms.formsets

Inheriting from User, UserAdmin, and the Admin site

2009-12-11 Thread fgasperino
All, I have the following setup: --models.py -- from django.db import models from django.contrib.auth.models import User as DjangoUser class Business (models.Model): ... class Group (models.Model): business = models.ForeignKey(Business) ... class User (DjangoUser): group = models.Fore

Scammer / Job fraud rehash - Do NOT perform any business with Eike Post

2009-12-11 Thread David Ross @ Wolfeon
Recently an individual has contacted me about "Eike Post"/"Eike Berend Post" asking whether the person is legitimate. I must rehash an email back from 2008 on this mailing list. The emails received from the individual is job fraud! The resume on "Eike Post" is fictitious! Do not perform any work f

Re: Error creating and saving a Django-object from the other script

2009-12-11 Thread Shawn Milochik
Why did you manually add a 'slug' field to your database after modifying the model? Django's syncdb does a lot more than just create the field; depending on which database you're using, it does a few other things and overrides some defaults. I wonder if there's a disconnect there. If this proje

Re: Passing data from view to template

2009-12-11 Thread Shawn Milochik
What kind of object are you trying to send? JSON pretty much looks identical to a Python dictionary, so if your object is a Python dictionary, list, or tuple you'll have no problem -- just convert the Python object using simplejson.dumps(). If this doesn't help much, please provide more detail

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Shawn Milochik
I feel like a broken record this week -- I've been recommending South in every other post I've made on this list. So, at risk of annoying people, check out South: http://south.aeracode.org It does exactly what you want it to do, and is the dominant (and nearly the only) solution used in the Dja

Re: Passing data from view to template

2009-12-11 Thread David
Hi Shawn, Thanks so much for your reply. Here is an example. I have a following dictionary in Python employees = { "accounting" : [ // accounting is an array in employees. { "firstName" : "John", // First element "lastN

Re: Passing data from view to template

2009-12-11 Thread Shawn Milochik
You don't need to transfer this to JavaScript once it's in JSON, which is a JavaScript object. If you're using AJAX, it's dead easy. #use this in your view return HttpResponse(simplejson.dumps(employees), mimetype="application/json") Then, in your JavaScript, you can use JSON syntax to refer t

Re: Passing data from view to template

2009-12-11 Thread David
Cool. Thanks Shawn! On Dec 11, 7:32 pm, Shawn Milochik wrote: > You don't need to transfer this to JavaScript once it's in JSON, which is a > JavaScript object. > > If you're using AJAX, it's dead easy. > > #use this in your view > return HttpResponse(simplejson.dumps(employees), mimetype="appli

Re: Can I change the models.py of an existing django app?

2009-12-11 Thread Phlip
> syncdb will not alter an existing database. Maybe the Django authors are obeying the DB ideal that if you could do without a field for the first few records, then that field, when it arrives, should be normalized out into its own table. (Roughly speaking, a field with too many NULL or False ent

Re: HTML text editing

2009-12-11 Thread Brian McKeever
I wrote a html whitelist filter that only allows predefined tags, and runs however many filters you want to specify on it. I'd be curious what you guys thought about it. http://sourceforge.net/projects/htmlfilterfacto/ On Dec 11, 2:51 pm, Shawn Milochik wrote: > Look at safestring. > > from dja

Re: Help me with django templates

2009-12-11 Thread Biju Varghese
I got it error was i was trying to check to two different data types one was an integer and other was a string like 1 and '1' On Dec 9, 8:34 pm, Daniel Roseman wrote: > On Dec 9, 2:18 pm, Biju Varghese wrote: > > > > >                 {%for jobsp in jobspecs%} > >                         {%ifequ