Re: View calling another view causing authentication issues

2008-09-03 Thread Joshua Jonah
Refactoring this as a form wizard would be the right way to deal with it, but that might be a large undertaking. Calling another view should not log you out unless it's explicitly deauthing. You need to figure out at which state it's trashing the session. can you dpaste some code for us?

Re: what's wrong with my django comments?

2008-09-03 Thread nonight
no, the comments system is new ,not upgrading from the old style. On 9月4日, 上午10时18分, Joshua Jonah <[EMAIL PROTECTED]> wrote: > Did you upgrade the comments system from the old style? > > looks like a reverse issue. > > nonightwrote: > > I have add (r'^comments/',

View calling another view causing authentication issues

2008-09-03 Thread makebelieve
Hello, I've got a view that serves as a hub so that a multi-page form has only one url. So when the user goes to the URL it sends them to the first page of the form, the first page sends back to the hub, which sends them to the second page and so forth. This worked great until I required the

Re: how can i find the mail i have send in this group?

2008-09-03 Thread nonight
Oh, thx! On 9月4日, 上午10时13分, Joshua Jonah <[EMAIL PROTECTED]> wrote: > Search for your name in the google group search. > > nonight wrote: > > how can i find the mail i have send in this group? --~--~-~--~~~---~--~~ You received this message because you are

Re: 'maxlength problem'

2008-09-03 Thread Raffaele Salmaso
zissan wrote: > title = models.CharField(maxlength=200) now is max_length > Is there something has been chaged sine 0.96? a lot see http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges for a full list -- ()_() | That said, I didn't actually _test_ my patch. | + (o.o) |

Re: 'maxlength problem'

2008-09-03 Thread Ben Firshman
It has been renamed to "max_length". See this page for more information: http://docs.djangoproject.com/en/dev/releases/1.0-porting-guide/ Ben On 4 Sep 2008, at 05:41, zissan wrote: > > Hi all: > I am a newbie to web development and django. > First, I would like to celebrate the release of

'maxlength problem'

2008-09-03 Thread zissan
Hi all: I am a newbie to web development and django. First, I would like to celebrate the release of Django 1.0 and thanks everyone make this became reality. I am learning django by using the book " Learning Web Development with Django" publised by Packt Publishing. The books is based on django

Re: 'Django in Under a Minute' screencast, requesting feedback before v1-final is ready

2008-09-03 Thread Rodolfo
Man, nice video! Go for it with 1.0 final! And, btw, never thought I'd see Google Chrome in a video not related to it :P []'s Rodolfo On Sep 3, 6:07 pm, "Ian Ozsvald" <[EMAIL PROTECTED]> wrote: > I've created a 57 second screencast showing 'Django in Under a Minute'.  I > recorded it over

Re: ANNOUNCE: Django 1.0 released

2008-09-03 Thread Rodolfo
Yeah! Great news Wish I could join ya' ll at DjangoCon. So, since I`m in Brazil, can't wait to attend PyCon Brasil late this month. Django is one of the highlights! []'s Rodolfo On Sep 3, 9:07 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > The Django team is pleased to announce the

Re: Setting up Django in apache

2008-09-03 Thread James Bennett
On Wed, Sep 3, 2008 at 10:28 PM, Pepsi330ml <[EMAIL PROTECTED]> wrote: > Thus i cannot use the PythonOption django.root > Is there other alternative? Well, what you can generally do to work around this if you have an older Django is to create a new file, say, root_urls.py in your project, and

Re: Everything is working but modpython

2008-09-03 Thread Graham Dumpleton
Run command line 'python' you used to install Django and then go: $ python Python 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.__file__

Re: Setting up Django in apache

2008-09-03 Thread Graham Dumpleton
On Sep 4, 1:28 pm, Pepsi330ml <[EMAIL PROTECTED]> wrote: > Hi > > Forget to add on. I am using Django version 0.96. > Don't intend to upgrade to version 1.0 now. > > Thus i cannot use the PythonOption django.root > Is there other alternative? >From memory the answer is 'No'. Graham

Re: "Unknown column 'product_product.site_id' in 'where clause'"

2008-09-03 Thread Joshua Jonah
syncdb... and try Satchmo-users, better chance for help there Daehee wrote: > After updating the most recent version of satchmo trunk with django > trunk, I get the following error: > > OperationalError at / > (1054, "Unknown column 'product_product.site_id' in 'where clause'") > > Any ideas? >

"Unknown column 'product_product.site_id' in 'where clause'"

2008-09-03 Thread Daehee
After updating the most recent version of satchmo trunk with django trunk, I get the following error: OperationalError at / (1054, "Unknown column 'product_product.site_id' in 'where clause'") Any ideas? Thanks, Daehee --~--~-~--~~~---~--~~ You received this

Re: Setting up Django in apache

2008-09-03 Thread Pepsi330ml
Hi Forget to add on. I am using Django version 0.96. Don't intend to upgrade to version 1.0 now. Thus i cannot use the PythonOption django.root Is there other alternative? Thank you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Setting up Django in apache

2008-09-03 Thread Pepsi330ml
Hi, Initially, my setting in apache is ... The web request http://www.mydjango.com will be handle by my django page. Now, i want to change the web request to http://www.mydjango.com/pepsi, to be handled by my django page. I do not want to change the urls.py in my django project. This do

How to display Html in my screen

2008-09-03 Thread bin
Hi I'm a django beginner. I got confused, when i write html scripts in my admin testfield like hello and save them in mysql, but when i wanna display them in screen, they can not display as bold font as i want, the source file writes: h1hello/h1 What can i do to make it right?

Re: what's wrong with my django comments?

2008-09-03 Thread Joshua Jonah
Did you upgrade the comments system from the old style? looks like a reverse issue. nonight wrote: > I have add (r'^comments/', include('django.contrib.comments.urls')) in > the urls.py > > the codes in the template: > {% load comments %} > {% render_comment_form for user %} > > the error was :

attach existing file to models.FileField

2008-09-03 Thread akonsu
hello, i need to attach an existing file stored in the right location to a FileField of my model. can this be done without copying the file? thanks konstantin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: how can i find the mail i have send in this group?

2008-09-03 Thread Joshua Jonah
Search for your name in the google group search. nonight wrote: > how can i find the mail i have send in this group? > > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Everything is working but modpython

2008-09-03 Thread Joshua Jonah
Likely it's an issue with the instance of python that mod_python is complied to, do you have more than one version of python? Joshua Jonah wrote: > That error looks like you cant import django. weird. > > jpittet wrote: > >> I have everything running except mod_python on apache. >> >> I can

Re: Everything is working but modpython

2008-09-03 Thread Joshua Jonah
That error looks like you cant import django. weird. jpittet wrote: > I have everything running except mod_python on apache. > > I can import django in the Python interpreter. I can even run python > manage.py runserver but as soon as I put it in apache, it gives me > grief. This is a > Centos

Re: what's wrong with my django comments?

2008-09-03 Thread nonight
Yes, i have removed the pyc files from the the comments directory, but there is nothing diffrence. On 9月3日, 下午11时55分, Thejaswi Puthraya <[EMAIL PROTECTED]> wrote: > On Sep 3, 8:14 pm, nonight <[EMAIL PROTECTED]> wrote: > > > I have add (r'^comments/', include('django.contrib.comments.urls')) in

Everything is working but modpython

2008-09-03 Thread jpittet
I have everything running except mod_python on apache. I can import django in the Python interpreter. I can even run python manage.py runserver but as soon as I put it in apache, it gives me grief. This is a Centos 5 Python 2.4 Apache 2.2 mod_python.i386 3.2.8-3.1 Django SVN at 1.0 rc_1 Here

newbie

2008-09-03 Thread just_learnin
Hi All, Just trying out django, came across this example of creating a simple todo-list. I have django 1.0 (beta_1) and python 2.5 setup on Vista with MySql 5. I setup the models fine, did a syncdb. When I check the admin part (127.0.0.1:8000/admin), I get the message : Site Administration You

how can i find the mail i have send in this group?

2008-09-03 Thread nonight
how can i find the mail i have send in this group? --~--~-~--~~~---~--~~ 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 this

Re: ANNOUNCE: Django 1.0 released

2008-09-03 Thread Joshua Jonah
Thank you all, you have done alot of work for me. It's criminal that something like this is free. Dev and Production already updated ;) James Bennett wrote: > The Django team is pleased to announce the release of Django 1.0 this evening: > > Download: http://www.djangoproject.com/download/ >

Re: django web hosting

2008-09-03 Thread Shantp
I was a beginner to linux and django and SliceHost has been awesome for getting myself going and learning. http://www.slicehost.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: ProgrammingError at /admin/, date/time field value out of range

2008-09-03 Thread Benedict Verheyen
Chubby schreef: > > > I forgot to mention the following. When i execute the sql statement > from above directly > on the database, it works. No error what so ever. > So the db configuration would appear to be correct. > > What could be causing this error ? > > Thanks, > Benedict When i use

Re: ANNOUNCE: Django 1.0 released

2008-09-03 Thread Benedict Verheyen
James Bennett schreef: > The Django team is pleased to announce the release of Django 1.0 this evening: > > Download: http://www.djangoproject.com/download/ > Release notes: http://docs.djangoproject.com/en/dev/releases/1.0/ > > Have fun with it, and we'll see you in a few days for DjangoCon. >

Re: ANNOUNCE: Django 1.0 released

2008-09-03 Thread Henhiskan
Thanks very much to all people involved on this great project, congratulations to everyone -- Richard Rossel Valparaiso - Chile --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: ANNOUNCE: Django 1.0 released

2008-09-03 Thread Ross Poulton
Congratulations to all involved! Thank you very much, now make sure you enjoy the Launch party at DjangoCon :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

ANNOUNCE: Django 1.0 released

2008-09-03 Thread James Bennett
The Django team is pleased to announce the release of Django 1.0 this evening: Download: http://www.djangoproject.com/download/ Release notes: http://docs.djangoproject.com/en/dev/releases/1.0/ Have fun with it, and we'll see you in a few days for DjangoCon. -- "Bureaucrat Conrad, you are

Re: Custom manager for many-to-many traversal

2008-09-03 Thread MrJogo
H'ok, got this working. First off, I had a brain hiccup: my model was one-to-many (the actual model is more complicated than my Book example; I just used the Book to illustrate my point). What I ended up doing was basically what you suggested to do using Django's ORM: I ran two queries, one for

Re: How to display Html in my screen

2008-09-03 Thread krylatij
Use filter "safe" in your template: {{ mymodel.page|safe }} --~--~-~--~~~---~--~~ 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

Re: Form Wizard

2008-09-03 Thread lingrlongr
Maybe I'm experiencing this? http://code.djangoproject.com/ticket/8808 I don't even understand what that ticket is about. And I'm not using parse_params or get_template... On Sep 3, 4:06 pm, lingrlongr <[EMAIL PROTECTED]> wrote: > I'm desperate here.  I'm having serious problems with the

Re: settings.TIME_ZONE

2008-09-03 Thread lingrlongr
It turns out its my stupid host that's not handling the dates properly. I wrote a Python script and tested: #! /usr/bin/env python import os import datetime def do_test(tz): if tz != '': os.environ['TZ'] = tz print '%20s: %s' % (tz, datetime.datetime.today()) [do_test(tz) for tz

Re: URLs Syntax Error

2008-09-03 Thread djandrow
I'm a bit confused here, what is dict, is it the same as archive infor? And what has happened to date_based.archive_index? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: inlineformset_factory ValidationError

2008-09-03 Thread Aaron
Thanks to justinf on #django for pointing out that I need to pass in request.FILES in my formset. If you're working with file fields (and image fields), the parameter is essential. Below is my current working view for future references.

Re: Using ManytoManyField's in signals

2008-09-03 Thread Rajesh Dhawan
> > for s in site: >     ti.site.add(s) > > almost worked.  I got an error that the ManyRelatedManager wasn't > iterable.  So I did a little research and found that > > for s in site.all(): >     ti.site.add(s) > > that works because the query set that it builds is iterable. Yes. Sorry, I

Re: Random HTTP Error 500's - ImproperlyConfigured

2008-09-03 Thread cwurld
I doubt that would be the cause, given that the module it cannot load changes from crash to crash. I was wondering if it could be some sort of timing issue. Maybe the server times out while looking for the file. Or maybe the file is temporarily locked? I am grasping at straws here...

Re: Field type for 13 digit positive integer?

2008-09-03 Thread Ross Dakin
I don't know about lookup speeds, but I believe the storage requirement would be smaller if you go with a numeric data type over characters: To represent all 13-digit unsigned integers, you need 47 bits (2^47 = 1.4 * 10^14). To represent a 13-character string (that may be composed of digits),

Re: How to access underscore starting attributes in templates

2008-09-03 Thread bruno desthuilliers
On 3 sep, 23:39, Fabio Natali <[EMAIL PROTECTED]> wrote: (snip) > I added a couple of methods to my models, so to access to the > underscore methods/attributes but with different names. I get an error > though. > > TemplateSyntaxError at / > Caught an exception while rendering: unbound method

Re: django web hosting

2008-09-03 Thread mccomas . chris
I had the beta container for Django and to me, compared to say WebFaction, it was a pain in the ass, it just didn't feel "natural" using the Django container. I am, later this month, moving away from WebFaction and getting a dedicated virtual at MediaTemple tho... On Sep 3, 5:06 am, "Mic

Re: How to access underscore starting attributes in templates

2008-09-03 Thread Fabio Natali
Dear Rajesh, thanks for your precious help. Rajesh Dhawan scrisse: [...] > > I need to pass a model to my template and then access its > > attributes. Some of them start with an underscore, which turns out to > > be a problem for the template mechanism. > Alternatively, create a method/property

'Django in Under a Minute' screencast, requesting feedback before v1-final is ready

2008-09-03 Thread Ian Ozsvald
I've created a 57 second screencast showing 'Django in Under a Minute'. I recorded it over the last two days using the current Django release candidate, I'll update the visuals once v1-final is ready and then release a final copy:

Re: Using ManytoManyField's in signals

2008-09-03 Thread nek4life
On Sep 3, 4:08 pm, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > On Sep 3, 3:59 pm, nek4life <[EMAIL PROTECTED]> wrote: > > > I'm using Django Beta 2 > > If, instead of top-posting, you bottom-post your responses, it's > easier for people to see which questions you're responding to. > > > > > > >

Re: django and sql databases

2008-09-03 Thread Ned Batchelder
Django won't deal well with dynamically-generated tables, as it maps classes to tables, so you'd need dynamically-generated classes, and then code that could use those classes. This is the way all ORMs work. You haven't described these tables, or how (or even why) they are being generated.

Re: How am I supposed to debug a url template tag?

2008-09-03 Thread Malcolm Tredinnick
On Wed, 2008-09-03 at 14:07 -0700, catsclaw wrote: > On Sep 3, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]> > wrote: > > Sorry, my crystal ball is down for maintainance - but the answer is > > probably that the django.core.urlresolvers.reverse function didn't > > found a match. The easiest

