Re: exclude subquery executed twice?

2009-05-11 Thread Malcolm Tredinnick
On Sat, 2009-05-09 at 20:18 -0700, Henry Andrews wrote: > Hi folks, > When excluding using a subquery, I'm seeing the subquery being > executed first as its own query, then seeing the correct query being > run, including the subquery. Using filter instead of exclude, this > does not happen.

Re: error saving in admin after migrating a .90 site to postgresql8.3.x

2009-05-11 Thread Kenneth Gonsalves
On Monday 11 May 2009 20:09:03 Karen Tracey wrote: > This was a PostgreSQL change  with 8.3 that required modifying Django code > to account for the new behavior.  See: > > http://code.djangoproject.com/ticket/6523 yes - this is it. I 'solved' the problem by removing the unique_together

Re: two models, 1 table

2009-05-11 Thread George Song
On 5/11/2009 8:55 PM, rpupkin77 wrote: > Hi, can I use the same table in two different models and surface > different data in each, model, particularly in the admin panel? Sounds like a job for proxy models[1], each with its own default manager.

Re: How to create a newforms label unattached to an input field?

2009-05-11 Thread George Song
On 5/11/2009 12:29 PM, Nash-t wrote: > I apologize if this is a dumb newbie question... > I am trying to create a newform label that doesn't have an associated > input field. This label is used as a title for a set of input fields. > I don't want to use django templates because of the way the

two models, 1 table

2009-05-11 Thread rpupkin77
Hi, can I use the same table in two different models and surface different data in each, model, particularly in the admin panel? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: How do I handle urls with different names?

2009-05-11 Thread Mike Ramirez
On Monday 11 May 2009 07:35:37 pm Alex Gaynor wrote: > On Mon, May 11, 2009 at 10:22 PM, Thierry wrote: > > Let's say I have a pet table: > > > > TABLE: Pet > > id nametype > > -- > > 1 Plutodog > > 2 Foo cat

Re: How do I handle urls with different names?

2009-05-11 Thread Alex Gaynor
On Mon, May 11, 2009 at 10:22 PM, Thierry wrote: > > Let's say I have a pet table: > > TABLE: Pet > id nametype > -- > 1 Plutodog > 2 Foo cat > 3 Goo fish > > I can access the pet page of each

How do I handle urls with different names?

2009-05-11 Thread Thierry
Let's say I have a pet table: TABLE: Pet id nametype -- 1 Plutodog 2 Foo cat 3 Goo fish I can access the pet page of each of the above by the following url: Pluto: localhost/pets/1/ Foo: localhost/pets/2/ Goo:

Re: Display an URLField as a Link

2009-05-11 Thread Morgan
In your template, you can use the "urlize" templatetag: {{ mymodel.url|urlize }} On May 11, 3:29 pm, Tom wrote: > Thank you Michael, > > Can you explain me the "Clean" way to do that ? > > On May 8, 2:45 pm, Michael wrote: > > > On Fri, May 8,

Re: Wait for file upload to complete?

2009-05-11 Thread zurich
instead of using chunks, you can use: file.seek(0) file_data = file.read() file.close() ex_function() I think the reason tutorial use chunks is because "if the uploaded file is huge it can overwhelm your system if you try to read it into memory. You'll probably want to use chunks()

Re: Design Question

