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 changed

Re: Django/Javascript string problem

2006-11-08 Thread Dagur Páll Ammendrup
[EMAIL PROTECTED] wrote: > I'm still not exactly sure what you're trying to do, but if you should > be able to add fields to the form object you cloned pretty easily with > appendChild. > > > I tried that and it works great. Thanks for the suggestion :-) --~--~-~--~~~--

Re: Django/Javascript string problem

2006-11-08 Thread Dagur Páll Ammendrup
[EMAIL PROTECTED] wrote: > But here's a question... why are you trying to put this object into a > string? Seems like you'd be better off just keeping it an object. > Perhaps you'd be better off with a simple > test = document.getElementById('id_embeddedvideo.0.type'); or, if you > needed to do so

Re: Django/Javascript string problem

2006-11-08 Thread Dagur
Jay Parlar wrote: > On 11/8/06, Dagur <[EMAIL PROTECTED]> wrote: > > > > Unfortunately that's exactly the filter I tried using when I got that > > > > "Caught an exception while rendering: 'FormFieldWrapper' object has no > > attri

Re: Django/Javascript string problem

2006-11-08 Thread Dagur
Unfortunately that's exactly the filter I tried using when I got that "Caught an exception while rendering: 'FormFieldWrapper' object has no attribute 'replace'" error. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Django/Javascript string problem

2006-11-08 Thread Dagur
Sorry for the vague explanation. To make a long story short I'm trying to put the output of {{ blah }} into a javascript string, but since {{ blah }} prints out multiple lines, it won't work. --~--~-~--~~~---~--~~ You received this message because you are subscri

Django/Javascript string problem

2006-11-07 Thread Dagur
I have a form with a drop down box and a few other fields but I want to put it in a javascript field and printed out when a link is clicked. So it looks something like this: function bla(){ var test = 'Type{{ form.embeddedvideo.0.type }}'; return test; } the problem is that the formfield

Re: Why I'm giving up on Django

2006-09-29 Thread Dagur Ammendrup
You can also just use the "next" parameter in the login form. Here's how I did it  type="hidden" name="next" value ="{% if next %}{{ next }}{% else %}/{% endif %}" /> On 29/09/06, Don Arbow <[EMAIL PROTECTED]> wrote: On Sep 28, 2006, at 6:26 PM, Sean Schertell wrote:>> (2) This is a biggie for me.

Re: Admin site/ManyToManyField problem

2006-06-08 Thread Dagur Ammendrup
I tried with tags and no tags but this is the first post being added. Having one other post didn't change anything.On 08/06/06, Ramiro Morales <[EMAIL PROTECTED]> wrote:Dagur, On 6/7/06, Dagur <[EMAIL PROTECTED]> wrote:>> Hi,>> I'm having problems with ManyToMa

Admin site/ManyToManyField problem

2006-06-07 Thread Dagur
Hi, I'm having problems with ManyToManyField not appearing in the admin site. I think it's best explained with this screenshot (look at the bottom): http://dagur.sytes.net/static/djangoshot.jpg I also put the source for the models in on pasted: http://paste.e-scribe.com/372/ I'm at the point wh

Re: extend User in m-r

2006-05-04 Thread Dagur
Has this problem been solved? I've been fighting this problem forever. Everything seems to work but no matter what i do the data in the new class never gets saved. I would really love to see some instructions in the documentation. --~--~-~--~~~---~--~~ You receive

Checking if ManyToManyField is empty in pre_save function

2006-05-01 Thread Dagur
Hi, I have a ManyToManyField called "authorised" (which is supposed to be a list of users) and a BooleanField called "is_private" which should be set to false if there are no users in "authorised" so I did this: def save(self): if self.authorised.count() == 0: self.is_priv

OneToOneField and edit_inline

2006-04-17 Thread Dagur
Hi, I have a model like this (which is based on an old system I'm porting): class Member(meta.Model): user = meta.OneToOneField(auth.User, core=True) ipb_id = meta.IntegerField(default=0) website = meta.URLField(blank=True, null=True) hide_email = meta.BooleanField(default=True)

Re: Newspapers

2006-02-18 Thread Dagur Páll Ammendrup
did you know about Ellington (http://www.ellingtoncms.com/) ? Dan Mahoney wrote: >I would be interested in hearing what sort of replies you get. I have >a similar interest. > >On 2/18/06, Arthur <[EMAIL PROTECTED]> wrote: > > >>Adrian H. suggested I post a note explaining that I'm very

Re: problem marketing django to php folk

2005-11-26 Thread Dagur
I'd be paranoid too if I used php

Re: Django developing in NewEdit

2005-11-22 Thread Dagur Páll Ammendrup
limodou wrote: NewEdit is a Python Editor base on wxPython. I'm learning django recently, and I'm beginning develop some extension about django in NewEdit. The process is continuing. I'v finished something like these: * django project wizard(need install it) -- you can create a django project

Best way to make your apps translateable

2005-09-28 Thread Dagur
This might not really be a Django question but I was wondering what is the best way to write your apps so they can be easily translated (with as small a performance hit possible of course)

Re: TurboGears

2005-09-26 Thread Dagur
it's not as nice as Django. But I like the turbogears-admin command line tool

Re: Can't figure out file upload

2005-09-08 Thread Dagur
I've been throught this too :) First of all, you need to use both {{ form.image}} and {{ form.image_file }} this will create the hidden file and the file input field. Also, if you forgot like I did, you need to put enctype="multipart/form-data" into the form tag. Thirdly, in the view, do this

Re: Basic file upload (not model file object)

2005-08-30 Thread Dagur
Jason F. McBrayer wrote: > I'm almost certainly missing something very, very simple here, but I > haven't been able to find what it is on my own. > > One view in my app should allow users to upload an OPML file, which the > app will parse and use to import feeds, but which won't otherwise be > sto

Re: Adding Record Problem

2005-08-19 Thread Dagur
If you created the database from scratch (i.e. if you're not using an existing database) you shouldn't need to have the line: meta.IntegerField('id', primary_key=True), the primary key would be created automatically. If that's the case you might want to try creating the tables again.

Re: ForeignKey and the admin interface

2005-08-15 Thread Dagur
Oh, sorry. I can't try it until I get home :-P

Re: ForeignKey and the admin interface

2005-08-15 Thread Dagur
Thanks, I will do that! I have a feature suggestion: The option to open a pop-up window and search for the id.

ForeignKey and the admin interface

2005-08-15 Thread Dagur
Is it possible to somehow limit the size of drop-down lists in the admin interface when editing an item that has a ForeignKey relation to another table? I have a rather large database and when I want to edit an item in one of my tables, the page I get is huge (in kb's) and takes a quite a while t