Re: Field type for 13 digit positive integer?

2008-09-03 Thread Ross Dakin
BIGINT will store 64 bits. The (13) display value has no baring on the data stored, but only how it is displayed. http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html On Wed, Sep 3, 2008 at 2:05 PM, julianb <[EMAIL PROTECTED]> wrote: > > On Sep 2, 10:00 pm, coan <[EMAIL PROTECTED]> wrote:

Re: Field type for 13 digit positive integer?

2008-09-03 Thread julianb
On Sep 2, 10:00 pm, coan <[EMAIL PROTECTED]> wrote: > For now I was planning to store ISBN13 and 13 digit ean codes. > > In mysql a bigint field would hold these, but I see no corresponing > fieldtypes in django for bigints - > the positiveintegerfield sets itself up as an int(10) signed field >

Re: How am I supposed to debug a url template tag?

2008-09-03 Thread catsclaw
On Sep 3, 3:48 pm, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > Sorry, my crystal ball is down for maintainance - but the answer is > probably that  the django.core.urlresolvers.reverse function didn't > found a match. The easiest way to check this out would be to test a > direct call to the

Re: django web hosting

2008-09-03 Thread James Matthews
I am using Dreamhost and it's works (It's a little bit of pain to install but they officially are going to support it soon) On Wed, Sep 3, 2008 at 5:18 AM, <[EMAIL PROTECTED]> wrote: > > I had the beta container for Django and to me, compared to say > WebFaction, it was a pain in the ass, it