2009-05-11 Thread Sam Chuparkoff
On Mon, 2009-05-11 at 17:31 -0700, Glen Jarvis wrote: > Both forms have a 'name' attribute. And, both forms are in a template > together. (I mean that both form instances are created for the > specific instance of the model in question, and are displayed together > (very interleaved) in a

Re: removing fields in modelformset

2009-05-11 Thread Sam Chuparkoff
On Mon, 2009-05-11 at 10:59 -0700, eric.frederich wrote: > Hmm, thats almost what I need. I guess I didn't fully explain what I > need. > I do need to limit the number of fields that are shown, but I also > need to make some of them view only. I don't think this "view only" feature exists.

Design Question

2009-05-11 Thread Glen Jarvis
Since I've been using Django this past year, I've slowly learned how to be more dynamic and DRY using the Django framework. For example, in the very beginning, if I were using newforms (now forms), I would create a form that mimic'ed the model (unless modelforms were really easy). Now,

Re: Can you add custom logic to the Admin page?

2009-05-11 Thread James Bennett
On Mon, May 11, 2009 at 6:28 PM, Margie wrote: > The answer is definitely yes.  However, some perserverance is required > to figure it out.  I recently found Jannis Leidel's web page (I > believe he is one of the django developers, but not sure about that) > and it

Re: Mysterious problem with pydoc

2009-05-11 Thread aaronelliotross
Ah ha! It's triggered by ForeignKey columns, creating a super simple project ( no db data, no nothin' ) with this models.py shows the problem. $ django-admin.py startproject docstring $ cd docstring/ $ django-admin.py startapp users Edit users/models.py to be: from django.db import models

Re: Display an URLField as a Link

2009-05-11 Thread Michael
On Mon, May 11, 2009 at 4:29 PM, Tom wrote: > > Thank you Michael, > > Can you explain me the "Clean" way to do that ? > Sure, you create a view (or use a generic view) that calls a template and has one of your models like so: from django.shortcuts import

Re: images on development server versus production server

2009-05-11 Thread Michael
On Mon, May 11, 2009 at 3:36 PM, Frutoso wrote: > > So let me get this straight. > > in development enviroment: In order to get images to be displayed in a > template there is a work around that needs to be down? > > in production enviroment: There is not a work

Re: Can you add custom logic to the Admin page?

2009-05-11 Thread Margie
The answer is definitely yes. However, some perserverance is required to figure it out. I recently found Jannis Leidel's web page (I believe he is one of the django developers, but not sure about that) and it provides some really excellent examples of how to create new widgets which override

Re: Strange widget and form problem

2009-05-11 Thread timc3
> [snip] > > "Just updated to trunk" doesn't actually tell us what level you are at.  I > know there was very recently (within the last couple of hours) a fix made > for a recent bug introduced in upload file handling.  I do not not if you > are running with that fix or not. > > So first, make

Re: change query for ModelChoiceField

2009-05-11 Thread adrian
For the record, here's what works: In views.py: if country == 'Canada': delivery_time__lte=time_avail_hours abbrev__contains='SC' formShip = ShippingMethodForm(delivery_time__lte, abbrev__contains) Then in models.py: class ShippingMethodForm(forms.Form): #

Re: user authentication question

2009-05-11 Thread Masklinn
On 11 mai 09, at 23:16, Bobby Roberts wrote: > The question is, is there anyway to take the hashed password and > work it back to plain text so it can be used in login? Is there > another way to do this? Can it even be done at all? > No. For what it's worth, a better

Re: Custom File Handling Through admin

2009-05-11 Thread rpupkin77
NOTE: I don't need help with the Brightcove API, I have a Python library written for that, I need to intercept the file handler and use my BC logic and then insert the rest of the Meta Data into our DB. On May 11, 5:45 pm, rpupkin77 wrote: > Hi, > > I need to have a

Custom File Handling Through admin

2009-05-11 Thread rpupkin77
Hi, I need to have a FileField from a model handled differently than the out of the box functionality, In short I need to add it to the a Brightcove account through their API, can someone give me a really brief rundown of how I would do this? I know it is a broad question, but I am a little

Re: change query for ModelChoiceField

2009-05-11 Thread adrian
oops! missing the filter_string arg in __init__. After I added that, I get: ValueError .too many values to unpack On May 11, 4:27 pm, adrian wrote: > I tried in the view: > > filter_string = "delivery_time__lte=time_avail_hours, > abbrev__contains='SC'" > formShip =

Re: change query for ModelChoiceField

2009-05-11 Thread adrian
I tried in the view: filter_string = "delivery_time__lte=time_avail_hours, abbrev__contains='SC'" formShip = ShippingMethodForm(filter_string) Then the form def is: class ShippingMethodForm(forms.Form): # tricky thing done here to change queryset based on ticket date and destination

