Re: Django Powered Tabblo to be acquired by HP

2007-04-03 Thread bedros
nice work; I've always been impressed by Django; and Tabblo website gives a more convincing reason to use Django. But, I'm still not sure on javascript/ajax library to use with Django... so my question which ajax kit did you use with Tabblo. Thanks, -Bedros On Mar 23, 11:20 am, Ned Batchelder

Re: Using url in a view

2007-04-03 Thread Malcolm Tredinnick
On Tue, 2007-04-03 at 21:21 -0500, Chris Moffitt wrote: > > Malcolm, > > Thanks for the speedy response. Upon further reflection, I'm thinking I'd > like to do something like: > > reverse(request.path) > > Will that return the name of the view? In this case, 'full-archive' Oh, I see what yo

Re: loaddata against postgresql doesn't update primary key's sequence 'last_value' ?

2007-04-03 Thread Russell Keith-Magee
On 4/4/07, Jon Ballard <[EMAIL PROTECTED]> wrote: > > Hello everybody, I'm new. Django is the bomb.. my app is coming > together quickly. Glad you like it. > Anyone have any ideas? Am I doing something wrong perhaps? Thanks > for any help. I don't think you're doing anything wrong - I've had

Re: Using url in a view

2007-04-03 Thread Chris Moffitt
Malcolm, Thanks for the speedy response. Upon further reflection, I'm thinking I'd like to do something like: reverse(request.path) Will that return the name of the view? In this case, 'full-archive' -Chris --~--~-~--~~~---~--~~ You received this message bec

loaddata against postgresql doesn't update primary key's sequence 'last_value' ?

2007-04-03 Thread Jon Ballard
Hello everybody, I'm new. Django is the bomb.. my app is coming together quickly. Now to my issue.. I dumped my database to json and tried to ingest it back in. Seemed to work fine at first -- everything was there -- but it turns out no new records can be added because the sequence field 'last

Ordered list of objects?

2007-04-03 Thread Nathan R. Yergler
I'm working on an app for a client, and one of the requirements is that they be able to re-order objects in the admin interface. I know exactly how I'd do with with an object database, but the ideas I've come up with for doing it with Django all involve using some tracking field, and then updatin

Re: Using url in a view

2007-04-03 Thread Malcolm Tredinnick
Hi Chris, On Tue, 2007-04-03 at 20:27 -0500, Chris Moffitt wrote: > Is there a way to access a named url from within a view? > > For example, > > Using this as a reference- > http://www.djangoproject.com/documentation/url_dispatch/ > > say, I have this url: > url(r'/archive/(\d{4})/$', archive

Using url in a view

2007-04-03 Thread Chris Moffitt
Is there a way to access a named url from within a view? For example, Using this as a reference- http://www.djangoproject.com/documentation/url_dispatch/ say, I have this url: url(r'/archive/(\d{4})/$', archive, name="full-archive") and access it like this in a template: {% url full-archive 19

Django Job at WeFi

2007-04-03 Thread Pablos
Hopefully it is copacetic to post jobs to this list, I'm stoked to be creating Django jobs! About Me I'm Pablos, and I'm looking for coders for my team. You will talk to me about this job, not a recruiter. If this doesn't sound like the job for you, please introduce me to the most stellar code

Re: Curious error with Session Variables

2007-04-03 Thread Kenneth Gonsalves
On 03-Apr-07, at 11:06 PM, Ramdas S wrote: > Looks like your browser isn't configured to accept cookies. Please > enable cookies, reload this page, and try again. > > > Later if I persist > > I get this error one person on irc was getting this - he solved it by physically restarting apache

Re: object_list || didn't return an HttpResponse object

2007-04-03 Thread Forest Bond
On Tue, Apr 03, 2007 at 04:42:58PM -0700, TaMeR wrote: > On Apr 3, 7:10 pm, Forest Bond <[EMAIL PROTECTED]> wrote: > > The way your view is written, if the user is not authenticated, no > > HttpResponse is returned (since no return statement is executed). You > > probably want to just raise Http40