XS XML to Django model

2008-09-03 Thread Bram Enning
Hi, I was wondering if there was a automagical way to convert a XML-XS file to a Django-model file. And congrats with the beta of course! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: django and sql databases

2008-09-03 Thread bruno desthuilliers
On 3 sep, 18:13, David <[EMAIL PROTECTED]> wrote: (snip) > actually, this leads to another question - can one have > similar procedures to cron job's working with django? such as regular > maintenance or in my case creation of tables due to an external > factor. Write python scripts and call

Re: How to encode the url ??

2008-09-03 Thread Malcolm Tredinnick
On Wed, 2008-09-03 at 13:00 +0200, Grzegorz Szymański wrote: > On Wednesday 03 of September 2008 09:19:37 babatu wrote: > > How to encode the url ??make the non-English looks like %CD%E2%C6%C5%BC > > %D2 > > http://docs.python.org/lib/module-urllib.html > quote, unquote Neither of which work

Re: How am I supposed to debug a url template tag?

2008-09-03 Thread bruno desthuilliers
On 3 sep, 20:22, catsclaw <[EMAIL PROTECTED]> wrote: > Hi all -- > >I've got the following code in a template: > > {% for entry in my_entries %} > (url) MY_NAME,SVN_DIR: {% url mielot.views.list my_name,my_dir %} > (url) MY_NAME,ENTRY.PATH: {% url myapp.views.list my_name,entry.path > %} >

