Re: javascript and form fields

2007-02-02 Thread Kenneth Gonsalves
On 02-Feb-07, at 7:11 PM, michelts wrote: > Can someone show an example of django+javascript integration? http://www.b-list.org/weblog/2006/08/05/django-tips-simple-ajax- example-part-2 -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/

full content feeds

2007-02-02 Thread James Tauber
I've implemented a very quick "announcement" feed as coded below. This meets my current need of adding news items in the admin and having an Atom feed for them (there are also HTML views but that's irrelevant to my question). However, I'd like my feed to be full content. Given what I have

Re: textarea - autoamtic line break

2007-02-02 Thread [EMAIL PROTECTED]
ok thanks! i looked on the textwrapper api, but i didn't find a function to replace the line breaks which are set by browser... there are difference in line breaks between the browser? if there are - there will be never a solution given to solve this problem by setting \n for line breaks which

messages, filters and templates o my!

2007-02-02 Thread Milan Andric
Hello, I have a small problem, I'm submitting a review form (form x) on a page that has many of these forms in a list, so you can view other reviews, add new ones or edit your own. When a review is edited a view processes it and redirects the person back to the review using an anchor like

Re: create a model instance from dictionnary

2007-02-02 Thread Leo Soto M.
On 2/2/07, Sebastien Armand [Pink] <[EMAIL PROTECTED]> wrote: > Is it possible to instantiate a model class from a dictionnary? > > I mean instead of using: > > MyModel(arg1=1,arg2=2,...) > > I'd like to use: > > data= {'arg1':1,'arg2':2,...} > MyModel(data) Just use standard python syntax:

Re: Where to put function to instantiate and save a model object?

2007-02-02 Thread Russell Keith-Magee
On 2/3/07, Rob Hudson <[EMAIL PROTECTED]> wrote: > > Log(user=request.user, session=request.session.session_key, > varname='somename').save() > But I'm finding that I'm writing the above line in a number of > places. I'd like to create a method to do this for me. But where? Why not take

Re: '001' -> '1' in Sqlite!!

2007-02-02 Thread Russell Keith-Magee
On 2/2/07, mamcxyz <[EMAIL PROTECTED]> wrote: > INSERT INTO Vendedor (Codigo) VALUES ('006') > > And blindly believe in the database. > > Then today I discover Sqlite "transform" it to '6'. That is I call a > shock! Specially when Sqlite declare that all the data is internally > stored as text.

Re: javascript and form fields

2007-02-02 Thread Robert Coup
[EMAIL PROTECTED] wrote: > Not necessarily... You don't have to get them by ID. You can get them > by tagname or, with a simple helper, class name. > Or group them, then cycle through... something like > var controls = > document.getElementById("controls").getElementsByTagName("a") > for(var

Re: Django as Single Sign-On?

2007-02-02 Thread Rob Hudson
On Fri Feb 02, 2007 at 02:11:22PM -0800, Reinhard Knobelspies wrote: > > Kim Camerons "Laws of Identity" should be your starting point for > research on SSO and identity-related matters: > http://www.identityblog.com/?page_id=354 > > Django and OpenID >

Re: Django as Single Sign-On?

2007-02-02 Thread Rob Hudson
On Fri Feb 02, 2007 at 09:51:33PM -, Brian Beck wrote: > Hi Rob, > > I implemented CAS in Django, which is one form of single sign-on. > You're welcome to check out the code to see what needs to be done for > such a task; it's mostly middleware stuff. Details are here: http:// >

Re: ImproperlyConfigured: Error importing middleware django.contrib.sessions.middleware: "No module named mysite"

2007-02-02 Thread Graham Dumpleton
On Feb 3, 12:12 am, "HenrikG" <[EMAIL PROTECTED]> wrote: > My biggest problem was to get the Location directive right in the > httpd.conf. It now looks like this: > > > SetHandlermod_python > PythonHandler django.core.handlers.modpython > PythonPath "sys.path +

Re: Django as Single Sign-On?

2007-02-02 Thread Reinhard Knobelspies
Kim Camerons "Laws of Identity" should be your starting point for research on SSO and identity-related matters: http://www.identityblog.com/?page_id=354 Django and OpenID http://simonwillison.net/2006/Dec/22/screencast/ http://feh.holsman.net/articles/2006/07/14/zyons-openid-what-a-match

Re: '001' -> '1' in Sqlite!!

2007-02-02 Thread mamcxyz
Thanks, but I don't use the model. Is a direct insert. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from

Re: Forms inheritance

2007-02-02 Thread aaloy
2007/2/2, Honza Král <[EMAIL PROTECTED]>: > On 2/2/07, aaloy <[EMAIL PROTECTED]> wrote: > > > > Hello, > > > > I'm trying use form inheritance to render the form, but it seems > > Django just renders the child fields and not the parent ones. Is this > > a feature or a bug? > > > > > > class