Re: edit_inline causing problems with multiple relations

2007-04-03 Thread Malcolm Tredinnick
On Tue, 2007-04-03 at 07:24 -0700, mh wrote: > I have two models that (simplified) look like this; > > class List(models.Model): > name =models.CharField(maxlength=128) > class Admin: > pass > > class Entry(models.Model): > name = models.CharField(maxlength=128, core=True) > list = models.

Re: Internationalisation for non-supported languages

2007-04-03 Thread Malcolm Tredinnick
On Tue, 2007-04-03 at 22:40 +0100, Rory Campbell-Lange wrote: > Dear Malcolm > > Many thanks for your response. > > On 03/04/07, Malcolm Tredinnick ([EMAIL PROTECTED]) wrote: [...] > > Note that the reference to "dummy gettext()" in the docs is just saying > > that you should avoid using the rea

Re: newforms and form_from_instance

2007-04-03 Thread Luciano Adamiak
Gary, after some testing I came to this solution: I created my own form_for_instance function like this: def form_for_instance(instance): f = forms.models.form_for_instance(instance=instance, form=MyCustomForm) f.base_fields['email'].initial=instance.email ... f.base_fields['sen

Re: edit_inline causing problems with multiple relations

2007-04-03 Thread Russell Keith-Magee
On 4/3/07, mh <[EMAIL PROTECTED]> wrote: > > This doesn't seem to be working ('bool' object is not callable); any > suggestions on how I could fix it? I can't see anything immediately wrong with your model - however, the error you are reporting sounds like a known problem with the manipulators an

Re: object_list || didn't return an HttpResponse object

2007-04-03 Thread TaMeR
On Apr 3, 7:10 pm, Forest Bond <[EMAIL PROTECTED]> wrote: > On Tue, Apr 03, 2007 at 03:46:04PM -0700, TaMeR wrote: > > This used to work and I must have done something to break the code. > > The simple page view still works fine but the list view gives me this > > error and I been through my cod

Re: object_list || didn't return an HttpResponse object

2007-04-03 Thread Forest Bond
On Tue, Apr 03, 2007 at 03:46:04PM -0700, TaMeR wrote: > This used to work and I must have done something to break the code. > The simple page view still works fine but the list view gives me this > error and I been through my code a million times and can't find > anything wrong with it. The way y

ifchanged

2007-04-03 Thread Rob Slotboom
Within a template I want to use the folowing construction. {% for item in object_list reversed %} {% ifchanged %} {% if not forloop.first %}{% endif %} {{ item.pub_date| date:"F" }} {% endifchanged %} {{ item.title }}

object_list || didn't return an HttpResponse object

2007-04-03 Thread TaMeR
This used to work and I must have done something to break the code. The simple page view still works fine but the list view gives me this error and I been through my code a million times and can't find anything wrong with it. = ERROR = ValueError at /bbauction/events_list/1/ The view bba

Re: newforms and form_from_instance

2007-04-03 Thread dballanc
>From what I remember you do: def myformcallback(f, **args): exclude = ['author'] if f.name in exclude: return None return f.formfield(**args) MyForm = form_for_instance(book, formfield_callback=myformcallback) if request.POST: form = MyForm(request.POST) form.save()

Re: request object out of a view (I need to access session['data'])

2007-04-03 Thread Karen Tracey
I'll try to elaborate what James said. (Did you consult the documentation links he pointed to? They detail how you get the request object accessible in your templates, and thus your custom template tag.) In order to get access to the request object in your custom template tag, you must make some

Re: request object out of a view (I need to access session['data'])

2007-04-03 Thread Grupo Django
I don't know if I didn't understand you or if I you didn't don't understand me :-) Not sure abou what you are saying, I think I can't use it to make the template tag work. The template tag doesn't use a view to render the content, so it doesn't get the request object as a parameter. This is the co