Re: django web hosting

2008-09-03 Thread Abdallah El Guindy
Google app engine provides free hosting, with Django support Link: http://appengine.google.com/ The only problem is that I haven't managed to make the db classes run, the google API provides some other mechanism.. If you can migrate to that then almost everything else will run. You can also

ANN: dmigrations, a new migrations system for Django

2008-09-03 Thread Simon Willison
dmigrations is a new tool for managing changes to a Django database, developed internally at Global Radio and designed to work well with a medium-large (14 member) team of developers. We've been using it in production for a few months, and were recently given the go-ahead to open source it. I've

OT: Google Chrome

2008-09-03 Thread James Matthews
HI List, Today Google released chrome. I have been playing around with it a little today. Besides for seeing some funny things (try https://www.gmail.comThanks reddit) It seems to be a very nice browser. I would like to see where it's path is going to go. What are your thoughts? James --

Re: ManyToMany performance..

2008-09-03 Thread krylatij
I still think you need second query. as i understand from your code get_main_section will return list of Sections in Story? I mean this string: (section_name = self.id_section.all().order_by('order') ) bad: if (len(self.id_section.all()) > 1):#hits DB section_name =

Re: Using ManytoManyField's in signals

2008-09-03 Thread Rajesh Dhawan
On Sep 3, 3:59 pm, nek4life <[EMAIL PROTECTED]> wrote: > I'm using Django Beta 2 If, instead of top-posting, you bottom-post your responses, it's easier for people to see which questions you're responding to. > > Here is my article model > > from django.db import models > from

Form Wizard

2008-09-03 Thread lingrlongr
I'm desperate here. I'm having serious problems with the form wizard. In url.py I have: url(r'refinance/$', RefinanceWizard([RefinanceForm_1, RefinanceForm_2, DummyForm, DummyForm]), name='refinance'), So you can see that I have 4 steps. The purpose of the DummyForm is just a place

Re: Accessing meta class info from my views.py

2008-09-03 Thread Matthias Kestenholz
On Wed, Sep 3, 2008 at 3:32 PM, krylatij <[EMAIL PROTECTED]> wrote: > > try this: >>>get_models(arteak.management.models)[0]._meta.verbose_name_plural() > This won't work since the __proxy__ object does not have a call method. The __proxy__ object gets evaluated to a string when you try to

Re: Using ManytoManyField's in signals

2008-09-03 Thread nek4life
I'm using Django Beta 2 This is my post data bodyu'body' status u'2' allow_comments u'on' _save u'Save' leadu'lead' author u'1' title u'Test Post' siteu'2' publish_1 u'15:04:22' publish_0 u'2008-09-03'

Re: Random ordering in Templates

2008-09-03 Thread Ludwig
Am I right that you have a one-to-many relationship between events and questions, with questions having a foreign key to events? Then you could add a method to your Event model class that returns you a random list of questions: class Event (model.Models): ... def questions(self):

Re: how to use "if element in List" from a template?

2008-09-03 Thread TiNo
{% load my_utils %} should work On Wed, Sep 3, 2008 at 11:46 AM, joune <[EMAIL PROTECTED]> wrote: > > Thanks Daniel.. > > Sorry i'm a bit slow (i do this in my spare time) > > I tried what you said, and refered to the doc at > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/ for

Re: Practical Django Projects - Ch3 Wrong name displayed in Admin

2008-09-03 Thread coolis_willis
Much appreciated! On Sep 2, 5:38 am, "Bülent Aldemir" <[EMAIL PROTECTED]> wrote: > There seems to be __str__, __unicode__ methods in the Category model > missing. > > > > 2008/9/2 coolis_willis <[EMAIL PROTECTED]> > > > > > Hi, > > > With

Re: Linked-models

2008-09-03 Thread Rajesh Dhawan
Hi Andy, > I'm just starting out with Django, so please bear with me. > > I've got a suppliers database, with a unique REF for each supplier. > I've also got a contracts database, also with a unique contract > number. > > There's another model, which I state below.. the first two fields are > to

Re: django web hosting

2008-09-03 Thread Ed Wong
Thanks all for your advice. You have given me great info. I too have heard good things about webfaction. I will research more into them. Thanks again! :) On Sep 3, 11:57 am, "Abdallah El Guindy" <[EMAIL PROTECTED]> wrote: > Google app engine provides free hosting, with Django support > >