Re: Error with Meta: unique_together

2007-02-02 Thread Ramiro Morales
Todd, On 2/2/07, Todd O'Bryan <[EMAIL PROTECTED]> wrote: > > I'm getting the following error when I put > class Meta: > unique_together = (('number', 'test'),) > in an Answer model that refers to a Test model as a ForeignKey. > > Commenting out the Meta class clears up the problem,

Where to put function to instantiate and save a model object?

2007-02-02 Thread Rob Hudson
I have a model called "Log" which logs access to certain pages or sets variables that we're tracking. The way I'm inserting new records into the log table is like this: Log(user=request.user, session=request.session.session_key, varname='somename').save() But I'm finding that I'm writing

Error with Meta: unique_together

2007-02-02 Thread Todd O'Bryan
I'm getting the following error when I put class Meta: unique_together = (('number', 'test'),) in an Answer model that refers to a Test model as a ForeignKey. Commenting out the Meta class clears up the problem, but it's a complete mystery to me. Any ideas? Todd AttributeError at

See changes in save trigger

2007-02-02 Thread Dagur
Is it possible to see if a field (in my case an Imagefield) has changed in the save() method? I want to have a Textfield automatically changed if a new Image is uploaded, otherwise leave it alone. class SomeClass: sometextfield someimagefield def save() if someimagefield has

Re: textarea - autoamtic line break

2007-02-02 Thread Waylan Limberg
On 2/2/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > The reason for my question is following: > > i would like to use a textarea which size is fix (rows/cols). > The text who everybody write into, should not be longer as the given > size of area. > So...if the line ends, the text should

Re: javascript and form fields

2007-02-02 Thread [EMAIL PROTECTED]
Not necessarily... You don't have to get them by ID. You can get them by tagname or, with a simple helper, class name. Or group them, then cycle through... something like var controls = document.getElementById("controls").getElementsByTagName("a") for(var i=0;i

Re: Need advice for model relationship (onetoone inside?)

2007-02-02 Thread Joseph Heck
The relationship you've set up - one template can have many associated documents, do I understand correctly? So every document will have a reference to the Template that it's associated with. If that's the case, you've only set it up for one template per Document. A default doesn't make sense in

'001' -> '1' in Sqlite!!