Re: user authentication question

2009-05-11 Thread Bobby Roberts
*hashed On May 11, 5:16 pm, Bobby Roberts wrote: > hi group - > > i've read the docs but can't find an answer to a particular question. > In theory it's quite simple but I need help.  Our company has a > central database system from which we authenticate. The idea is to let

user authentication question

2009-05-11 Thread Bobby Roberts
hi group - i've read the docs but can't find an answer to a particular question. In theory it's quite simple but I need help. Our company has a central database system from which we authenticate. The idea is to let employees have a central login across websites. In other words, if they login

Re: change query for ModelChoiceField

2009-05-11 Thread google torp
This should fix it. def __init__(self, something, *args, **kwargs): super(ShippingMethodForm, self).__init__(*args, **kwargs) self.fields["ship_method"].queryset = ShippingMethod.objects.filter(something) when you initiate the form, you do it like this: form =

Re: ajax cascading select boxes

2009-05-11 Thread google torp
Using AJAX in python/django is not much different than any other tech. You choose an url, maybe just your form url and then you make your normal javascript function that will post data to the url. In the view you can check for is_ajax(). This will enable you to catch all ajax requests and serve

Customizing Admin Save Functionality

2009-05-11 Thread rpupkin77
Hi, Is there a list of admin blocks ie (form_top) somewhere, all I know are form_top and extra_head. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

How to create a newforms label unattached to an input field?

2009-05-11 Thread Nash-t
I apologize if this is a dumb newbie question... I am trying to create a newform label that doesn't have an associated input field. This label is used as a title for a set of input fields. I don't want to use django templates because of the way the form/data is passed around and saved on the

change query for ModelChoiceField

2009-05-11 Thread adrian
I want to create a form with a select box populated from a query that I pass from the view. For example: if country == 'Canada': methods = ShippingMethod.objects.filter( delivery_time__lte=time_avail_hours, abbrev__contains='SC' )

Re: Display an URLField as a Link

2009-05-11 Thread Tom
Thank you Michael, Can you explain me the "Clean" way to do that ? On May 8, 2:45 pm, Michael wrote: > On Fri, May 8, 2009 at 3:26 PM, Tom wrote: > > > My model : > > > url = models.URLField(max_length=500,blank=True,verify_exists=False) > > > and

Re: Annotations

2009-05-11 Thread Andy Lei
works great, thanks george! does anybody know if this is possible to do directly with the ORM? On May 7, 10:41 pm, George Song wrote: > On 5/7/2009 4:28 PM, Andy Lei wrote: > > > > > I have 3 models.  Something like this: > > > Writer: > >      content = ManyToMany(Content)

Re: Random locale strings translated

2009-05-11 Thread rskm1
On May 11, 3:47 am, phred78 wrote: > I've specified translation string, got the translations done and > compiled. > > It's working for the most part, but some of the strings don't show up > correctly translated, where others do. > What could be causing this? Has anyone come

images on development server versus production server

2009-05-11 Thread Frutoso
So let me get this straight. in development enviroment: In order to get images to be displayed in a template there is a work around that needs to be down? in production enviroment: There is not a work around? simply create an tag and enter path to image files? Please explain this in more

Re: URLField verify_exists fails

2009-05-11 Thread Malcolm Tredinnick
On Mon, 2009-05-11 at 11:47 -0700, Roodie wrote: > Now that's interesting. Must be some mis-configuration on the > server side, since I can see the URL just fine, both in my bowser > and from the python console: What do you mean by "see", especially for the browser case? Sure, it returns

Quoting in extra(select=...) expression

2009-05-11 Thread lemming110
I am trying to use the select keyword in extra. But I cannot properly quote the the expression for postrgres. I am using the django.contrib.comments. I started with this snippet http://www.djangosnippets.org/snippets/1101/ which returns the number of comments for an object. However, the code

Re: mymodel.save() does not work in django but works in python shell