Re: handling database restarts

2008-09-03 Thread Rajesh Dhawan
Hi Mike, > > Now, I took a guess that if I closed the db connection, the framework > would open a new one, so I added this to each processing loop. > > from django.db import connection > > connection.close() > > and this seems to work. No more exceptions when the db is restarted. > > Now, I

Re: Random ordering in Templates

2008-09-03 Thread Cortland Klein
That looks like that should work! Thank you; I'll try this out when I get back from lunch. Sent from my iPhone On Sep 3, 2008, at 12:23 PM, Ludwig <[EMAIL PROTECTED]> wrote: > Am I right that you have a one-to-many relationship between events > and questions, with questions having a foreign

Re: Using ManytoManyField's in signals

2008-09-03 Thread Rajesh Dhawan
> Seems like I'm headed in the right direction, I made the changes you > suggested but now I'm getting a warning. > > > Exception Type: Warning at /admin/posts/article/add/ > Exception Value: Incorrect integer value: > ' 0xfd8d50>' for column 'site_id' at row 1 > > Not sure what's going on...

Re: How to access underscore starting attributes in templates

2008-09-03 Thread Rajesh Dhawan
Hi Fabio, > I need to pass a model to my template and then access its > attributes. Some of them start with an underscore, which turns out to > be a problem for the template mechanism. > > I think there are two major roads to solve this: > > - write new template tags > - add a new method to each