Re: request object out of a view (I need to access session['data'])

2007-04-03 Thread James Bennett
On 4/3/07, Grupo Django <[EMAIL PROTECTED]> wrote: > Inside the custom template tag, I don't get the request object since > it's not a view. Look into using RequestContext[1] in your views (generic views all use it automatically), and enabling the "request" context processor[2]. This will make th

Re: Internationalisation for non-supported languages

2007-04-03 Thread Rory Campbell-Lange
Dear Malcolm Many thanks for your response. On 03/04/07, Malcolm Tredinnick ([EMAIL PROTECTED]) wrote: > > Hi Rory, > > On Tue, 2007-04-03 at 08:45 +0100, Rory Campbell-Lange wrote: > > We are developing a website for use in 16 EU countries. Some of the > > languages we need to cover are not s

request object out of a view (I need to access session['data'])

2007-04-03 Thread Grupo Django
Hi, I need to know how can I access data stored in the session out of a view. I have created a custom template tag which has to check a variable stored in the request.session. It's strictly necessary to store the data in a session variable at this moment. Inside the custom template tag, I don't ge

Re: Web Sites keep pointing against each other

2007-04-03 Thread Graham Dumpleton
On Apr 4, 4:38 am, "Keith Mallory" <[EMAIL PROTECTED]> wrote: > I have a Ubuntu Server with 4-5 Django web sites hosted on mod_python. > > Everything works fine, expect that the web sites keeps on pointing against > each other. That Site A points to Site B and B to C and so on. > > This is how I

Re: Vote only once/Remembering votes

2007-04-03 Thread [EMAIL PROTECTED]
I pulled the karma bit of contrib.comments out and made it a more generic app, so I can use it anywhere. I have it store who voted as user (as I suspect you would). And at that point all you have to do is something like: if KarmaScore.objects.filter(user = request.user): return HttpRespon

Re: newforms and form_from_instance

2007-04-03 Thread ladamiak
I'm with the same problem.. I've looked at the code of the form_for_intance function and saw something about the formfield_calback.. Looks like we must suply a function that sets the initial of each field.. But I'm not sure.. Any way... If you find something, please let me now.. []'s Luciano A

Re: MySQLdb version

2007-04-03 Thread joey101
I did this all, but it still doens't work :( When running ./dispatch.fcgi directly it looks as though the problem is all cleared up, but even after killing fcgi 'till it's dead it still brings up a 500 error on my site. Does this sound like it's still related or is it some other problem? If it i

Web Sites keep pointing against each other

2007-04-03 Thread Keith Mallory
I have a Ubuntu Server with 4-5 Django web sites hosted on mod_python. Everything works fine, expect that the web sites keeps on pointing against each other. That Site A points to Site B and B to C and so on. This is how I have set up my httpd.conf NameVirtualHost * ServerName example.com

Re: Curious error with Session Variables

2007-04-03 Thread Ramdas S
browsing through the user groups, I see that the issue is a clash between Django and PHP4/5. I cannot turn them off, since some sites on our server still use PHP. Is there any solution where we can ensure that Django does not clash with PHP and live peacefully. I am eager to know Ramdas On 4/3/0

Curious error with Session Variables

2007-04-03 Thread Ramdas S
Since last few days I am getting this error on Django web sites hosted. Obviously it is clashing with something. When I work on admin interface to add or delete content, I get logged off and it takes some time for me to login again. I get the following messages Please enter a correct username an

Per-app permissions ?

2007-04-03 Thread Chris Brand
What's the best way to restrict access on a per-app basis ? I want to have two apps, with some users allowed access to one, others allowed access to the other, and some allowed access to both. Any advice would be very much appreciated. Thanks, Chris --~--~-~--~~~

models.TABULAR Question ...

2007-04-03 Thread ZebZiggle
I want to be able to add new elements and delete individual elements ... can I do this with the Tabular view? For example: Container Element 1 [delete] Element 2 [delete] Element 3 [delete] add new Element new Container Is there a switch for this? Current

