Re: TINYMCE causing form error "This field is required."

2009-01-26 Thread Daniel Roseman
On Jan 26, 5:22 am, "Eric I.E." wrote: > When I add TinyMCE to my form fields it turns them from optional > (blank=True, null=True) into required fields. > I am using django-tinymce in conjunction with django-filebrowser. > > My field is defined in models.py like this: > column1 = models.TextFiel

Re: reportlab - filename of generated PDF

2009-01-26 Thread Vinay Sajip
On Jan 26, 7:59 am, Ivan Mincik wrote: > Dear django users, > we have a problem with filename of resulting PDF generated by reportlab and > then downloaded by browser. > > Generated PDF is OK, but filename is incorrect. It is allways something like > "randomstring.pdf.part". (for example sa34

Re: Strange Model behavior

2009-01-26 Thread Steve Holden
Dj Gilcrease wrote: > What do you need to do in __init__ > You don't actually need to fo anything at all! As you have the code now you're calling the superclass's __init__ with two arguments: the newly created instance, a tuple of the other positional args (if any) and a dict of the keyword argum

Re: djangobook.com, chapter 5, __init__() got an unexpected keyword argument 'maxlength'

2009-01-26 Thread dscher
Thanks, this one tripped me up as well. On Dec 2 2008, 12:09 am, djan wrote: > Thank you all! This did the trick, and I'm sure it will help be avoid > future problems. > > On Dec 1, 9:57 am, Praveen wrote: > > > write max_length instead of maxlength > > > On Dec 1, 1:01 pm, Roland van Laar wro

Target anchor on div's id (/account/#divid ) + Redirection after a POST = ascii encode problem

2009-01-26 Thread Seth Kaïne
Here's my problem. I want to redirect my urls by the name of its model, like this: urls.py: (r'^(?P\w+)/$', 'urlCatcher'), (r'^(?P\w+)/(?P\w+)/$', 'urlCatcher'), (r'^(?P\w+)/(?P\w+)/(?P\w+)/$', 'urlCatcher'), here's the function in the views.py: def urlCatcher(r

Django unittest fails to check empty values

2009-01-26 Thread marco sedda
Hi, I've a problem with unittest in django: I've described a models.py: class Season(models.Model): name = models.CharField(max_length=30, unique=True) startDate = models.DateField("From") endDate = models.DateField("To") and the test.py: def testSeasonCreateEmp

Dynamically changing q object

2009-01-26 Thread Stefan Tunsch
Hi! I have a qset object like this: qset = ( Q(dst__contains=company.phone) | Q(dst__contains=company.cellphone) | Q(dst__contains=company.fax) | Q(src__contains=company.phone) | Q(src__contains=company.cellphone) |

Re: reportlab - filename of generated PDF

2009-01-26 Thread Ivan Mincik
On Monday 26 January 2009, Vinay Sajip wrote: > > On Jan 26, 7:59 am, Ivan Mincik wrote: > > Dear django users, > > we have a problem with filename of resulting PDF generated by reportlab and > > then downloaded by browser. > > > > Generated PDF is OK, but filename is incorrect. It is allways s

Re: Target anchor on div's id (/account/#divid ) + Redirection after a POST = ascii encode problem

2009-01-26 Thread Steve Holden
Seth Kaïne wrote: > Here's my problem. I want to redirect my urls by the name of its > model, like this: > urls.py: > > > (r'^(?P\w+)/$', 'urlCatcher'), > (r'^(?P\w+)/(?P\w+)/$', 'urlCatcher'), > (r'^(?P\w+)/(?P\w+)/(?P\w+)/$', > 'urlCatcher'), > > here's the function i

Re: Dynamically changing q object

2009-01-26 Thread Sebastian Bauer
W dniu 26.01.2009 13:08, Stefan Tunsch pisze: > Hi! > > I have a qset object like this: > > qset = ( > Q(dst__contains=company.phone) | > Q(dst__contains=company.cellphone) | > Q(dst__contains=company.fax) | > Q(src__contains=comp

Re: Dynamically changing q object

2009-01-26 Thread Tim Chase
> I have a qset object like this: > > qset = ( > Q(dst__contains=company.phone) | > Q(dst__contains=company.cellphone) | > Q(dst__contains=company.fax) | > Q(src__contains=company.phone) | > Q(src__contains=company.ce

Re: Dynamically changing q object

2009-01-26 Thread Sebastian Bauer
W dniu 26.01.2009 13:08, Stefan Tunsch pisze: > Hi! > > I have a qset object like this: > > qset = ( > Q(dst__contains=company.phone) | > Q(dst__contains=company.cellphone) | > Q(dst__contains=company.fax) | > Q(src__contains=comp

Model fails in shell but not in runserver - IndexError: list index out of range

2009-01-26 Thread phoebebright
Am I blind? I am getting this error in the shell, but no obvious errors when using the browser interface. >>> from models import Business Traceback (most recent call last): File "", line 1, in ? File "/home/django/towns/models.py", line 8, in ? class Category(models.Model): File "/usr/

Re: Favorite Front-End Dev Environment?

2009-01-26 Thread Skylar
I use multiple tabs/terminals of vim. I usually have one that is settings.py and webserver configuration and then another one tabbed with: |urls|views|style.css|base.html|theOneIamWorkingOn.html|. Then models/forms/admin usually gets a workspace of their own. Never used an IDE for anything but

Re: Model fails in shell but not in runserver - IndexError: list index out of range

2009-01-26 Thread Karen Tracey
On Mon, Jan 26, 2009 at 8:03 AM, phoebebright wrote: > > Am I blind? > > I am getting this error in the shell, but no obvious errors when using > the browser interface. > > >>> from models import Business > Traceback (most recent call last): > File "", line 1, in ? > File "/home/django/towns/mod

Django and WMD editor

2009-01-26 Thread Gath
Good people! How can i hook up WMD editor on my django form? http://wmd-editor.com Paul --~--~-~--~~~---~--~~ 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@google

Re: Iterating over jwplayers

2009-01-26 Thread Skylar
Exactly right, this was a stupid question it turns out :|. Just need to make a unique id using some combination of say {{forloop.counter}} and {{video.id}}, {{video.not}} and yes s1.write ('idDynamicallyGenerated') should match the id generated for the . I think I fixed this within 5 minutes of

Cookie authentication

2009-01-26 Thread Sylvain
Hello everybody, I'm trying to create a cookie-based authentication so that the users don't have to login each time they visit the website. I'm already using django.contrib.auth to log the users in and it works pretty well with a custom authentication backend (because I'm importing the users from

Re: Dynamically changing q object

2009-01-26 Thread Stefan Tunsch
This works excellent. Had now idea this was possible... Regards, Stefan Tim Chase escribió: I have a qset object like this: qset = ( Q(dst__contains=company.phone) | Q(dst__contains=company.cellphone) | Q(dst__contains=company.fax) |

Re: Model fails in shell but not in runserver - IndexError: list index out of range

2009-01-26 Thread phoebebright
Karen, Yes have models in same directory as settings - bad girl! Thanks. Phoebe. On Jan 26, 1:37 pm, Karen Tracey wrote: > On Mon, Jan 26, 2009 at 8:03 AM, phoebebright > wrote: > > > > > > > Am I blind? > > > I am getting this error in the shell, but no obvious errors when using > > the bro

could not able to schedule a standalone python script which uses a django module

2009-01-26 Thread Rama
i have a standalone python script which uses a django module. i need to schedule that script using crontab. while doing this i encountered the following problem 1) the above standalone python script which uses django module is running properly on the terminal. ( DJANGO_MODULE_SETTINGS are

Re: Django and WMD editor

2009-01-26 Thread Brian Neal
On Jan 26, 7:40 am, Gath wrote: > Good people! > > How can i hook up WMD editor on my django form? > > http://wmd-editor.com > > Paul You just have to get your page to include the correct CSS and Javascript files, just like any other editor like this. If this is a public facing form, check out t

mergin svn diff

2009-01-26 Thread Erik Bernoth
Hi guys, We want to experiment with some of the django development processes in our projects, too. So I tried to create .diff-files and merge them into another repository to keep my working trunk clean from patches and new features, that are not tested yet. The creation of diff files is easy. I

Re: mergin svn diff

2009-01-26 Thread Daniel Roseman
On Jan 26, 2:42 pm, Erik Bernoth wrote: > Hi guys, > > We want to experiment with some of the django development processes in > our projects, too. So I tried to create .diff-files and merge them > into another repository to keep my working trunk clean from patches > and new features, that are not

Re: could not able to schedule a standalone python script which uses a django module

2009-01-26 Thread Daniel Roseman
On Jan 26, 1:55 pm, Rama wrote: > i have a standalone python script which uses a django module. i need to > schedule  that script using crontab. > while doing this i encountered the following problem > > 1) the above standalone python script  which uses django module is running > properly on the

image upload problems (sorry for yet another one)

2009-01-26 Thread PeteDK
Hi there :) first the code: forms: class ProfileForm(forms.Form): ... image = forms.ImageField(required = False) models: class Profile(models.Model): user = models.ForeignKey(User, unique=True) image = models.ImageField(upload_to="images/", blank=Tru

Re: image upload problems (sorry for yet another one)

2009-01-26 Thread Brian Neal
On Jan 26, 9:16 am, PeteDK wrote: > Hi there :) > > first the code: > > forms: > class ProfileForm(forms.Form): >         ... >         image = forms.ImageField(required = False) > > models: > class Profile(models.Model): >         user = models.ForeignKey(User, unique=True) >         >    

Re: image upload problems (sorry for yet another one)

2009-01-26 Thread PeteDK
Hi. this is what it looks like. On 26 Jan., 16:29, Brian Neal wrote: > On Jan 26, 9:16 am, PeteDK wrote: > > > > > Hi there :) > > > first the code: > > > forms: > > class ProfileForm(forms.Form): > >         ... > >         image = forms.ImageField(required = False) > > > models: > > clas

Re: image upload problems (sorry for yet another one)

2009-01-26 Thread Daniel Roseman
On Jan 26, 3:16 pm, PeteDK wrote: > Hi there :) > > first the code: > > forms: > class ProfileForm(forms.Form): >         ... >         image = forms.ImageField(required = False) > > models: > class Profile(models.Model): >         user = models.ForeignKey(User, unique=True) >         >    

Re: XML Serialization Speed

2009-01-26 Thread Taylor
Okay, that makes sense. Thanks for the link to Python timing! Can anyone familiar with the internals of django's serialization and templating offer any suggestions? Thanks! On Jan 26, 2:57 am, Antoni Aloy wrote: > 2009/1/26 Taylor : > > > > > I'm thinking of changing my views so that they wor

Re: could not able to schedule a standalone python script which uses a django module

2009-01-26 Thread PeteDK
Hi I have had some problems with that myself. Don't know if this is any help, but here we go. i have created a file cron.py that i have placed in the exact same directory as my settings.py file. then at the beginning of my cron.py: from django.core.management import setup_environ import settings

Re: image upload problems (sorry for yet another one)

2009-01-26 Thread PeteDK
#Daniel Yep, but still no luck :( do I have to do anything else in my template? --~--~-~--~~~---~--~~ 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.co

Re: Favorite Front-End Dev Environment?

2009-01-26 Thread PeteDK
I started with eclipse because of its Python env/module. I have switched to textmate now though. :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Re: mergin svn diff

2009-01-26 Thread Erik Bernoth
Ah, so it is a took of version control developed early as subversion and just used by them. Interesting. Thanks for your Help, DR! regards Erik Bernoth On 26 Jan., 16:06, Daniel Roseman wrote: > On Jan 26, 2:42 pm, Erik Bernoth wrote: > > > > > Hi guys, > > > We want to experiment with some o

How to extend queryset iterator?

2009-01-26 Thread Enrico
I would like to track which items are being loaded in a queryset, without having to loop through the entire list. I think the best way would be to extend the Queryset object, probably the "__iter__" or "iterator" methods... But I don't want to copy-and-paste or mess with the Queryset code too mu

Issue with save(commit=False). Can't append primary key.

2009-01-26 Thread Ty
Here's a snip of my model: class Comment(models.Model): entry = models.ForeignKey('Entry') name = models.CharField(max_length=100) email = models.EmailField(max_length=200, blank=True) website = models.URLField(verify_exists=True, blank=True) body = models.

Re: Issue with save(commit=False). Can't append primary key.

2009-01-26 Thread Alex Koshelev
Form.save() returns an object. So your code may look like this: comment = commentform.save(commit=False) comment.entry = entry comment.save() On Mon, Jan 26, 2009 at 7:28 PM, Ty wrote: > > Here's a snip of my model: > > class Comment(models.Model): >entry = models.Fo

Re: Issue with save(commit=False). Can't append primary key.

2009-01-26 Thread Ty
That did it! Thank you very much! I did, however, have to change: comment.entry = entry.pk To: comment.entry = entry Again, thank you! On Jan 26, 11:39 am, Alex Koshelev wrote: > Form.save() returns an object. So your code may look like this: > > comment = commentform.save(commit=False) > com

Automagical Invoice Generation

2009-01-26 Thread Alfonso
I've got a very simple customer order model that saves the usual details into the system on a successful order placement. I'm trying to think of a way I can generate an associative invoice at the same time an order is submitted? Something within a custom 'def save' method? How would I set somet

Re: Automagical Invoice Generation

2009-01-26 Thread Almost George
On Jan 26, 10:52 am, Alfonso wrote: > I've got a very simple customer order model that saves the usual > details into the system on a successful order placement.  I'm trying > to think of a way I can generate an associative invoice at the same > time an order is submitted?  Something within a c

Re: Favorite Front-End Dev Environment?

2009-01-26 Thread Ariel Mauricio Nunez Gomez
Joshua, take a look at pinaxproject.com it may suit your needs. Ariel. --~--~-~--~~~---~--~~ 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 unsubs

Re: Multithreaded development server

2009-01-26 Thread birkin
On Jan 24, 7:08 pm, Almad wrote: > is there a way to run development server multithreaded, so it can > handle recurring requests? I have a view that calls a django web-service which would normally hang the single-threaded development server (when I'm also serving out the webservice via the deve

Geodjango polygon object

2009-01-26 Thread Adonis
Hello, I am trying to pass the polygon coordinates to my JS array but i do not get numbers. I end up with a JS array in which every polygon is displayed like this : The truth is that i would rather have a numeric format...How could i parse my polygon objects and extract the coordinates? for e

Re: Geodjango polygon object

2009-01-26 Thread Ariel Mauricio Nunez Gomez
> > This is because that is the string representation of the geometry field. {{ gemetry}} > > > The truth is that i would rather have a numeric format...How could i > parse my polygon objects and extract the coordinates? > > for example i have: > > fromDB = polygons.objects.all() > coordArray =

Re: Django unittest fails to check empty values

2009-01-26 Thread Alex Koshelev
What DB backend do you use? In some cases it rises OperationalError On Mon, Jan 26, 2009 at 2:25 PM, marco sedda wrote: > > Hi, I've a problem with unittest in django: > > I've described a models.py: > >class Season(models.Model): >name = models.CharField(max_length=30, unique=True

Re: image upload problems (sorry for yet another one)

2009-01-26 Thread PeteDK
Now i have tried some different things, just for testing. I have changed my forms til ModelForm instead of normal forms. forms: class ProfileForm(ModelForm): class Meta: model = Profile model is the same views is now: formP = ProfileForm (request

Basic question: hidden input not working

2009-01-26 Thread Matias Surdi
What is wrong with the following code? class IPAddressAdminForm(forms.ModelForm): notification_sent = forms.BooleanField(widget=forms.widgets.HiddenInput,required=False) class Meta: model = IPAddress class IPAddress(BaseModel): network = models.ForeignKey(Network)

create referenced object at the same time in the form

2009-01-26 Thread ltcstyle
I am going to allow user to create a Book object as well as its Author (if the author is not existed yet). How can I do it? AFAIK, inlineformset_factory seems a good start point. But as you see, the book and author object are both unknown in the form modeling stage. Any ideas? Thanks --~--~

Re: Basic question: hidden input not working

2009-01-26 Thread Matias Surdi
forget it, I've found the solution: http://docs.djangoproject.com/en/dev/ref/contrib/admin/#exclude Sorry... Matias Surdi escribió: > What is wrong with the following code? > > class IPAddressAdminForm(forms.ModelForm): > notification_sent = > forms.BooleanField(widget=forms.widgets.H

Re: Disabling middleware for tests

2009-01-26 Thread davenaff
Malcolm, Thanks a lot for the pointer. For anyone else interested, here is what my settings-test.py looks like: from settings import * # CSRF Middleware breaks auth tests MIDDLEWARE_CLASSES = list(MIDDLEWARE_CLASSES) MIDDLEWARE_CLASSES.remove ('django.contrib.csrf.middleware.CsrfMiddleware')

Re: image upload problems (sorry for yet another one)

2009-01-26 Thread Brian Neal
On Jan 26, 11:51 am, PeteDK wrote: [...] > The thing is. Now it still doesn't work through my website, however it > now works through admin. > Well it only works with .bmp pictures. Maybe my PIL is broken? could > that be the reason for my problem from before? As I recall, PIL out of the box onl

Joining Multiple models in same admin section

2009-01-26 Thread alant...@neei.uevora.pt
Hello, I have different models spread in some apps that are all related. Is it possible do put them in the same section in admin? example: coach: coach, coach_data, coach_things, coach_xxx player: player, player_data, player_aa, player_lll team: team, tema_data, team_ll This is all related to f

Django Forms in HTML 4.01 Strict

2009-01-26 Thread Ty
I write HTML 4.01 strict documents and I'm using the django.forms form- handling library. Currently when printing input fields on the template, the output includes the ending slash: "". Is there any way, other then manually writing the input field to the template, to get these variables to outpu

Re: Django Forms in HTML 4.01 Strict

2009-01-26 Thread Eduardo O. Padoan
On Mon, Jan 26, 2009 at 4:23 PM, Ty wrote: > > I write HTML 4.01 strict documents and I'm using the django.forms form- > handling library. > > Currently when printing input fields on the template, the output > includes the ending slash: "". > > Is there any way, other then manually writing the in

Re: Django Forms in HTML 4.01 Strict

2009-01-26 Thread Ty
Thanks for the link. I'm supprised there nothing "built-in" to allow this. Django's essentally pushing you to use XHTML over HTML. Not really a big deal though, I suppose. I'm just starting the project out so it won't take much to convert the whole page to XHTML. I'll probably just go that route.

Re: Joining Multiple models in same admin section

2009-01-26 Thread Daniel Roseman
On Jan 26, 6:22 pm, "alant...@neei.uevora.pt" wrote: > Hello, > > I have different models spread in some apps that are all related. Is > it possible do put them in the same section in admin? > > example: > coach: coach, coach_data, coach_things, coach_xxx > player: player, player_data, player_aa,

Re: Joining Multiple models in same admin section

2009-01-26 Thread alant...@neei.uevora.pt
I know, But I have lots of code and models so I separated in different apps to make it easier to read/develop. Now I noticed that for the admin they should have been developed together... Any solution? On Jan 26, 6:43 pm, Daniel Roseman wrote: > On Jan 26, 6:22 pm, "alant...@neei.uevora.pt"

changing form field rendering dependent on field type

2009-01-26 Thread mattsouth
I wish to customise a form template so that I produce forms like: my text field : my select field : ... my multiline text field : i.e. forms in a single column of paragraph tabs where usually the field label and input field are in separate blocks, except when the field is a select box (i.e

Unicode error

2009-01-26 Thread Oleg Oltar
Hi. I want to use django admin, for adding articles into my db. My language is Russian. I defined model in the following way: from django.db import models from tinymce import models as tinymce_models class Article(models.Model): title = models.CharField(max_length=60) body = tinymce_mode

Events models - Concert/Single -vs- Tour/Festival

2009-01-26 Thread Almost George
Looking for some advice from anyone who's done something similar... I'm working on a niche concert/event site, that essentially lists upcoming events sorted by Date/City/Venue, etc. Initially, my Event model (primarily) consisted of a Name and a Date (start/end), Bands (m2m), and a FK to a Venu

Re: Unicode error

2009-01-26 Thread Daniel Roseman
On Jan 26, 8:08 pm, Oleg Oltar wrote: > Hi. > I want to use django admin, for adding articles into my db. My language is > Russian. > > I defined model in the following way: > > from django.db import models > from tinymce import models as tinymce_models > > class Article(models.Model): >     titl

Re: Strange Model behavior

2009-01-26 Thread Mark Jones
I guess I was just too tired when I wrote it, I just forgot the * and ** on the 2 arguments. I have some initialization that I'm doing in __init__ but had removed that to make the example shorter and was still seeing the problem. Thanks for the help, those 3 *'s fixed the whole problem On Jan

Re: changing form field rendering dependent on field type

2009-01-26 Thread Mark Jones
That almost sounds like you will have to write the renderer for that class. I don't think this will be easy to do in the template, but if you override django.forms.widgets.Select.render. you can probably make it work. On Jan 26, 11:51 am, mattsouth wrote: > I wish to customise a form template s

Re: Unicode error

2009-01-26 Thread Oleg Oltar
THANKS On Mon, Jan 26, 2009 at 10:21 PM, Daniel Roseman < roseman.dan...@googlemail.com> wrote: > > On Jan 26, 8:08 pm, Oleg Oltar wrote: > > Hi. > > I want to use django admin, for adding articles into my db. My language > is > > Russian. > > > > I defined model in the following

Finding all Named URLs

2009-01-26 Thread rtelep
I'm looking for a way to get a list of all named URLs in a given URLconf, including all "included" URLconfs. I have made one, but it's ridiculous. The fact that I imagine it makes me believe that it exists: >>> get_named_urls() ['home','login','logout','foo'...] --~--~-~--~~-

trouble with yesno to generate images

2009-01-26 Thread Margie
Hi, I am trying to generate a symbol for true and false in my table, but am having problems with the escaping of quotes and also with generating the < > tags. If I use the code below: {{ task.done|yesno:"," }} it ends up generating this: < ends up being <, > ends up being > and m

Re: trouble with yesno to generate images

2009-01-26 Thread Malinka Rellikwodahs
This is just a quick guess without really knowing anything about the yesno filter, but I would try single quotes inside the html in your yesno filter eg On Mon, Jan 26, 2009 at 16:39, Margie wrote: > > Hi, > > I am trying to generate a symbol for true and false in my table, but > am having pro

Re: question about connection.cursor() and transactions

2009-01-26 Thread bob84123
Just thought I'd re-ask this question as it seems to have slipped through the cracks and I'm still very interested in the answer. Thanks. On Jan 16, 1:57 pm, bob84123 wrote: > I have an app that uses a few custom SQL calls through > connection.cursor() > as described > inhttp://docs.djangoproje

Re: trouble with yesno to generate images

2009-01-26 Thread Almost George
On Jan 26, 3:39 pm, Margie wrote: > Hi, > > I am trying to generate a symbol for true and false in my table, but > am having problems with the escaping of quotes and also with > generating the < > tags.  If I use the code below: >        {{ task.done|yesno:" \" />," }} > > it ends up generating

How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
Hi, I've made a total mess of python (I installed python2.6 from source, installed python 2.6 from an installer (http://jaredforsyth.com/ content/install-python-26-ubuntu)). The source version installed into /usr/local/, and the installer version installed into /usr/. After installing python fr

Re: trouble with yesno to generate images

2009-01-26 Thread Almost George
On Jan 26, 3:58 pm, Almost George wrote: > On Jan 26, 3:39 pm, Margie wrote: > > > > > Hi, > > > I am trying to generate a symbol for true and false in my table, but > > am having problems with the escaping of quotes and also with > > generating the < > tags.  If I use the code below: > >    

Sorting by the human readable options in field provided with choices

2009-01-26 Thread Jeromie
I have a model with a status field that includes a choices argument to provide human readable options. Because the options were changing during development, the values stored in the database are rather generic - S01, S02, etc. There is one view in my application that provides a list of all the obj

template: writing "\u20ac 20.000" fails

2009-01-26 Thread SanPy
For my website, I need to write this in one of my generated html's (dynamically, of course): var prices=[[0, '\u20ac 0'],[100, '\u20ac 100'],[150, '\u20ac 150'], [200, '\u20ac 200'],[250, '\u20ac 250'],[300, '\u20ac 300']]; BTW, \u20ac represents the € symbol. Whatever I try, I can't write '\

Re: Performance using session, passing data from one request to another, use js or not? Best practice?

2009-01-26 Thread Tim Daniel
Thanks for making this clear! But do you think/know that this is the best way to do it? I haven't done it these way until now because in most cases it causes large and ugly urls(I only had to show the page number). Is the way I'm doing it till now a maybe ineficiente and thus not recommended way?

Re: trouble with yesno to generate images

2009-01-26 Thread Margie
Thanks very much, autoescape did the trick, here is the result for anyone interested: {% autoescape off %} {{ task.done|yesno:"," }} {% endautoescape %} Margie --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: XML Serialization Speed

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 12:35 AM, Taylor wrote: > > Okay, that makes sense. Thanks for the link to Python timing! > > Can anyone familiar with the internals of django's serialization and > templating offer any suggestions? My suggestion is this: Try it. I can't say I've ever done a comparative

Re: Querying intermediate model in ManyToMany

2009-01-26 Thread Alex Rades
Thanks a lot Rajes, now I understand the situation better On Fri, Jan 23, 2009 at 7:05 PM, Rajesh Dhawan wrote: > >> >> class Tag(models.Model): >> name = models.CharField(max_length=100) >> related = models.ManyToManyField('self', symmetrical=False, >> through='TagCorrelation', blank=

Extending User model

2009-01-26 Thread Alex Rades
Hi, I need to have two sets of users in my application: One is the Person and the other is the Company. So, I have to decide between going with the userprofile way or inheriting from User. The problem with userprofile is that i can only register One class with AUTH_PROFILE_MODULE The problem with

Re: XML Serialization Speed

2009-01-26 Thread Taylor
Russ, great comments. Yes, I'm speaking execution time, and I have a feeling you're right. Premature optimization happens to be a problem of mine (One that my girlfriend wishes I could correct... oh, wait,nevermind). I think this was just one of those sanity-check questions, sending out a feele

Re: changing form field rendering dependent on field type

2009-01-26 Thread Matt South
Thanks for the suggestion Mark. But I dont see how overriding render for the Select widget would help. If I took that route, I'd be changing the accepted meaning of that method which means I'd also have to do it for all other Widgets, even those that I didnt know about. Or perhaps I misunderstan

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
Ok, well I reinstalled ubuntu. It'd still be good to know how to change python versions easily, if anybody knows how to do this - it seems like it's not documented anywhere :( --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: How to change python version in ubuntu???

2009-01-26 Thread shaleh
On Mon Jan 26 16:28 , DragonSlayre sent: > >Ok, well I reinstalled ubuntu. > >It'd still be good to know how to change python versions easily, if >anybody knows how to do this - it seems like it's not documented >anywhere :( Does this help? Found via google and ubuntu forums. https://launchpad

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
On Jan 27, 1:41 pm, wrote: > Does this help? Found via google and ubuntu > forums.https://launchpad.net/~doko/+archive > > Sorry, I run Debian (which ubuntu is based on), I just apt-get install all of > the > available python versions and then run /usr/bin/python to test > things. The prob

Re: How to change python version in ubuntu???

2009-01-26 Thread Steve Holden
DragonSlayre wrote: > > On Jan 27, 1:41 pm, wrote: > > >> Does this help? Found via google and ubuntu >> forums.https://launchpad.net/~doko/+archive >> >> Sorry, I run Debian (which ubuntu is based on), I just apt-get install all >> of the >> available python versions and then run /usr/bin/p

Re: Related Field has invalid lookup error

2009-01-26 Thread Malcolm Tredinnick
Hey Derek, On Sat, 2009-01-24 at 04:58 -0800, dwil...@gmail.com wrote: > Ramiro, > > Thanks very much - I knew I must have been overlooking something. > Adding __exact did the trick nicely. If you want to open a ticket about that, it might be worth us taking another look at the error reporting.

Re: Getting Logged in User with Test Client

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 12:14 -0500, Vitaly Babiy wrote: > Yes either way would work I was just wondering if there was a more > cleaner way of doing so. Then you're going to have to define what "cleaner" means from your persepctive. What could be cleaner that simply get()-ing the right model based

Re: Last-Modified headers and render_to_response

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 18:24 +0100, Viktor Nagy wrote: > Hi, > > I would like to provide proper Last-Modified headers, but in general > my code uses the render_to_response shortcut. As far as I understand > the code, even though I can add a **kwargs argument to > render_to_response, it won't get

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
On Jan 27, 3:15 pm, Steve Holden wrote: > DragonSlayre wrote: > That's most easily done by controlling your PATH so the the version you > want to prefer is found first when python is called for. > > regards >  Steve How do you do this? --~--~-~--~~~---~--~~ You

Re: Multiple static media roots?

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 10:09 -0800, John Baker wrote: > OK thanks and yes it does but that's half the story. I haven't made > myself very clear. The ImageField still tries to append /media/ to the > image upload_to path rather than /uploads/ which would retrieve them > from the dynamic media root r

Re: How to change python version in ubuntu???

2009-01-26 Thread DragonSlayre
RE Steve - I tried earlier to change the PYTHONHOME variable (seen in the man pages - http://linux.die.net/man/1/python), the python path urls changed, but they were a bit screwed up. The way I changed it was by editing the .bashrc (hidden) file in my home directory. I think I wrote something li

Re: Formset for user-specific data

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 21:08 +0200, Roman Odaisky wrote: > Greetings, > > In a Web app, users can create categories for their data. Categories are > stored in a model as (PK, user, name, description). I want users to be able > to edit categories that belong to them using a formset. To display a

GROUP BY

2009-01-26 Thread Glenn Maynard
How are aggregates grouped on anything other than a simple column? db/sql/query.py set_group_by suggests that this might work, to (for example) group together dollar amounts: Table.objects.extra(select={"dollars": "cents/100"}).values ("dollars").aggregate(...) That doesn't throw an error (it d

Re: InternalError and transactions

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 11:56 -0800, Rob Hudson wrote: [...] > Based on what you describe above, it sounds preferable to let Django > handle the unique_together on is_valid(), but I don't think I can do > that since I need to attach the user to the form later since I don't > know it until the reque

Re: Use _meta.fields to return the datatype

2009-01-26 Thread Malcolm Tredinnick
On Fri, 2009-01-23 at 21:48 -0800, dj wrote: > It would appear there is method called get_internal_type() that maybe > what I am looking for. > The method is in django.db.models.Field. But I am unable to find > anything that would tell > me how to use the function to return the data type for a fie

Re: Queryset unexpectedly turning into list

2009-01-26 Thread Malcolm Tredinnick
On Sat, 2009-01-24 at 19:57 -0800, mb0...@googlemail.com wrote: > Ah, ok thanks for the explanation :) Alex's explanation is correct (as his explanations tend to be). I just wanted to add some extra thoughts to that... "Normally" (which might well mean "hopefully") it shouldn't matter whether yo

Re: How to change python version in ubuntu???

2009-01-26 Thread Steve Holden
DragonSlayre wrote: > > On Jan 27, 3:15 pm, Steve Holden wrote: > >> DragonSlayre wrote: >> That's most easily done by controlling your PATH so the the version you >> want to prefer is found first when python is called for. >> >> regards >> Steve >> > > How do you do this? > http://ww

Re: GROUP BY

2009-01-26 Thread Russell Keith-Magee
On Tue, Jan 27, 2009 at 10:55 AM, Glenn Maynard wrote: > > How are aggregates grouped on anything other than a simple column? I'm a little bit confused as to what you think is happening here - what do you mean by "other than a simple column"? The default aggregate grouping is effectively by obje

Embed HTML snippets through django

2009-01-26 Thread DrKayBee
Hi, I am creating a small website, where I would like to provide users with a database field (through admin) where they can enter a link to their public google calendar (This is an tag). Obviously, if I just write it to a django template like so: {{ user.CalendarLink }} - it just puts the verbat

Re: Target anchor on div's id (/account/#divid ) + Redirection after a POST = ascii encode problem

2009-01-26 Thread Malcolm Tredinnick
On Mon, 2009-01-26 at 00:10 -0800, Seth Kaïne wrote: > Here's my problem. I want to redirect my urls by the name of its > model, like this: > urls.py: > > > (r'^(?P\w+)/$', 'urlCatcher'), > (r'^(?P\w+)/(?P\w+)/$', 'urlCatcher'), > (r'^(?P\w+)/(?P\w+)/(?P\w+)/$', > 'ur

Re: Target anchor on div's id (/account/#divid ) + Redirection after a POST = ascii encode problem

2009-01-26 Thread Malcolm Tredinnick
On Mon, 2009-01-26 at 07:13 -0500, Steve Holden wrote: [...] > Quick unrelated nit: you don't actually need to create a dict here, as > dict.update takes keyword arguments. So you can just say > > locals_dict.update(model=model, action=action) Providing you're using Python 2.4 or later. W

  1   2   >