2009-05-11 Thread Karen Tracey
On Mon, May 11, 2009 at 1:22 PM, NoviceSortOf wrote: > Now get this -- if I add a 'return' to the end of the function it adds > the rows -- why is this? > This, combined with the sequence number increasing but being unable to actually see rows added, makes me think

Re: URLField verify_exists fails

2009-05-11 Thread Roodie
Now that's interesting. Must be some mis-configuration on the server side, since I can see the URL just fine, both in my bowser and from the python console: >>> from httplib import HTTP >>> from urlparse import urlparse >>> p = urlparse('http://www.harmat.hu/') >>> h = HTTP(p[1]) >>>

Re: URLField verify_exists fails

2009-05-11 Thread Malcolm Tredinnick
On Mon, 2009-05-11 at 11:35 -0700, Roodie wrote: > Hello, > > One of our testers reported a strange issue - sometimes thr URLField > does not accept a valid, existing URL. I verified it on my local > developer laptop also. The mentioned URL is: > > http://www.harmat.hu/ > > The site exists, I

URLField verify_exists fails

2009-05-11 Thread Roodie
Hello, One of our testers reported a strange issue - sometimes thr URLField does not accept a valid, existing URL. I verified it on my local developer laptop also. The mentioned URL is: http://www.harmat.hu/ The site exists, I even checked for it manually in PyCrust using urllib. It sill

Re: Can you add custom logic to the Admin page?

2009-05-11 Thread Wayne Molina
I'll check those out - thanks! --~--~-~--~~~---~--~~ 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

Re: Need a binary database field for a Django application.

2009-05-11 Thread Will Kraytos
On May 11, 7:55 am, Karen Tracey wrote: > Have you investigated creating your own custom field: > > http://docs.djangoproject.com/en/dev/howto/custom-model-fields/ Thanks, I did look at that briefly. Was hoping there was some sort of built-in support that wouldn't require me

Re: Can you add custom logic to the Admin page?

2009-05-11 Thread ChrisWSU
Dojango has a template tag being developed that can generate a public facing list that can be extended (using dojo). similar to(and modeled after) the admin change list. http://code.google.com/p/dojango/wiki/DojangoDatagrid May or may not be helpful... Chris On May 11, 10:09 am, Wayne Molina

Re: Html inside {% blocktrans %} tags