Re: upload_to with username

2007-04-03 Thread Jay Parlar
On 4/3/07, Stephen Mizell <[EMAIL PROTECTED]> wrote: > > > That line is executed exactly once, at the time the file is imported. So > > it is not dynamic in any way. > > > > (I seem to be saying that at least every other day here. It's normal > > Python behaviour, people. Please stop hoping it wer

Re: Locate subset language problem

2007-04-03 Thread Nuno Mariz
Malcolm, A patch that works for me is in: django/utils/translation/ real_trans.py in the function: "def get_language_from_request(request):": for lang, mainlang, order in langs: if lang in supported or mainlang in supported: # If the lang is not supported but mainlang is,

Re: upload_to with username

2007-04-03 Thread Stephen Mizell
> That line is executed exactly once, at the time the file is imported. So > it is not dynamic in any way. > > (I seem to be saying that at least every other day here. It's normal > Python behaviour, people. Please stop hoping it were otherwise!) Thanks for the help. I didn't call it dynamic, th

edit_inline causing problems with multiple relations

2007-04-03 Thread mh
I have two models that (simplified) look like this; class List(models.Model): name =models.CharField(maxlength=128) class Admin: pass class Entry(models.Model): name = models.CharField(maxlength=128, core=True) list = models.ForeignKey(List, edit_inline=models.TABULAR) to = models.Foreign

Re: Locate subset language problem

2007-04-03 Thread Nuno Mariz
Sure. On Apr 3, 2:37 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Could you file a ticket about this, please? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Generic views. Really generic

2007-04-03 Thread [EMAIL PROTECTED]
Thanks, Malcolm. That's basically what I was thinking. To clarify, though, I was saying a custom view for this would be quite simple - almost trivial - and I'm most assuredly *not* a programmer. I was only leaning toward a generic view because I trust them more than I do my own code. Anyway, sinc

Re: Copy table Design many, many times

2007-04-03 Thread Robert
Ned, True, Thanks both for quick reply. Actually did try exec at first.. . character When it went wrong at first, I doubted myself and thought I meant eval from js instead hence that post. I went back to it and realized how to include the nest "pass" just underneath it using the escape --

Re: Can't save utf data

2007-04-03 Thread Calumet
Question is off. I recreated all tables with utf8 charset. It helped. On Apr 3, 3:37 pm, "Calumet" <[EMAIL PROTECTED]> wrote: > I can't save utf data to database in admin and shell. In tutorial > application > > Warning at /admin/polls/poll/4/ > Data truncated for column 'question' at row 1 > > L

Re: newforms gurus: Forms With Multiple Inline Objects?

2007-04-03 Thread Malcolm Tredinnick
Hi Paul, On Tue, 2007-04-03 at 11:45 +, Paul Childs wrote: > Hi folks, > > Can someone suggest to me what I need to do to make this question a > little more answerable? "All our newforms gurus are out of the office at the moment. If you'd like to leave a message, please press..." :-) Sorry

Re: newforms gurus: Forms With Multiple Inline Objects?

2007-04-03 Thread Paul Childs
Hi folks, Can someone suggest to me what I need to do to make this question a little more answerable? On Apr 1, 12:05 am, "Paul Childs" <[EMAIL PROTECTED]> wrote: > I am trying to make the switch to new forms with little success. I > have searched the news group, looked over examples (found this

Can't save utf data

2007-04-03 Thread Calumet
I can't save utf data to database in admin and shell. In tutorial application Warning at /admin/polls/poll/4/ Data truncated for column 'question' at row 1 Last two calls: -- /usr/lib/python2.4/site-packages/MySQLdb/cursors.py in execute self._warning_check() ListType TupleType a

Re: Access to m2m relation in model's save()?

2007-04-03 Thread Malcolm Tredinnick
On Tue, 2007-04-03 at 11:46 +0200, Jarek Zgoda wrote: > I'm trying to get the values from many-to-many relation in the model's > save() method, but the list of related objects is always empty. After > the save(), the list has expectd content, but not until the save() > finishes. Is this normal beh

Re: Access to m2m relation in model's save()?

2007-04-03 Thread Jarek Zgoda
Jarek Zgoda napisał(a): > I'm trying to get the values from many-to-many relation in the model's > save() method, but the list of related objects is always empty. After > the save(), the list has expectd content, but not until the save() > finishes. Is this normal behaviour and I should look else

Access to m2m relation in model's save()?

2007-04-03 Thread Jarek Zgoda
I'm trying to get the values from many-to-many relation in the model's save() method, but the list of related objects is always empty. After the save(), the list has expectd content, but not until the save() finishes. Is this normal behaviour and I should look elsewhere to process the to-be-saved

Re: Dynamic query building

2007-04-03 Thread Malcolm Tredinnick
On Tue, 2007-04-03 at 09:32 +0200, Atilla wrote: > On 03/04/07, Honza Král <[EMAIL PROTECTED]> wrote: > > something like this works for me... > > > > q = Q( tag__name=first_tag ) > > for tag in other_tags: > > q = q | Q( tag__name=tag ) > > What kind of query does this build BTW? Is it smart en

Re: Internationalisation for non-supported languages

2007-04-03 Thread Malcolm Tredinnick
Hi Rory, On Tue, 2007-04-03 at 08:45 +0100, Rory Campbell-Lange wrote: > We are developing a website for use in 16 EU countries. Some of the > languages we need to cover are not supported by Django, according to: > http://www.djangoproject.com/documentation/settings/#languages > All of our transl

Re: Internationalisation for non-supported languages

2007-04-03 Thread TaMeR
On Apr 3, 3:45 am, Rory Campbell-Lange <[EMAIL PROTECTED]> wrote: > We are developing a website for use in 16 EU countries. Some of the > languages we need to cover are not supported by Django, according > to:http://www.djangoproject.com/documentation/settings/#languages > All of our translatio

Re: HowTo assign user to group at registration

2007-04-03 Thread TaMeR
On Apr 3, 3:25 am, Atilla <[EMAIL PROTECTED]> wrote: > On 03/04/07, TaMeR <[EMAIL PROTECTED]> wrote: > group = Group.objects.get(condition) > new_user.groups.add(group) > > I'm not sure why it doesn't raise errors there though, if .add() only > accepts a related object. Thanks, I will try th

Internationalisation for non-supported languages

2007-04-03 Thread Rory Campbell-Lange
We are developing a website for use in 16 EU countries. Some of the languages we need to cover are not supported by Django, according to: http://www.djangoproject.com/documentation/settings/#languages All of our translation strings are in template files and we have generated corresponding .po file

unique_together error 'isUniquetype_primary'

2007-04-03 Thread TaMeR
Hello, I see others use this like at following link without adding a AddManipulator why do I get this error? By the way, I did rebuild the db (sqlite3) after adding unique_together http://svn.zyons.python-hosting.com/trunk/zilbo/common/counter/models.py = ERROR = AttributeError at /ad

Re: Dynamic query building

2007-04-03 Thread Atilla
On 03/04/07, Honza Král <[EMAIL PROTECTED]> wrote: > something like this works for me... > > q = Q( tag__name=first_tag ) > for tag in other_tags: > q = q | Q( tag__name=tag ) What kind of query does this build BTW? Is it smart enough to put them all into a "WHERE name IN ( all-your-tags-here) ?

Re: HowTo assign user to group at registration

2007-04-03 Thread Atilla
On 03/04/07, TaMeR <[EMAIL PROTECTED]> wrote: > > > I use two registration forms one for clients one for vendors. > Depending on form used I would like to assign the user to a group. > > How do I use new_user.groups.add('Client') > > Below is my code that does not raise any errors but also does no