2007-02-02 Thread mamcxyz
Hi, I found that in Sqlite when I do: INSERT INTO Sample (Code) VALUES ('001') Get converted to '1' Exist a way to solve it (I don't like the idea of put ' 001' because that break the integration process with another database) --~--~-~--~~~---~--~~ You

Get domain name

2007-02-02 Thread evenrik
I have 2 domain names pointing to the same ip. I need to customize some of the content depending on which domain is used. How do I know in a view which one the user connected with? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

haw access to values from field with choices

2007-02-02 Thread kamil
Surely it's solved but I can't find any info about it. I'm sure that everybody met this problem. What is the best way to get rendered the value from the field with choices. Generic views spits key not value. --~--~-~--~~~---~--~~ You received this message because

"dynamic" model, where to put what

2007-02-02 Thread Dill0r
Hi, Though there is a section in the FAQ converning diangos MVC philosphy im still confused. My model is manipulated while my application runs. So how do i manipulate the model from external? Ive written a stop/ wait protocol in python which communicates with the microcontroller that

'001' -> '1' in Sqlite!!

2007-02-02 Thread mamcxyz
Hi, I'm doing direct inserts, like: INSERT INTO Vendedor (Codigo) VALUES ('006') And blindly believe in the database. Then today I discover Sqlite "transform" it to '6'. That is I call a shock! Specially when Sqlite declare that all the data is internally stored as text. Now, I have a real

Re: Uploading large files via http FORM

2007-02-02 Thread Jay Parlar
On 1/12/07, Pythoni <[EMAIL PROTECTED]> wrote: > > Hi, > does anyone have an experience with uploading large files in Django > application? > I use mod_python with Django and when I try to upload a file about 100 > MB I received an error. > Thank you for any suggestion. > L. > Even if you

Re: order_by not working with foreign keys:

2007-02-02 Thread Ramiro Morales
On 2/1/07, Russell Keith-Magee <[EMAIL PROTECTED]> wrote: > > On 2/1/07, Michael Radziej <[EMAIL PROTECTED]> wrote: > > > is there a > > > HOWTO somewhere on how to write a test which does the whole model, > > > database sync, etc etc cycle? > > [...] > > [...] > > Django's internal tests are in

newforms custom field errors?

2007-02-02 Thread Ceph
Would it be possible to allow custom error messages per field in newforms? E.g., class MyForm(forms.Form): username = forms.CharField(label="User Name", error="Please enter your user name.") "This field is required." doesn't work well if you are displaying your errors on top of your form

Re: textarea - autoamtic line break

2007-02-02 Thread [EMAIL PROTECTED]
The reason for my question is following: i would like to use a textarea which size is fix (rows/cols). The text who everybody write into, should not be longer as the given size of area. So...if the line ends, the text should break automaticly in the next line. And this line break should allready

Middleware sessions

2007-02-02 Thread kbochert
After a long absence, I tried my installation of the tutorial and got: Error importing middleware django.middleware.sessions My settings.py has: MIDDLEWARE _CLASSES = { "django.middleware.sessions.SessionMiddleware", ... I change this to : MIDDLEWARE _CLASSES = {

Middleware sessions

2007-02-02 Thread kbochert
After a long absence, I tried my installation of the tutorial and got: Error importing middleware django.middleware.sessions My settings.py has: MIDDLEWARE _CLASSES = { --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: javascript and form fields

2007-02-02 Thread [EMAIL PROTECTED]
Look at: http://www.b-list.org/weblog/2006/07/31/django-tips-simple-ajax-example-part-1 and http://www.b-list.org/weblog/2006/08/05/django-tips-simple-ajax-example-part-2 Django has quite a bit of things built in that will help you, regardless of which JS library you want to use. On Feb 2, 7:41

Re: use forloop.counter0 as index?

2007-02-02 Thread Aidas Bendoraitis
I think, it's impossible to use forloop.counter0 as an index, because array.forloop already searches for array['forloop'], array[forloop], array.forloop, and similar combinations which don't exist. But maybe you could zip(items, array) in the view or merge items and array in some other way and to

Re: possible bug when editing an object: foreign key "_id" part gone

2007-02-02 Thread Benedict Verheyen
Benedict Verheyen schreef: > Hi, > > i think i might have encountered a possible bug but i'm not sure though. > Editing an object and leaving a mandatory field empty results in the > form "forgetting" the foreign keys. It doesn't actually forget but it ommits > the > "_id" part and thus the

Re: javascript and form fields

2007-02-02 Thread michelts
Hi! How do you recomend work with javascript and django? There is documentation for all tasks on django but there is nothing about using ajax/json/javascript with it. I like to use MochiKit and I like to made use of ajax at all, to be able to do this, I made a helper function called

Re: django and tramline integration

2007-02-02 Thread [EMAIL PROTECTED]
Maybe you'll find this useful. http://codespeak.net/pipermail/tramline-dev/2006-December/41.html I haven't checked it yet, but will during the weekend, so maybe I can share more information on Monday. Probably it would be useful to check integration with Zope, but I haven't had enough time

Re: noobie first project

2007-02-02 Thread [EMAIL PROTECTED]
Sounds like you need to extend the auth_user. If I were you I'd look at Jeff Croft's Lost Theories source, as that does what you need to do. Also, I think James Bennett wrote an article on it over on b- list.com On Feb 2, 3:29 am, "ashwoods" <[EMAIL PROTECTED]> wrote: > first place to look is

Re: javascript and form fields

2007-02-02 Thread [EMAIL PROTECTED]
Why does that hurt? Sure is better than having onclick handlers littering your html all over the place. On Feb 2, 6:27 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi. Is there any clean way to add javascript handler to form field > (subclas of django.forms.FormField)? > > The result

javascript and form fields

2007-02-02 Thread [EMAIL PROTECTED]
Hi. Is there any clean way to add javascript handler to form field (subclas of django.forms.FormField)? The result should look like: Right now im using 'ugly' document.getElementById('id_some_name') . from template level. But it hurts and is ugly IMHO ;) Regards Michal

Database templates, views, and template tags

2007-02-02 Thread plungerman
greetings, i have created a template loader to grab templates from the database: from django.template import TemplateDoesNotExist try: from myproject.editor.models import Layout except: Layout = None def load_template_source(name, template_dirs=None): """ Loads templates from

Re: textarea - autoamtic line break

2007-02-02 Thread Kenneth Gonsalves
On 02-Feb-07, at 4:26 PM, Simon Brunning wrote: >> field's value on the server side, post-submittal. I do that with one >> of my own forms (in order to fit the text in a box in a pdf). > > Why write your own? > > hey cool - just what i wanted

Re: noobie first project

2007-02-02 Thread ashwoods
first place to look is here: http://www.djangoproject.com/ documentation/ :) and for your special case: http://www.djangoproject.com/documentation/ authentication/ you can use the admin site for users, of course its not a full blown cms, (it's not supposed to either). but you can add