2009-05-11 Thread rskm1
On May 8, 8:06 pm, Stephen Sundell wrote: > Can I wrap something like : "Click here to go > back." inside a blocktrans tag? Certainly! The only caveat is that the person doing the translation work (often a hired contractor, sometimes from outside of the Computer-

Mysterious problem with pydoc

2009-05-11 Thread aaronelliotross
Hi all, I'm trying to track down a confusing problem with pydoc and my Django models. I'm hoping it's something obvious that I'm overlooking. The problem is that pydoc and friends simply return the default Django docstring, e.g. [aaron]$ DJANGO_SETTINGS_MODULE=settings pydoc

Re: removing fields in modelformset

2009-05-11 Thread eric.frederich
Hmm, thats almost what I need. I guess I didn't fully explain what I need. I do need to limit the number of fields that are shown, but I also need to make some of them view only. For example, this is on a relation table between an Offering object and a User object called Enrollment. I don't want

return jquery json variable to template variable

2009-05-11 Thread snorkel
I have a complex page of data and want to sort various columns of the db so... the way I am trying to do it is with jquery but I don't know how I can get the variable returned by the jquery function into my template maybe I should be using custom template tage for this? Here is a very stripped

Re: After a form submit, getting user info into an attribute while still using generic views?

2009-05-11 Thread George Song
On 5/11/2009 4:04 AM, Lior wrote: > Hello, > I'm using generic views to manage a model. In that model, when I > create an instance (and not when I update it), I need to set one of > its attribute (owner) to the currently logged in user value. I'd like > to continue using generic views, so can I

Re: mymodel.save() does not work django view but works in python shell

2009-05-11 Thread NoviceSortOf
> Michael I appreciate your answer... I omited in my code example was the assert False that was being used to debug the problem, so intuitively you were right something was wrong with the code With the assert False though it was bringing up the debugger and I could view the variables. Without

Re: mymodel.save() does not work in django but works in python shell

2009-05-11 Thread NoviceSortOf
Thanks for your reply, I'm thinking and working outloud on the answers that follow, I've a solution sort of but remain mystified as to why and how it works. > How are you deciding it's not working? via pgAdminIII where I can see the sequence table being incremented + 1 on every django save but

How to call default 'upload_complete' for files?

2009-05-11 Thread tm
I need to process a file after it finishes uploading, but for some reason 'destination.write(chunk)' doesn't seem synchronous, ie. if I put some code directly after it, it gets called before the file is completely saved. Anyone else experiencing this? Any help greatly appreciated. Thanks, T

Re: mymodel.save() does not work django view but works in python shell

2009-05-11 Thread Michael
On Mon, May 11, 2009 at 11:05 AM, NoviceSortOf wrote: > > from views.py > > def testit(): >from myproject.models import NewCust >p1 = NewCust() ## Create blank instance >p1.zipcode = '222' ## Load something into it. >p1.last_name = 'Smith'

Re: Can you add custom logic to the Admin page?

2009-05-11 Thread Phil Mocek
On Mon, May 11, 2009 at 08:09:39AM -0700, Wayne Molina wrote: > What I want to know is if it's possible to "extend" the admin > site by adding my own views and templates This is something in which lots of people are likely to be interested. So that others can benefit from your research, please

Re: class for form fields

2009-05-11 Thread CrabbyPete
Thanks On May 11, 12:06 pm, David Zhou wrote: > On Mon, May 11, 2009 at 12:04 PM, CrabbyPete wrote: > > > I just started using forms and I have the following html > > Zip Code: > size="15" maxlength="15"> > > > How do you specify the class type for the

Re: class for form fields

2009-05-11 Thread David Zhou
On Mon, May 11, 2009 at 12:04 PM, CrabbyPete wrote: > > I just started using forms and I have the following html > Zip Code: size="15" maxlength="15"> > > How do you specify the class type for the input field. See:

class for form fields

2009-05-11 Thread CrabbyPete
I just started using forms and I have the following html Zip Code: How do you specify the class type for the input field. I created a form class Address(form.Forms) zip = forms.CharField(label = 'Zip Code:',max_length = 15) This changes the label Zip Code: {{ form.zip }}

Re: removing fields in modelformset

2009-05-11 Thread Sam Chuparkoff
On Mon, 2009-05-11 at 07:55 -0700, eric.frederich wrote: > Hello, > > I need to set up a view for administrators of an application that I am > writing where they can edit a subset of fields on a particular model. > It was pretty simple... > > EnrollmentFormSet = modelformset_factory(Enrollment,

Re: mymodel.save() does not work in django but works in python shell

2009-05-11 Thread Karen Tracey
On Mon, May 11, 2009 at 11:32 AM, NoviceSortOf wrote: > > > An observation I've made it that django does update the related > sequence_id table of the table but does not add a row to the table. > How are you deciding it's not working? Are you seeing errors? Does the

Re: ModelForm customizing

2009-05-11 Thread Karen Tracey
2009/5/11 Julián C. Pérez > > anyone?? > pleeease?? > :D > > On 10 mayo, 09:15, Julián C. Pérez wrote: > > anyone?? any help?? > > :) > > > Please stop doing this. Cluttering an already high-traffic list with daily "please help" notes isn't of any use to

Re: mymodel.save() does not work in django but works in python shell

2009-05-11 Thread NoviceSortOf
An observation I've made it that django does update the related sequence_id table of the table but does not add a row to the table. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Can you add custom logic to the Admin page?

2009-05-11 Thread Wayne Molina
Basically I am a newbie to Django (and Python in general) but I really like the functionality the Admin page gives you; it's absolutely awesome to add a line or two of Python and have, for example, a search bar instantly added, or have a log built in. I have an idea for an application that 90%

Re: Strange widget and form problem

2009-05-11 Thread Karen Tracey
On Mon, May 11, 2009 at 8:25 AM, timc3 wrote: > > I have just updated to trunk and now I get a problem uploading files > into a filefield so I did an interactive session in shellplus and got > the following: > [snip] "Just updated to trunk" doesn't actually tell us what level

mymodel.save() does not work django view but works in python shell

2009-05-11 Thread NoviceSortOf
.save() is not working for me either with models or with forms in django. I'll start with a simple example, on a single non related table. from views.py def testit(): from myproject.models import NewCust p1 = NewCust() ## Create blank instance p1.zipcode = '222'

Re: Need a binary database field for a Django application.

2009-05-11 Thread Karen Tracey
On Mon, May 11, 2009 at 6:08 AM, Will Kraytos wrote: > Hi there, > > My company's application needs to store binary data in the database. I need > it to work at least across the two database systems we're currently using: > Postgres (bytea) for production, SQLite3 (BLOB)

removing fields in modelformset

2009-05-11 Thread eric.frederich
Hello, I need to set up a view for administrators of an application that I am writing where they can edit a subset of fields on a particular model. It was pretty simple... EnrollmentFormSet = modelformset_factory(Enrollment, extra=2) def offering_admin(request, offering_id): offering =

Re: Need help for using facebook api

2009-05-11 Thread Karen Tracey
On Mon, May 11, 2009 at 3:50 AM, laspal wrote: > > Hi, > I am trying to build facebook app but ran into problem. > > here is the code: > > [snip]from django.http import HttpResponse > from django.views.generic.simple import direct_to_template > > import facebook.djangofb

Re: error saving in admin after migrating a .90 site to postgresql8.3.x

2009-05-11 Thread Karen Tracey
On Mon, May 11, 2009 at 3:16 AM, Kenneth Gonsalves wrote: > > hi, > > I know .90 is not supported, but if any old hand could help me out I will > be > grateful. I migrated an old .90 site to postgres8.3, python2.5. No > problems, > it worked. Only in one model I am unable

Re: ModelForm customizing

2009-05-11 Thread Julián C . Pérez
anyone?? pleeease?? :D On 10 mayo, 09:15, Julián C. Pérez wrote: > anyone?? any help?? > :) > > > hi all > > something like this had already been > > reported:http://code.djangoproject.com/ticket/6138 > > > i tried sean's solutions but nothing happens... > > stand by... > >