Re: Using ManytoManyField's in signals

2008-09-03 Thread Rajesh Dhawan
Hi, > from django.db import models > from django.contrib.contenttypes import generic > from django.template.loader import render_to_string > from django.db.models import signals > from django.contrib.contenttypes.models import ContentType > from django.dispatch import dispatcher > from

Re: Random ordering in Templates

2008-09-03 Thread Cortland Klein
Yes, but I don't want to randomize he Events, but the Questions that belong to the events. On Sep 3, 2008, at 12:07 PM, Ludwig wrote: > There is nothing to stop you putting the order_by clause into a > generic view, like so: > > event_info = { > 'queryset' :

Re: Random ordering in Templates

2008-09-03 Thread Ludwig
> > > Can I do that with a Generic View? > There is nothing to stop you putting the order_by clause into a generic view, like so: event_info = { 'queryset' : Events.objects.order_by('?'), } > > I'm using date_based.archive_index on an Event model which has many > Questions. > > On Sep 3,

Re: Using ManytoManyField's in signals

2008-09-03 Thread nek4life
Thanks Rajesh, Seems like I'm headed in the right direction, I made the changes you suggested but now I'm getting a warning. Environment: Request Method: POST Request URL: http://localhost:8000/admin/posts/article/add/ Django Version: 1.0-beta_2-SVN-unknown Python Version: 2.5.2 Installed

