Come on, share your django powered sites with others.//Fwd: A tornado powered site to show any project powered sites(open source)

2010-08-07 Thread Stone Puzzle
Django powered sites list http://django.poweredsites.org -- Forwarded message -- From: Felinx Lee Date: Tue, Aug 3, 2010 at 2:29 PM Subject: A tornado powered site to show any project powered sites(open source) To: python-torn...@googlegroups.com I am

manually add objects to a QuerySet

2010-08-07 Thread chefsmart
I had asked this on stackoverflow, but I guess I couldn't explain myself clearly enough. I'll try to ask again here: Say I have two objects obj1 and obj2 of the same model (MyModel), now I would like to add these objects to a new QuerySet. Can I create a QuerySet manually like the following

Re: Value Error in Pyfacebook

2010-08-07 Thread Pankaj Singh
problem got solved 1292 if params.get('expires'): 1293 self.session_key_expires = int(params['expires']) I've just changed it to: 1292 if params.get('expires'): 1293 try: 1294 self.session_key_expires = int(params['expires']) 1295

Re: Django on Mac OS X

2010-08-07 Thread Daniel França
More information. here: def create_account(sender, instance=None, **kwargs): if instance is None: return account, created = Account.objects.get_or_create(user=instance) post_save.connect(create_account, sender=User) If I comment the *post_save.connect*, there's no exception =)

Re: how to query foreign keys down more than one level

2010-08-07 Thread Steve Holden
On 8/7/2010 5:04 PM, rmschne wrote: > Thanks to Steve and Daniel. Cool. > > I'm learning as I go about naming fields. Going back and fixing where > possible (but sometimes a lot of work). Agree right to do the first > time; but learning! > And don't expect to get everything right. Nobody ever

Re: Django with AJAX, execution of long processes

2010-08-07 Thread marekw2143
You can spawn another process in system, and save identification data of that process in users's session, and then query django for status of the process. I guess you can also implement long pooling in django to query for status of the process. But generally if talking about long pooling it's

Re: Django with AJAX, execution of long processes

2010-08-07 Thread marekw2143
You can spawn another process in system, and save identification data of that process in users's session, and then query django for status of the process. I guess you can also implement long pooling in django to query for status of the process. But generally if talking about long pooling it's

Re: Value Error in Pyfacebook

2010-08-07 Thread marekw2143
At the end of the stacktrace there's written: ValueError: invalid literal for int() with base 10: 'None' You can debug that code and see what happens. On Aug 7, 10:20 pm, Pankaj Singh wrote: > Hi i m getting this error > >

Re: Value Error in Pyfacebook

2010-08-07 Thread marekw2143
At the end of the stacktrace there's written: ValueError: invalid literal for int() with base 10: 'None' You can debug that code and see what happens. On Aug 7, 10:20 pm, Pankaj Singh wrote: > Hi i m getting this error > >

Re: Loop over a form's choices (radio button) and render it

2010-08-07 Thread Andreas Pfrengle
Thinking about it, instead of the radio button it would be even better if I could select just the whole datarow. But I have no idea how to do it :-? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: how to query foreign keys down more than one level

2010-08-07 Thread rmschne
Thanks to Steve and Daniel. Cool. I'm learning as I go about naming fields. Going back and fixing where possible (but sometimes a lot of work). Agree right to do the first time; but learning! -- You received this message because you are subscribed to the Google Groups "Django users" group.

Loop over a form's choices (radio button) and render it

2010-08-07 Thread Andreas Pfrengle
Hello, what I want to do is to add a radio button into the last column of a data table. The user shall be able to select exactly one of the table's rows. I was thinking about defining a SelectForm with one 'select'-field (ChoiceField) with a RadioSelect-widget. In the template, I would then need

Value Error in Pyfacebook