Re: What debugger do you use?

2009-05-11 Thread Joshua Partogi
I don't know anything that is better than NB with Python plugin right now. I've tried IntelliJ with Python plugin, but it was quite heavy (on Linux at least) :-( But I really like how IntelliJ treats refactoring like the Java refactor browser. I also tried PyDev but the click-on-module-name is

Re: adding columns to a many to many

2009-05-11 Thread Karen Tracey
On Mon, May 11, 2009 at 2:28 AM, mickey wrote: > > Hi > > So i have something like t his in my model: > > article = models.ManyToManyField(Publication) > > But i'd like to add a few additoinal columns like date_published on > the generated many to many table, how do i do

Re: Security with a solo Administrator?

2009-05-11 Thread Dougal Matthews
Why not use django.contrib.auth and only allow super users to access said pages? Or use django's permission system? Dougal --- Dougal Matthews - @d0ugal http://www.dougalmatthews.com/ 2009/5/11 andrew > > Hi,all > >I'm designing a series of admin pages that only

Invalidate a cache_page view

2009-05-11 Thread Peter Bengtsson
I have this @cache_page(MANY_HOURS) def foo(request): calculate_something_complex() ... @login_required def bar(request): change_complex_data() #here I want to invalid foo()'s cache ... But other actions elsewhere will need to invalidate the cache for this. I could do a

Re: environment variable DJANGO_SETTINGS_MODULE is undefined

2009-05-11 Thread bconnors
thanks for the advice, but #set DJANGO_SETTINGS_MODULE=mysite.settings #python manage.py syncdb --settings=settings # ln -s /usr/lib/python2.5/site-packages/pinax /home/pubuntu/pinax # python manage.py suncdb #curl -o pinax-boot.py http://svn.pinaxproject.com/pinax/trunk/scripts/pinax-boo t.pt

Django-admin link to master model

2009-05-11 Thread MS
Hi Users;) I have two simple master-slave models (with ForeignKey). I activated the admin app to be able to manage the data. The problem is that when I edit my slave model I can change its master with a 'select' control. I wish I could have a link to master edit page instead of (or in addition

Security with a solo Administrator?

2009-05-11 Thread andrew
Hi,all I'm designing a series of admin pages that only one admin can logon ,I think there is no need to setup a single table to store only one entry which contain "name""password" . So , I think ,is this way safe enough to ensure secure my admin access? def login_admin(request):

Re: i18n of words that switch place in a sentence

2009-05-11 Thread Ramiro Morales
On Mon, May 11, 2009 at 10:11 AM, Bastien wrote: > > Hi, > > I'm sure this is in the doc but I can't find it. Is there a way to > change a word's place in a sentence according to the language setting? > > What I need is to translate the term 'ago' from english to a

i18n of words that switch place in a sentence

2009-05-11 Thread Bastien
Hi, I'm sure this is in the doc but I can't find it. Is there a way to change a word's place in a sentence according to the language setting? What I need is to translate the term 'ago' from english to a few other languages that place it in front of the time, an example will explain it better:

What debugger do you use?

2009-05-11 Thread Joshua Russo
I'm currently using Netbeans 6.5 with the Python plugin. I was just wondering what everyone else is using because NB is a bit buggy with the Python plugin at the moment. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: django ifequal crush in chinese

2009-05-11 Thread feng Tang
thanks Karen: i solved the problem, using u''[constant string like chinese charactor]'. i think using u'' means the string should be processed as unicode charactor, inside python ,change all to unicode to process. thanks again --~--~-~--~~~---~--~~ You

Strange widget and form problem

2009-05-11 Thread timc3
I have just updated to trunk and now I get a problem uploading files into a filefield so I did an interactive session in shellplus and got the following: In [1]: from testsite.media.forms import MediaObjectForm In [2]: d = {u'path': "my test image.png"} In [3]: f = MediaObjectForm(d) In [4]:

Re: Category list in Django

2009-05-11 Thread Andy Mikhailenko
Hi, > in register dispatcher.connect(pre_save, > signal=model_signals.pre_save, sender=modem) > AttributeError: 'module' object has no attribute 'connect' Looks like it's time to update your Django installation. regards, Andy --~--~-~--~~~---~--~~ You received

After a form submit, getting user info into an attribute while still using generic views?

2009-05-11 Thread Lior
Hello, I'm using generic views to manage a model. In that model, when I create an instance (and not when I update it), I need to set one of its attribute (owner) to the currently logged in user value. I'd like to continue using generic views, so can I do this without creating a view? Is that

Re: Internationalization (i18n) of model: request.LANGUAGE_CODE in __unicode__ and ordering?

2009-05-11 Thread Wouter van der Graaf
Hi Tom, Thanks for sharing your thoughts. Indeed, I need ordering based on the translations. If I'd use gettext for database field record translations, then ordering must be done afterwards (after db query). Is that even possible and what would be the performance cost? And how could I tell the

Re: autofilling select boxes

2009-05-11 Thread newbie
It wud be of great help if u cud post the code. On May 11, 1:25 pm, Bastien wrote: > Hi, > > I have just done it, using jquery, and I'm also new to this but it was > very easy. The logic I used is as follow: > I had a preexisting view where a user selects various

ANN: Demo online shop for LFS

2009-05-11 Thread Kai Diefenbach
Hi, I'm pleased to announce that there is new demo shop for LFS: http://demo.getlfs.com LFS is an online shop based on Django (of course) and distributed under the BSD-License For more information please visit http://www.getlfs.com, subscribe to our feed http://www.getlfs.com/feeds/news or

Random locale strings translated

2009-05-11 Thread phred78
Hi, I'm building a multilingual website and using django-localeurl so I can get /fr/, /en/, etc in the url. I've specified translation string, got the translations done and compiled. It's working for the most part, but some of the strings don't show up correctly translated, where others do.

Re: autofilling select boxes

2009-05-11 Thread Bastien
Hi, I have just done it, using jquery, and I'm also new to this but it was very easy. The logic I used is as follow: I had a preexisting view where a user selects various criteria to add to a blog entry like theme, geographical zone, tags... a jquery script tracks the user inputs and for each

Re: Hidden field in Admin without label

2009-05-11 Thread PierreR
Thanks Andy, I don't know if there is a good way to do this without hacking the admin too much. I have been trying to get all hidden fields in a separate fieldset which seem more in line with the "fieldset" philosophy. I have created an __init__ method in my custom admin class (the one that

Need help for using facebook api

2009-05-11 Thread laspal
Hi, I am trying to build facebook app but ran into problem. here is the code: from django.http import HttpResponse from django.views.generic.simple import direct_to_template import facebook.djangofb as facebook from fblaspal.models import FacebookUser @facebook.require_login() def

Help in installing Django in my webhost

2009-05-11 Thread anandanbu
Hi all I got myself an account in the ambitiouslemon. I would like to install the Django web frame work in my space since they provide Python 2.5 and other required softwares. I have not deployed Django other than my home machine running LAMP. So i would like to get help in installing Django in

error saving in admin after migrating a .90 site to postgresql8.3.x

2009-05-11 Thread Kenneth Gonsalves
hi, I know .90 is not supported, but if any old hand could help me out I will be grateful. I migrated an old .90 site to postgres8.3, python2.5. No problems, it worked. Only in one model I am unable to save or modify in admin. The model is: class Match(meta.Model): name =

Re: ajax cascading select boxes

2009-05-11 Thread newbie
First of all, thanks for the reply :) On May 11, 11:59 am, google torp wrote: > So CustomUser and UserDetails  is a model you made for your > users? If that is the case, you probably want to hook use a > modelform instead is it makes things a bit eaiser. > yup. Those two