Re: geodjango join problem

2008-09-03 Thread robstar
I forgot to paste it, but I did include objects = models.GeoManager() in my class. I also tried making a different object like geo_objects = models.GeoManager() and ran that from the shell to make sure I was invoking the right manager. I still get that same traceback ... any ideas?? On Sep

Re: Random ordering in Templates

2008-09-03 Thread Cortland Klein
Can I do that with a Generic View? I'm using date_based.archive_index on an Event model which has many Questions. On Sep 3, 2008, at 11:40 AM, Karen Tracey wrote: > Why not just create the randomized list in the view and pass the > already-randomized list into the template? -- Cortland

Using ManytoManyField's in signals

2008-09-03 Thread nek4life
from django.db import models from django.contrib.contenttypes import generic from django.template.loader import render_to_string from django.db.models import signals from django.contrib.contenttypes.models import ContentType from django.dispatch import dispatcher from django.contrib.sites.models

Random ordering in Templates

2008-09-03 Thread Cortland Klein
I've got the following in my template: > {% for question in event.question_set.order_by('?') %} And am getting the error "Could not parse the remainder: '('?')'". I'm trying to randomly iterate through these objects. Should I implement a custom filter, or is there an easier way to accomplish

Re: Random ordering in Templates

2008-09-03 Thread Ludwig
I think you are confusing two things here: querying the DB in views and displaying the output through templates. To get your object in a random order, add the order_by('?') to the view, see (see http://www.djangoproject.com/documentation/models/ordering/) Then you can just iterate through your

Django 1.0 admin with inline model, IntegrityError when delete

2008-09-03 Thread Arnold Chen
I have upgraded to django 1.0 beta or the latest version for my development machine. And faced IntegrityError when i delete a record with few related records. This problem do not happen before django 1.0 A Product model and a Part model, which is a 1-to-many relationship, (a Product can have

Re: Random ordering in Templates

2008-09-03 Thread Karen Tracey
On Wed, Sep 3, 2008 at 2:31 PM, Cortland Klein <[EMAIL PROTECTED]> wrote: > > I've got the following in my template: > > {% for question in event.question_set.order_by('?') %} > > And am getting the error "Could not parse the remainder: '('?')'". > You cannot call functions that take arguments

How am I supposed to debug a url template tag?

2008-09-03 Thread catsclaw
Hi all -- I've got the following code in a template: {% for entry in my_entries %} (url) MY_NAME,SVN_DIR: {% url mielot.views.list my_name,my_dir %} (url) MY_NAME,ENTRY.PATH: {% url myapp.views.list my_name,entry.path %} MY_NAME: {{ my_name }} MY_DIR: {{ my_dir }} ENTRY_PATH: {{ entry.path

Re: forms and dynamic # of form fields

2008-09-03 Thread Malcolm Tredinnick
On Wed, 2008-09-03 at 11:08 -0700, Mike Hansen wrote: > I apologize if this already showed up on the list. I originally posted this > from google groups, and I think it ate it. > > I'm new to Django. As a small Django project, I'm making a internal purchase > request form. One section has

Re: Field type for 13 digit positive integer?

2008-09-03 Thread Larrik Jaerico
I was looking for some extremely large integers as well, so you aren't alone. Though at the moment I can't remember what I needed them for. On Sep 2, 4:00 pm, coan <[EMAIL PROTECTED]> wrote: > For now I was planning to store ISBN13 and 13 digit ean codes. > > In mysql a bigint field would hold

forms and dynamic # of form fields

2008-09-03 Thread Mike Hansen
I apologize if this already showed up on the list. I originally posted this from google groups, and I think it ate it. I'm new to Django. As a small Django project, I'm making a internal purchase request form. One section has user information and another section has a selection of items to

Best solution!

2008-09-03 Thread tragick
Hi, for an ImageField (or more generally for a FileField), what is your cleanest solution to get a dynamic upload_to path with foreign key? I try to use the new callable argument for upload_to, but when the callable runs any foreign key fields of my model are not navigable! Sorry for my english

forms with dynamic number of fields

2008-09-03 Thread projecktzero
Hi, I'm new to Django. As a small project, I'm making a purchase request form with one section that has the user information and the 2nd section has items(computer hardware and software) that the user can request. This list of items in the 2nd section is dynamic in that it reads from a list of

Re: How to show up tiny mce in admin textfield

2008-09-03 Thread lingrlongr
woops try this: js = ( 'tiny_mce/tiny_mce.js', 'textareas.js', ) I believe this automatically references the MEDIA_URL, so you don't have to. On Sep 3, 11:23 am, bin <[EMAIL PROTECTED]> wrote: > I tried, but nothing happened at all. > > On

Re: MySQL timediff and datetime.timedelta

2008-09-03 Thread Jens Grivolla
On Sep 2, 12:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-09-02 at 03:16 -0700, JensGrivollawrote: > > I am getting weird results using django.db to do a "select > > timediff(a,b)..." query from MySQL. The result is a datetime.datetime > > object instead of a

Re: Trivial question about instances forms

2008-09-03 Thread patrickk
you´re obviously using an older django-version. is there a (good) reason for not upgrading? On Sep 3, 4:05 pm, Denis Frère <[EMAIL PROTECTED]> wrote: > On Sep 3, 12:52 pm, "Denis Frère" <[EMAIL PROTECTED]> wrote: > > > Hello, > > > It should be trivial to most of you... > > > When I create an

django-announce not listed in django website's community section

2008-09-03 Thread Andrew D. Ball
I don't find django-announce listed at the Django community page here: http://www.djangoproject.com/community/ Any reason why it's not included beside django-users and django-developers? Peace, Andrew -- === Andrew D. Ball [EMAIL PROTECTED] Software Engineer

Re: How to display Html in my screen

2008-09-03 Thread bin
oh, thank you very mush:) On 9月3日, 下午3时01分, krylatij <[EMAIL PROTECTED]> wrote: > Use filter "safe" in your template: > > {{ mymodel.page|safe }} --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: How to show up tiny mce in admin textfield

2008-09-03 Thread lingrlongr
# settings.py MEDIA_ROOT = '/absolute/path/to/media/directory/' MEDIA_URL = '/app_media/' # urls.py (at the end) import settings if settings.DEBUG: urlpatterns += patterns('', (r'^app_media/(?P.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), ) Given

Re: URLs Syntax Error

2008-09-03 Thread Daniel Hepper
Adding a comma will probably not help, because you then have 5 values in the tuple, but the expected format is: (regular expression, Python callback function [, optional dictionary [, optional name]]) Either you put the argument 'template_name' into the archive_info dict or you make two

Re: django web hosting

2008-09-03 Thread Mic Pringle
I have it on good authority that Media Temple will be launching their Django Container later this week, which is what I'm holding out for. -Mic 2008/9/3 tupixo <[EMAIL PROTECTED]>: > >> i am looking for a good web host for my django website. does anyone >> suggest a good host? thanks. > >

Re: ModelForm, images and exclude

2008-09-03 Thread TiNo
Question, why do you need to create a folder for every pet? Why not throw all pet photos in one folder?That would solve your problem as well. On Wed, Sep 3, 2008 at 2:49 PM, flynnguy <[EMAIL PROTECTED]> wrote: > > I looked at the save_m2m but I don't have any many to many fields so > that

  1   2   >