2010-08-07 Thread Pankaj Singh
Hi i m getting this error *** Traceback (most recent call last): File "/usr/local/alwaysdata/python/ django/1.2.1/django/core/handlers/base.py", line 100, in get_response response = callback(request, *callback_args,

ManyToManyField - how to constrain

2010-08-07 Thread Paul Pepper
Best way to create a many-to-one relationship between django.contrib.auth.models.User and my own Company model (i.e. many users in one company)? Unless I was inclined to add a ManyToOneField to the User model (which I'm not), then is a ManyToManyField in my Company model the best way of dealing

Optimisation problem in Django's admin interface

2010-08-07 Thread d9pouces
Dear all, I am facing an important optimisation problem due to the Django's admin interface. Here is the structure of my models, which are not very complicated nor exotic: models.py class A: [some fields] class B: [some fields] class C: [some fields] class A_B: a = ForeignKey(A) b =

Django with AJAX, execution of long processes

2010-08-07 Thread Rohan Jain
Hi! I have a problem with django and ajax. I am giving requests from ajax which run a process that takes some time and has many stages. Is there any way to return the various stages as responses, so the user does not have to see only the loading image but can also the current status of the

Re: Django on Mac OS X

2010-08-07 Thread Daniel França
Xavier, I think we are almost there :P because there's a timezone field in my account model: class Account(models.Model): user = models.ForeignKey(User, unique=True, verbose_name=_('user')) timezone = TimeZoneField(_('timezone')) language = models.CharField(_('language'),

Re: how to query foreign keys down more than one level

2010-08-07 Thread Steve Holden
On 8/7/2010 3:03 PM, Daniel Roseman wrote: > On Aug 7, 7:47 pm, rmschne wrote: >> I have a model like that I would like query down more than one level >> (using my nomenclature). >> >> class Library(models.Model) >> branch=models.CharField(max_length=100) >> >> class

Re: how to query foreign keys down more than one level

2010-08-07 Thread Daniel Roseman
On Aug 7, 7:47 pm, rmschne wrote: > I have a model like that I would like query down more than one level > (using my nomenclature). > > class Library(models.Model) >   branch=models.CharField(max_length=100) > > class Book(models.Model) >  

how to query foreign keys down more than one level

2010-08-07 Thread rmschne
I have a model like that I would like query down more than one level (using my nomenclature). class Library(models.Model) branch=models.CharField(max_length=100) class Book(models.Model) libraryid=models.ForeignKey(Library,related_name="books") class Chapter(models.Model)

Is it possible to remove the /admin from the admin/docs URL views?

2010-08-07 Thread rich.al...@gmail.com
When you enable this:(r'^admin/doc/', include('django.contrib.admindocs.urls')), You get the cool /admin/doc/views Is there anyway to just list the URL/views associated with the app models, and NOT the admin urls (since they sort of clutter it). Looking for a quick/easy

Re: Django on Mac OS X

2010-08-07 Thread Xavier Ordoquy
And what's your Account model ? I noticed it is in its get_or_create that you get the error. Regards, Xavier. Le 7 août 2010 à 18:52, Daniel França a écrit : > Same error =/ > but now,I don't know why.. it's saving at the db. The error still happens, > but the data is in the database > > On

Re: Django on Mac OS X

2010-08-07 Thread Daniel França
Same error =/ but now,I don't know why.. it's saving at the db. The error still happens, but the data is in the database On Sat, Aug 7, 2010 at 12:54 PM, Xavier Ordoquy wrote: > Sorry, I just woke up form a sleep :) > I notice you get-or-create a user. > However, did you

Re: question about urlpatterns

2010-08-07 Thread Liu ChuanRen
Thanks, but it is just an example to illustrate the question, I need some help about the question. On Sat, Aug 7, 2010 at 11:54 PM, Steve Holden wrote: > On 8/7/2010 10:09 AM, Liu ChuanRen wrote: > > Take following as example: > > > > urlpatterns=patterns('', > >

Re: Django on Mac OS X

2010-08-07 Thread Xavier Ordoquy
Sorry, I just woke up form a sleep :) I notice you get-or-create a user. However, did you try to call get or create with specifying the arguments ? first_name = "...", and so on ? Does it still give an error ? Regards, Xavier. Le 7 août 2010 à 17:46, Xavier Ordoquy a écrit : > I just googled

Re: question about urlpatterns

2010-08-07 Thread Steve Holden
On 8/7/2010 10:09 AM, Liu ChuanRen wrote: > Take following as example: > > urlpatterns=patterns('', > (r'^boys/', include('boys.urls')), > (r'^girls/', include('girls.urls')), > ) > > I prefer a compact style like this: > > urlpatterns=patterns('', > (r'^(?P[^/]+)/', include(p+'.urls')) > )

Re: Django on Mac OS X

2010-08-07 Thread Xavier Ordoquy
I just googled your error and found: http://www.nerdydork.com/django-programmingerror-cant-adapt.html According to the first comment, you might do something wrong with the arguments types. Unless you give a table description (\d from psql shell) and the model I'm not sure I can help you further.

Re: Django on Mac OS X

2010-08-07 Thread Daniel França
I just created my db using django manage syncdb, I think it should create right. or how can I see the encode of each tables? I'm using postgresql 8.4 maybe I'll need reinstall everything =S On Sat, Aug 7, 2010 at 6:49 AM, Xavier Ordoquy wrote: > > Le 7 août 2010 à 06:44,

question about urlpatterns

2010-08-07 Thread Liu ChuanRen
Take following as example: urlpatterns=patterns('', (r'^boys/', include('boys.urls')), (r'^girls/', include('girls.urls')), ) I prefer a compact style like this: urlpatterns=patterns('', (r'^(?P[^/]+)/', include(p+'.urls')) ) I know this does NOT work, but is there a similar way to include

Re: Linkedin Search

2010-08-07 Thread Sam Lai
On 7 August 2010 22:53, kostia wrote: > I would like to know what search engines are used in web sites like > Facebook, Linkedin, Twitter and so on. > > Are they simplistic database queries or sophisticated search solutions? I'd say all three of those sites use custom

Re: Linkedin Search

2010-08-07 Thread Steve Holden
On 8/7/2010 8:53 AM, kostia wrote: > I would like to know what search engines are used in web sites like > Facebook, Linkedin, Twitter and so on. > > Are they simplistic database queries or sophisticated search solutions? > Wouldn't we all, but it's difficult to see how this relates to Django.

Re: HttpResponseRedirect

2010-08-07 Thread JeffH
Another approach that I used recently: # urls.py (r'^ThankYou/(?P\d{4})/$', views.ThankYou), # message defs in views.py # messages for ThankYou page ty_messages = { '' : 'Invalid message specified.', '0001' : 'Pending dealer record has been re-saved, awaiting approval.',

Re: Linkedin Search

2010-08-07 Thread kostia
I would like to know what search engines are used in web sites like Facebook, Linkedin, Twitter and so on. Are they simplistic database queries or sophisticated search solutions? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: TemplateDoesNotExist: 500.html error when trying to run server

2010-08-07 Thread Karen Tracey
On Fri, Aug 6, 2010 at 5:05 PM, meenakshi wrote: > To clarify - I get a 404 message with DEBUG on (i.e. DEBUG=True), and > a 500 message with DEBUG off (DEBUG=False), not the other way around. > With DEBUG=False, standard handling of the Http404 exception will be to

Re: Newbie Mistake Question

2010-08-07 Thread Paulo Almeida
Is your project named mysite? (That is, is the parent directory of 'polls' named 'mysite'?) -Paulo On Sat, Aug 7, 2010 at 3:20 AM, HawaiiMikeD wrote: > Hi all, > > Just starting out with the tutorial 1 and ran into what I hope is a > minor mistake. I've got my site

Re: Interpolation and comparation between 2 dates: easy and difficult at the same time

2010-08-07 Thread Paulo Almeida
As I understand it, in the case of partial overlap you just divide the overlapping portion of B by A, so the direct division here would have the same effect. I don't understand why is that division assuming A = 2B. In any case, your function is heavier on the ifs, but mine has to do more with

Re: Django not creating intermediary tables for m2m relations

2010-08-07 Thread Xavier Ordoquy
Hi, This will often happen when you have both model table created in the database and then you add some field and syncdb. Syncdb will not perform operation on tables that are already created, including created new fields or intermediate tables. However, if you start from scratch, this should be

Re: Django on Mac OS X

2010-08-07 Thread Xavier Ordoquy
Le 7 août 2010 à 06:44, Daniel França a écrit : > My database is UTF-8, it's fine, doesn't?. > I'm afraid to reinstall everything from ports and start to get a lot 64-32 > bits incompatible issues like happened before =/ I think that should be fine with a utf-8 DB. Are you sure your tables are

Re: HttpResponseRedirect

2010-08-07 Thread bagheera
Dnia 07-08-2010 o 10:29:30 bagheera napisał(a): Dnia 06-08-2010 o 18:09:12 shacker napisał(a): Why not use the Messages framework for this? http://docs.djangoproject.com/en/dev/ref/contrib/messages/ ./s That looks promising, i'll try to figure

Re: Admin Inline inside another admin inline

2010-08-07 Thread Alessandro Ronchi
On 4 Ago, 16:11, Alessandro Ronchi wrote: > It's not possible to make nested inline. > I'm trying to do the same thing, with this > solution:http://packages.python.org/django-easymode/tree/index.html?highlight=... I solved my issue: I didn't notice the related

Re: HttpResponseRedirect

2010-08-07 Thread bagheera
Dnia 06-08-2010 o 18:09:12 shacker napisał(a): Why not use the Messages framework for this? http://docs.djangoproject.com/en/dev/ref/contrib/messages/ ./s That looks promising, i'll try to figure that out. -- Linux user -- You received this message because you are

Newbie Mistake Question

2010-08-07 Thread HawaiiMikeD
Hi all, Just starting out with the tutorial 1 and ran into what I hope is a minor mistake. I've got my site setup to a Postgresql database and was running through the tutorial without any problems until I got to the step where you create your models and then activate them. The models you start