Re: ajax cascading select boxes

2009-05-11 Thread google torp
So CustomUser and UserDetails is a model you made for your users? If that is the case, you probably want to hook use a modelform instead is it makes things a bit eaiser. Anyways in your view, the user just pops out of the blue. My guess is that you need to do something like user =

ajax cascading select boxes

2009-05-11 Thread newbie
Hi, I'm a newbie to Django. I have a form which has some attributes to be filled by the user viz., name, age, address etc. I want to get the address of the user by just allowing him making the selections rather than letting him fill it. I'm planning to give him a select box for

adding columns to a many to many

2009-05-11 Thread mickey
Hi So i have something like t his in my model: article = models.ManyToManyField(Publication) But i'd like to add a few additoinal columns like date_published on the generated many to many table, how do i do that? Thanks. --~--~-~--~~~---~--~~ You received this

Re: autofilling select boxes

2009-05-11 Thread jai
You can use Dojo or jquerry. On May 11, 10:44 am, newbie wrote: > Hi, > >           I'm new to django and also ajax. I want to create a form > which has a select box and based on the selection made, the options of > another select box are generated. I've achieved this task

Re: django decimal field query issue

2009-05-11 Thread jai
Thanks for your reply. We are already using geodjango for latitude and longitude manipulation. But i want to store decimal (float) data, for that purpose i selected 'DecimalField'. But the actual problem is when ever i tried to execute the below query, it always fails

Re: Trouble Starting Up with runserver

2009-05-11 Thread Chris DPS
ping localhost seemed fine, 4 sent and 4 received, 0ms, 0% loss I have tried 127.0.0.1:8000, :8000, 0.0.0.0:8000, 127.0.0.1:others On May 10, 9:52 pm, Addy Yeow wrote: > What does 'ping localhost' in command-prompt tells you?Did you try 'python > manage.py runserver

  1   2   >