Re: Trouble rendering a ManyToManyField with CheckBoxSelectMultiple widget

2009-06-26 Thread Tim Kersten
That works? You can use a ChoiceField to select _multiple_ values for the many-to-many field? Tim ^,^ On Fri, Jun 26, 2009 at 3:40 AM, Rodrigo Cea wrote: > > Stupid mistake, I had to use a MultipleChoiceField instead of a plain > ChoiceField. > > styles= forms.MultipleChoiceField (widget=form

Re: SESSION_EXPIRE_AT_BROWSER_CLOSE and normal cookie

2009-06-26 Thread pr
I thought that None is equal to 'forever'. Thanks. On 26 Cze, 01:41, humble wrote: > you didn't specify max_age in response.set_cookie('myname', data), > which assumes None by default. Therefore that cookie expires when > browsers closes. > > On Jun 25, 3:58 pm, pr wrote: > > > Hello, > > > Wh

Re: Very bad experience in Django...

2009-06-26 Thread iyank7
Joshua Partogi wrote: > > You need to define required=False > > On Thu, Jun 25, 2009 at 10:24 PM, steveneo > wrote: if steveneo got `Very Bad experience`, maybe i got `Very..very... n very... bad experience`, but i still learning django ^_^ *There`s no magic, its

Re: Setting up Django, Apache and Nginx on Windows Vista

2009-06-26 Thread iyank7
Duvalfan23 wrote: > I am a new user to Django and want to set it up with Apache, Nginx, > and MySQL on Windows Vista for testing. I will set up on Linux once I > get a shared hosting account. Does anyone know a website that explains > this very well from start to finish on Vista? Or can someone ex

Re: Rendered output from a template tag

2009-06-26 Thread Brian May
On Thu, Jun 25, 2009 at 02:03:16PM -0400, Michael wrote: > Inclusion tags might help you out with the template idea, but generally for > variables like this I like to put them in context like this: > http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#setting-a-variable-in-the-context

How to load only the body of a page?

2009-06-26 Thread akaariai
Hello all, I have some problems when trying to load only part of the page ( for example) in AJAX calls without duplicating page structure in multiple templates. I have my base.html (in reality the structure is much more complex, but that doesn't matter for this example): ... {%block content%

how does one write tests for models.py?

2009-06-26 Thread Kenneth Gonsalves
hi, this is my first venture into unittests, and have reached a block. Here is the contents of my test.py: test.py-- import unittest from conference.web.models import * from django.contrib.auth.models import User class TalkTestCase(unittest.

Re: rollback transaction without an exception when transaction is tied to http requests

2009-06-26 Thread Karen Tracey
On Fri, Jun 26, 2009 at 12:59 AM, sico wrote: > > Hi > > Is it possible to rollback the transaction without raising an > exception when the transactions are tied to http requests?? > I'm writing several records in one post call, if any fail I'd like to > rollback the transaction but return a nice

switching menu items on and off - dynamic urls?

2009-06-26 Thread Kenneth Gonsalves
hi, I have a conference management application. It has a list of menu items on the lefthand side. These menus are created by a templatetag from a list of menus in views.py. At various stages of the conference, menu items have to be enabled or disabled. For example, 'submit talk' has to be hidd

Re: How to load only the body of a page?

2009-06-26 Thread Jani Tiainen
akaariai kirjoitti: > Hello all, > > I have some problems when trying to load only part of the page ( > for example) in AJAX calls without duplicating page structure in > multiple templates. > > I have my base.html (in reality the structure is much more complex, > but that doesn't matter for thi

Display hidden search results

2009-06-26 Thread bsisco
I have an application where certain fields that are "closed" in the DB (boolean field) are hidden in the change_list_results.html file and displayed in a separate view ("Closed Items"). When I do a search from the main admin change_list view it will find the item(s) and display "1 result (89 Tota

I couldn't re-write save() of mymodels in admin.py instead of models.py ?

2009-06-26 Thread Shuge Lee
models.py http://gpaste.com/p/3747b admin.py http://gpaste.com/p/3d432 --~--~-~--~~~---~--~~ 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 unsu

Re: how does one write tests for models.py?

2009-06-26 Thread Karen Tracey
On Fri, Jun 26, 2009 at 6:55 AM, Kenneth Gonsalves wrote: > > hi, > > this is my first venture into unittests, and have reached a block. Here is > the > contents of my test.py: > > test.py-- > > import unittest > from conference.web.models import

Re: how does one write tests for models.py?

2009-06-26 Thread Kenneth Gonsalves
On Friday 26 June 2009 17:04:52 Karen Tracey wrote: > You're deriving your tests from the base Python unittest.TestCase instead > of django.test.TestCase: > > http://docs.djangoproject.com/en/dev/topics/testing/#testcase > > One of the things that Django's TestCase provides is database isolation -

Logout in Firefox but not in IE 6!

2009-06-26 Thread Kostas M
I want to use from django.contrib.auth.views the login and logout functions. Following the manual pages, in my views.py I use this procedure: @login_required def homepage(request):... While it works fine in Firefox, and one who logouts is redirected to the login page if one tries to access di

django-facebookconnect

2009-06-26 Thread R C
Hi Everyone, I've been trying to get the django-facebookconnect (http:// code.google.com/p/django-facebookconnect/) app working with my site. The problem I'm having is that I don't know how to "plug-in" the views and urls for this plugin I have "hacked" it by simply copying the urls.py from the

Re: Rendered output from a template tag

2009-06-26 Thread Michael
On Fri, Jun 26, 2009 at 5:17 AM, Brian May wrote: > > On Thu, Jun 25, 2009 at 02:03:16PM -0400, Michael wrote: > > Inclusion tags might help you out with the template idea, but generally > for > > variables like this I like to put them in context like this: > > > http://docs.djangoproject.com/en/d

Re: Hard linking an image

2009-06-26 Thread Rajesh D
On Jun 26, 1:16 am, koranthala wrote: > On Jun 26, 2:21 am, Kevin Teague wrote: > > > Presumably you already have all of the data required to generate a > > chart on the server? If so, then store the chart data in a model, and > > just reference it by id. e.g. > > > > > > (or w/ a pretty URL:

regex problem in django

2009-06-26 Thread Joru
Hi, I experience some weirdness regarding using regex with django I have following function in utils.py from django.utils.text import wrap import re str = "wr: \n one bunny \n two bunny \n wr: three bunny \n def do_regex(text): lines = wrap(text, 55).split('\n') for i, line in enumerate

Re: django-facebookconnect

2009-06-26 Thread R C
Well I have solved part of my problem: There are updated installation instructions http://code.google.com/p/django-facebookconnect/issues/detail?id=1 But the problem remains: When I click on the facebook connect button I get redirected to http://xxx.com/facebook/setup?next=/accounts/pro

Re: django-facebookconnect

2009-06-26 Thread R C
Well more good newsit seems the reason things weren't working was because Facebook had a problem. Now the next problem I'm having is that I keep getting this error: Warning at /facebook/setup Out of range value adjusted for column 'facebook_id' at row 1 Any ideas? Thanks On Jun 26,

Re: django-facebookconnect

2009-06-26 Thread Alen Mujezinovic
Hm, I didn't use this application, but there's another one on http://code.google.com/p/django-fbconnect which is quite easy to use. cheers, alen Am Freitag, den 26.06.2009, 07:16 -0700 schrieb R C: > Well more good newsit seems the reason things weren't working was > because Facebook had a p

Re: Global objects

2009-06-26 Thread diogobaeder
Thanks, Alex, I'll give a look at these TEMPLATE_CONTEXT_PROCESSORS to see if they solve my problem... thanks a lot! :-) Diogo On Jun 26, 12:44 am, Alex Gaynor wrote: > On Thu, Jun 25, 2009 at 10:42 PM, diogobaeder wrote: > > > Let me explain myself better: I have some menus in my site, and

Re: Using Signals as hooks

2009-06-26 Thread Rajesh D
On Jun 25, 10:49 pm, Wiiboy wrote: > Question: how often should I have a cron job work to send emails?   Depends on the volume of emails and the frequency with which new articles are submitted to your site. Just try a frequency of say every 10 minutes and adjust it up or down when you have rea

Two-way management of ManyToMany relationships

2009-06-26 Thread Daniele Procida
If the class People has a many-to-many relationship with the class Roles, the user can go to People Admin, and select multiple roles for each person. Is it possible to make the same relationship available in Roles, so that for each role we can select and deselct multiple Users? Thanks, Daniele

Re: Rendered output from a template tag

2009-06-26 Thread Daniele Procida
On Fri, Jun 26, 2009, Brian May wrote: >Is it possible to do the same thing with register.simple_tag, and maybe >takes_context (assuming register.simple_tag supports that)? What I used in the end was: @register.inclusion_tag('newslist.html', takes_context=True) def news_for_this_page(context):

Re: I couldn't re-write save() of mymodels in admin.py instead of models.py ?

2009-06-26 Thread Rajesh D
On Jun 26, 7:33 am, Shuge Lee wrote: > models.pyhttp://gpaste.com/p/3747b > > admin.pyhttp://gpaste.com/p/3d432 If you need to have custom code when a model is saved through the admin, you should override the save_model method in your Admin class. See this doc: http://docs.djangoproject.com/e

Re: "python manage.py runserver" tutorial error

2009-06-26 Thread Steve1234
Thanks Alex, that did the trick. I had postgresql as my database engine. --~--~-~--~~~---~--~~ 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 uns

admin like list view

2009-06-26 Thread pihentagy
Hi! I am developing a django app, which will be installed at multiple places with different configuration. It has some models, and list views. I store in a config dict the fields/methods to be displayed, and I'd like to offer sorting (automagically for all fields, where possible). My big proble

FIlePathField does not update

2009-06-26 Thread Kusako
Hi- I have a FilePathField in a form that displays directory contents as expected. However if I add or remove a file to/from the directory the change is not updated in the form. I'm probably just using FilePathField in a wrong way... Here is the from: from django import forms class MyForm(form

Select Multiple objects

2009-06-26 Thread Carlos Eduardo Sotelo Pinto
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi people I am trying to do a multiple select choice form from multiple objects my models are http://pastebin.com/m28887b6f my forms are http://pastebin.com/m6e757770 my views are http://pastebin.com/m474b64c0 my html is http://pastebin.com/m45a1591

Re: switching menu items on and off - dynamic urls?

2009-06-26 Thread Rajesh D
On Jun 26, 7:17 am, Kenneth Gonsalves wrote: > hi, > > I have a conference management application. It has a list of menu items on the > lefthand side. These menus are created by a templatetag from a list of menus > in views.py. At various stages of the conference, menu items have to be > enable

Re: admin like list view

2009-06-26 Thread Rajesh D
On Jun 26, 11:35 am, pihentagy wrote: > Hi! > > I am developing a django app, which will be installed at multiple > places with different configuration. > > It has some models, and list views. > > I store in a config dict the fields/methods to be displayed, and I'd > like to offer sorting (auto

Help regarding how to deliver a particular project

2009-06-26 Thread Amit Sethi
I hope i am not breaking any code here and i don't get mails saying its not the place to discuss this . I am trying to create a small xml-rpc like service which uses some other multiple REST/JSON based web services . I am using django because I like simple organized architecture it gives for deve

Subject: Model Inheritance

2009-06-26 Thread Daniele Procida
Given: class Cyclist(models.Model): and: class ProfessionalCyclist (Cyclist): I can't immediately see way to make an existing Cyclist into a ProfessionalCyclist (in either Admin interface). How can this be achieved (can it be achieved)? Daniele --~--~-~--~~~--

Re: Subject: Model Inheritance

2009-06-26 Thread Karen Tracey
On Fri, Jun 26, 2009 at 12:11 PM, Daniele Procida wrote: > > Given: > > class Cyclist(models.Model): > > and: > > class ProfessionalCyclist (Cyclist): > > I can't immediately see way to make an existing Cyclist into a > ProfessionalCyclist (in either Admin interface). > > How can this be achieved

Re: Subject: Model Inheritance

2009-06-26 Thread Rick
Hi, On Jun 26, 9:24 am, Karen Tracey wrote: > On Fri, Jun 26, 2009 at 12:11 PM, Daniele Procida > > wrote: > > > Given: > > > class Cyclist(models.Model): > > > and: > > > class ProfessionalCyclist (Cyclist): > > > I can't immediately see way to make an existing Cyclist into a > > ProfessionalC

Why can't template variables be used as filters?

2009-06-26 Thread ssadler
This is a general question. I think it would be useful to be able to use template variables as filters. Consider the following: I need to display dates according to a user's timezone. My options are to create these translated dates in the view code (assign them to model instances or create a new d

Re: Using Signals as hooks

2009-06-26 Thread Wiiboy
> But if it's a small and low volume app and you are the > only developer managing it, you could get away with it :) You hit the nail on the head ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gro

Re: Bug in admin area in SVN

2009-06-26 Thread Steve1234
Sorry, I didn't see the reply. --~--~-~--~~~---~--~~ 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 group, send email to dj

Re: Bug in admin area in SVN

2009-06-26 Thread Steve1234
I am seeing this too. Since the URLs are wrong you get file not found 404 errors. To reproduce: 1. login to admin 2. click on logout (or change password) You are sent to the file not found pages. The URL is http://127.0.0.1:8000/admin/admin/logout/ Expected: http://127.0.0.1:8000/admin/logout/ A

Re: Using Signals as hooks

2009-06-26 Thread Alex Robbins
> should I just have it so that a few items from a task DB are done each > request (e.g. split up emails into groups, and email them a few per > request)? Hmm...what happens if there aren't any requests for an hour? Does the queue processing stop during that time? I can't get my email until there

Changing the 'ipython' path executed with manage.py shell

2009-06-26 Thread Blaine Booher
Hey everyone, I love using ipython and pylab to plot data. I have to run it like this: 'ipython -pylab' to get the pylab stuff imported correctly into ipython. I notice that "python manage.py shell" spits me out into ipython. Where would I add the '-pylab' option so that it spits me out into

Re: objects in memory that don't time out?

2009-06-26 Thread Robert Mela
Why not just have a global in your view.py? Alternatively, if you need to access the object from multiple views, then implement a singleton in a module, initialize it by importing into settings.py, and then import it into any view that needs it. settings.py works similarly. The values in sett

Problems with creating formsets with Dynamic initial values

2009-06-26 Thread Bryan Wheelock
I'm completely confused why I'm getting this error: __init__() got an unexpected keyword argument 'questions' when I try to initiate CustomBaseFormSet. I've been trying to hack together a Poll with dynamic Questions and Choices. This has been much more difficult than I expected. I started with t

model subclasses

2009-06-26 Thread ryan
Let's say I have a Polygon model class Polygon(Models.model): side_length = models.IntegerField() Depending on the view I'm in, I want to calculate the perimeter of the polygons as a square, or as a triangle (or anything other polygon). What I'd like to do is somehow create a subclass of po

Problem with generic views

2009-06-26 Thread Technicalbard
Hey all, I did the tutorial, yet when I try to apply what I've learned (or think I've learned), to my own application it doesn't work... My code looks like this: # taskmgr/models.py class Task(models.Model): name = models.CharField(max_length=216) summary = models.CharField(max_length=3

Re: Isolating Django Models

2009-06-26 Thread Blaine Booher
rozwell @ IRC helped me out substantially by showing me these two links: http://www.b-list.org/weblog/2007/sep/22/standalone-django-scripts/ http://code.djangoproject.com/wiki/IrcFAQ#Shell Blaine On Thu, Jun 25, 2009 at 11:23 AM, Blaine Booher wrote: > Hey everyone, > I was wondering the bes

Setting up TinyMCE with django-grappelli?

2009-06-26 Thread Chris O'Donnell
I've never used TinyMCE, and would really like to get it working with Grappelli, but the "Using TinyMCE" wiki page on the Grappelli Google Code site doesn't produce any results for me. Could someone who's got it working maybe outline all the steps needed to get TinyMCE working? Do I need django- t

Re: Setting up TinyMCE with django-grappelli?

2009-06-26 Thread odonnell
Also, I'm trying to set up django-filebrowser, made by the same people who make django-grappelli, and there's some stuff on that Google Code wiki about TinyMCE that's totally confused me. I want Grappelli, FileBrowser, and TinyMCE all working nicely. Right now, I have Grappelli set up. If anyone

Re: Problem with generic views

2009-06-26 Thread maplye
task_list not Task.object.all in the view. 2009/6/27 Technicalbard : > > Hey all, > > I did the tutorial, yet when I try to apply what I've learned (or > think I've learned), to my own application it doesn't work... > > My code looks like this: > > # taskmgr/models.py > class Task(models.Model):

Re: django twisted model

2009-06-26 Thread Timboy
Shameless bump... --~--~-~--~~~---~--~~ 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 group, send email to django-users+un

Re: model subclasses

2009-06-26 Thread Erik Vorhes
Why not do this: class Polygon(models.Model): sides = models.IntegerField() side_length = models.IntegerField() def perimeter(self): return sides * side_length (Forgive the syntax. I'm a bit rusty.) This doesn't help with irregular polygons, but with your example, it doesn'

Re: Logout in Firefox but not in IE 6!

2009-06-26 Thread Wiiboy
It might be caching the page. --~--~-~--~~~---~--~~ 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 group, send email to dja

Re: Problem with generic views

2009-06-26 Thread Justin Lilly
Actually, As he didn't provide a template_object_name parameter, the generic view's default context variable is object_list. -justin On Fri, Jun 26, 2009 at 8:18 PM, maplye wrote: > > task_list not Task.object.all in the view. > > 2009/6/27 Technicalbard : >> >> Hey all, >> >> I did the tutoria

Forms __init__ : use of **kwargs

2009-06-26 Thread Anthony
I'm initializing my forms this way: def __init__(self, league, *args, **kwargs): super(TeamForm, self).__init__(*args, **kwargs) self.fields["team"].queryset=Team.objects.filter( league=league ) ... But then I read this comment by Malcolm saying that I