Re: Inlineformset_factory and CustomWidget

2008-08-31 Thread multilinux
I solve this problem In ImageWithThumbnailField need replace method "formfield" def formfield(self, **kwargs): defaults = {'widget': ImageWithThumbnailWidget} defaults.update(kwargs) return super(ImageWithThumbnailField, self).formfield(**defaults)

Re: External link hit counter

2008-08-31 Thread Yury Lifshits
Steve, Thanks for the links! I will study the tutorial and will try to apply it for my problem. Looks promising. Yury. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: External link hit counter

2008-08-31 Thread Steve Potter
Your best bet would be to achieve this using Ajax. Check out these basic tutorials: http://www.b-list.org/weblog/2006/jul/31/django-tips-simple-ajax-example-part-1/ http://www.b-list.org/weblog/2006/aug/05/django-tips-simple-ajax-example-part-2/ Steve On Aug 31, 8:00 pm, Yury Lifshits

Inlineformset_factory and CustomWidget

2008-08-31 Thread multilinux
Hi evebody! :) How I may change widget in inlineformset_factory ? I have field (Image with thumbnail - this is Satchmo code), and have custom widget. class ImageWithThumbnailWidget(forms.FileInput): """ A FileField Widget that shows its current image as a thumbnail if it has one.

Fwd: 500 error if django run in scgi mode(fcgi is ok)

2008-08-31 Thread Puzzle Stone
-- Forwarded message -- From: Puzzle Stone <[EMAIL PROTECTED]> Date: Thu, Aug 28, 2008 at 4:23 PM Subject: 500 error if django run in scgi mode(fcgi is ok) To: [EMAIL PROTECTED] Fcgi and scgi work well in my machine when i use django0.96.2, but scgi failed when I try to migrate

Re: Django SVN request.get_full_path() return main.fcgi?

2008-08-31 Thread Jason Cui
Thank you very much, this is the answer. On Aug 31, 11:13 pm, Michael Richardson <[EMAIL PROTECTED]> wrote: > On Aug 30, 11:07 pm, Jason Cui <[EMAIL PROTECTED]> wrote: > > > When I update django SVN yestoday, about from 0.97 to 1.0 beta2, the > > function request.get_full_path() return wrong

Re: inlineformset_factory

2008-08-31 Thread Karen Tracey
On Sun, Aug 31, 2008 at 9:12 PM, cmiller <[EMAIL PROTECTED]> wrote: > > Thanks! That helped. Is your code working without error? It looks a > lot like how I'm doing it. > > Here's the error: > > Exception Type: KeyError > Exception Value: > > Exception Location:

Re: How to do this using Django Model

2008-08-31 Thread Karen Tracey
On Sun, Aug 31, 2008 at 2:05 PM, ydjango <[EMAIL PROTECTED]> wrote: > > How to implement following create table (mysql) using django model. > > CREATE TABLE account_transaction ( > account_id INT NOT NULL, > acct_trans_number INT NOT NULL AUTO_INCREMENT, > PRIMARY KEY

Re: inlineformset_factory

2008-08-31 Thread cmiller
Thanks! That helped. Is your code working without error? It looks a lot like how I'm doing it. Here's the error: Exception Type: KeyError Exception Value: Exception Location: /home/46538/data/python/django/django/forms/ models.py in save_existing_objects, line 294 cmiller On

External link hit counter

2008-08-31 Thread Yury Lifshits
Dear All, How can one implement a hit counter for external link in Django? I am coding a directory of companies [ it's in Russian, http://shopping2.ru/business ]. Every company profile has an external link to company's website. I want to display a number of times this link was clicked. The

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Leaf
You actually wouldn't need to set up the table. The way the sessions framework works is that it returns info already set up in the django_session. All you have to do is call some code that looks something like this to save the session info: if request.session['querysets']:

Re: Slovkian speakers? Help wanted with #8709

2008-08-31 Thread Malcolm Tredinnick
On Sun, 2008-08-31 at 13:21 -0700, Frantisek Malina wrote: > Hi Malc, > I am the author of the language file, I've tested it on a full Satchmo > installation. > I wrote to Vlado Labath, who is the original translator of Django to > Slovak prior to submitting the ticket it directly, but I got no

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Egon Esser
> First off, the server keeps session data, not the browser, Ah, great, learned something new! > but I understand what you're talking about. There's no real way without > extra programming to handle that, but here's a scheme that should be > fairly minimal: > > (1) On the "Search Results" page,

Re: Serving static files?

2008-08-31 Thread djandrow
You may find this useful: http://groups.google.com/group/django-users/browse_thread/thread/73aae22ae6d20de0/dbfe3a60be00d9bb#dbfe3a60be00d9bb You should have apache serve the static content because its much faster. The link I sent you is when I was having problems with it a few weeks ago,

Re: Installing django on 10.4 os x and i cant figure this one out.

2008-08-31 Thread Graham Dumpleton
How are you running 'django-admin.py' and what is the first line of that file? Graham On Sep 1, 1:23 am, Jason Ourscene <[EMAIL PROTECTED]> wrote: > when i run ls -las /usr/bin/python i get: > 8 lrwxr-xr-x   1 root  wheel  9 Jul 21 22:50 /usr/bin/python -> > python2.3 > > when run "which

Re: How to create a list of months from a date field.

2008-08-31 Thread djandrow
I've added the following to my urls.py, i don't know if they work, my server only restarts every so often: (r'^archive/$', date_based.archive_index, archive_info {'template_name': 'blog/archive.html'}), (r'^archive/(?Pd{4})/?$', date_based.archive_year, archive_info {'template_name':

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Egon Esser
> First off, the server keeps session data, not the browser, Ah, great, learned something new! > but I understand what you're talking about. There's no real way without > extra programming to handle that, but here's a scheme that should be > fairly minimal: > > (1) On the "Search Results" page,

Re: spanning relationships

2008-08-31 Thread Steve Holden
andro wrote: > Hello, > > > class Org(models.Model): > person = models.ForeignKey(Person) > > > class Person(models.Model): > address = models.ForeignKey(Address) > ... > > class Address(models.Model): > street = models.CharField(max_length=50) > city =

Re: Slovkian speakers? Help wanted with #8709

2008-08-31 Thread Ivan Sagalaev
Frantisek Malina wrote: > Sadly, I am not aware of any current Slovak Django users. > E.g. First 50 results on http://google.sk/search?hl=sk=lang_sk=django > won't return a single blog-post about Django web framework in Slovak. May be contact one of those: http://djangopeople.net/sk/ ? Gábor

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Leaf
First off, the server keeps session data, not the browser, but I understand what you're talking about. There's no real way without extra programming to handle that, but here's a scheme that should be fairly minimal: (1) On the "Search Results" page, create a new list in the session variable

Re: Changing the AuthenticationForm username's max_length field (impossible!?)

2008-08-31 Thread keltus
Works great. Thanks Julien. On Aug 30, 9:32 pm, Julien Phalip <[EMAIL PROTECTED]> wrote: > Keltus, > > The patch I mentioned in that thread solved the problem of validating > the input. For the rendering of the form, you also need to patch the > widget as follows: > >

Handy tip for Mac OS X Django users

2008-08-31 Thread Leaf
I've recently discovered how incredibly customizable Mac OS 10.5's Terminal can be. For example, I created a custom setup that is useful for Django developers. Whenever it opens, it automatically starts my Django server, and instead of using Ctrl+C to stop the server, I can just press End to both

Re: How to pass queryset to the next request (e.g., search term refinement)?

2008-08-31 Thread Egon Esser
> When the user enterssearchtermsand submits the form it doesn't pass > a queryset object to the view. Your view gets called (with a GET or > POST) and gets passed in arequestobject. You grab the parameters > out of that (preferably using the spiffy Django forms to help you > handle validation)

Re: Nesting inlines with django-admin

2008-08-31 Thread Bojan Mihelac
If this is impossible/hard to achive is maybe possible to achive this with virtual attributes on model that are not mapped to database table and to override save() method on model to save this virtual attributes in specific tables? On Aug 31, 6:25 pm, Bojan Mihelac <[EMAIL PROTECTED]> wrote: >

Re: Slovkian speakers? Help wanted with #8709

2008-08-31 Thread Frantisek Malina
Hi Malc, I am the author of the language file, I've tested it on a full Satchmo installation. I wrote to Vlado Labath, who is the original translator of Django to Slovak prior to submitting the ticket it directly, but I got no answer. In case you don't get any answer form someone else please

Serving static files?

2008-08-31 Thread Robert
Hi, I just got done reading through the 4 django tutorials and they were very helpful. However, I did not find out through the tutorials alone how to serve CSS files along with my HTML. I was told in IRC that these are not directly handled by django. Basically, my main concern is keeping my

Re: Question related to "Writing your first Django app, part 1" tutorial.

2008-08-31 Thread [EMAIL PROTECTED]
You're getting a QuerySet back from filter, so you'll need to index the result, i.e. c[0]. On Aug 31, 5:26 am, Artemis Fowl <[EMAIL PROTECTED]> wrote: > Hello, > > I was starting out to learn Django and was trying the tutorial > presented in the website. In the part when the shell is used to

Re: Django Image thumbnail and save

2008-08-31 Thread julianb
On Aug 31, 6:45 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Can someone please point me in the right direction I got problems after the refactoring, too: http://groups.google.com/group/django-users/browse_thread/thread/230a8601a4839bd9/b707f7fe40e03537#b707f7fe40e03537

spanning relationships

2008-08-31 Thread andro
Hello, class Org(models.Model): person = models.ForeignKey(Person) class Person(models.Model): address = models.ForeignKey(Address) ... class Address(models.Model): street = models.CharField(max_length=50) city = models.CharField(max_length=25) ... -

Re: Template tag i18n failing

2008-08-31 Thread Ramiro Morales
On Sun, Aug 31, 2008 at 2:09 PM, Ramiro Morales <[EMAIL PROTECTED]> wrote: > > This is a bug and has been reported as ticket |1] #7027, you can track > the advance of the issue there. > This is fixed as of revision 8769. cheers, -- Ramiro Morales

How to do this using Django Model

2008-08-31 Thread ydjango
How to implement following create table (mysql) using django model. CREATE TABLE account_transaction ( account_id INT NOT NULL, acct_trans_number INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (account_id,acct_trans_number) ); The above is mysql script. Acct_trans_number has to be unique and

Slovkian speakers? Help wanted with #8709

2008-08-31 Thread Malcolm Tredinnick
All, We're coming down to the wire with 1.0, so I need to throw out a plea to the audience... If anybody speaks Slovakian, could you please have a look at the translation diff attached to ticket #8709 and see if it looks reasonable. This is a case of somebody who is unknown to me submitting a

Re: how do i do background tasks

2008-08-31 Thread Malcolm Tredinnick
On Sun, 2008-08-31 at 09:00 -0700, sotirac wrote: > i'm creating an application that will read rss feeds. i'm using the > universal feed parser library. i have a feed model (has the url to the > feed) and an entry model (for each individual entry). Is there a > method in the model that I have

Re: Using Django with pache

2008-08-31 Thread Donn
On Sunday, 31 August 2008 16:33:32 Weber Sites wrote: > The tutorial suggested to keep "mysite" out of the webroot so where do > i point apache to? Go to the Django site and read the docs about apache and mod_python. It's not that hard really. \d

Re: Template tag i18n failing

2008-08-31 Thread Ramiro Morales
On Sun, Aug 31, 2008 at 1:58 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi, > > I would like to use > {% printformfooter _("Submit Message") "Cancel" %} > > as it is documented here: > http://www.djangoproject.com/documentation/i18n/#in-template-code > > but I get the error: > " >

user preference: Translate words to equivalent words

2008-08-31 Thread ydjango
I want to let users configure some of the words they see on screens: Like default is employee, But some users may want to see word " associate" instead of "employee". another example is "division" and some users want to see word " Business unit" or "group instead of default "division" and I

Template tag i18n failing

2008-08-31 Thread [EMAIL PROTECTED]
Hi, I would like to use {% printformfooter _("Submit Message") "Cancel" %} as it is documented here: http://www.djangoproject.com/documentation/i18n/#in-template-code but I get the error: " TemplateSyntaxError at /project/1/message/create/ printformfooter takes 3 arguments " printformfooter

Django Image thumbnail and save

2008-08-31 Thread [EMAIL PROTECTED]
Hello, before the File storage refactoring I had this code to do the thumbnail of an image and save it. from cStringIO import StringIO from PIL import Image im = Image.open(StringIO(self.cleaned_data['small_photo'].read())) picturefile = StringIO() im.thumbnail((250, 80), Image.ANTIALIAS)

Re: Adding Relation Without Saving

2008-08-31 Thread TiNo
You probably have a list of products somewhere, right? (from a form or other input). Couldn't you just do sum([p.price for p in products]) where products is that list?? On Fri, Aug 29, 2008 at 9:08 PM, Koen Bok <[EMAIL PROTECTED]> wrote: > > I'd like to build relations with objects without

Re: ModelForm, images and exclude

2008-08-31 Thread TiNo
On Fri, Aug 29, 2008 at 6:37 PM, flynnguy <[EMAIL PROTECTED]> wrote: > .. > However there are certain fields I want to set manually so I tried > this: > class AddPhotoForm(ModelForm): >class Meta: >model = Media >exclude = ('type', 'pet', 'views') > > def

Nesting inlines with django-admin

2008-08-31 Thread Bojan Mihelac
Is it possible to nest inlines with django-admin? Using this type of models for example: Poll PollTranslation (this is inline) PollAnswer (this is inline) PollAnswerTranslation (this should be inline of PollAnswer) PollAnswerTranslation objects should be editable on same page. Any hint or

Re: Many to Many field Assignment

2008-08-31 Thread Vadivel Kumar
i see that there exists a handy way -- *icontains* does exactly what iam looking at On Sun, Aug 31, 2008 at 9:35 PM, Vadivel Kumar <[EMAIL PROTECTED]> wrote: > Thanks Michael, > > I solved the problem - i had a silly mistake in the way how i handled to > check the existing tag. But, now the

Re: Many to Many field Assignment

2008-08-31 Thread Vadivel Kumar
Thanks Michael, I solved the problem - i had a silly mistake in the way how i handled to check the existing tag. But, now the problem is when i check the given tag text against the database, i do it as like below, newTag = request.POST['tag'] existingTag =

how do i do background tasks

2008-08-31 Thread sotirac
i'm creating an application that will read rss feeds. i'm using the universal feed parser library. i have a feed model (has the url to the feed) and an entry model (for each individual entry). Is there a method in the model that I have to overwrite that will allow me to retrieve rss entries in

Using Django with pache

2008-08-31 Thread Weber Sites
I'm going over Tutorial01 and Tutorial02 and I'm not sure how to use the admin with Apache. The tutorial suggested to keep "mysite" out of the webroot so where do i point apache to? berber --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Field with RadioSelect widget instead of Select widget

2008-08-31 Thread Bela Hausmann
Thanks, that's a good idea, but if I try it, the choices are gone and i get an empty field. I tried: class ProfileForm(ModelForm): def __init__(self, *args, **kwars): super(ModelForm, self).__init__(*args, **kwars) self.fields['gender'].widget =

Re: Many to Many field Assignment

2008-08-31 Thread Michael Newman
On Aug 31, 11:14 am, "Vadivel Kumar" <[EMAIL PROTECTED]> wrote: > I know this might sound very newbie .. its true > > How can i assign an exising record of the child table to an parent record. > For example I have two models, > >     class User (models.Model): >          ... all other fields ...

Re: Django 1.0 and Textmate

2008-08-31 Thread Michael Newman
A few people including myself are working on: http://www.bitbucket.org/bkerr/django-textmate-bundles/ I really hope to get some time to really get it going in the next week so we can officially announce it. We are definitely looking for more eyes and recommendations on the project. If you want

Re: Installing django on 10.4 os x and i cant figure this one out.

2008-08-31 Thread Jason Ourscene
when i run ls -las /usr/bin/python i get: 8 lrwxr-xr-x 1 root wheel 9 Jul 21 22:50 /usr/bin/python -> python2.3 when run "which python" /usr/bin/python I did not use macports, what i did do was install a later version of python using this tutorial

Many to Many field Assignment

2008-08-31 Thread Vadivel Kumar
I know this might sound very newbie .. its true How can i assign an exising record of the child table to an parent record. For example I have two models, class User (models.Model): ... all other fields ... Tags = models.ManyToManyField(Tag) class Tag (models.Mode):

Re: Django SVN request.get_full_path() return main.fcgi?

2008-08-31 Thread Michael Richardson
On Aug 30, 11:07 pm, Jason Cui <[EMAIL PROTECTED]> wrote: > When I update django SVN yestoday, about from 0.97 to 1.0 beta2, the > function request.get_full_path() return wrong value sometimes. When I > locate urlhttp://domain/detail/list/, this function return /main.fcgi/ > detail/list/, but

Re: formset issue

2008-08-31 Thread patrickk
sorry for being so annoying with this issue, but I´m asking this one more time. - with using inlineformset_factory, my problem is that limiting the choices to the currently logged-in user seems impossible. I´ve just tried to write a custom manger with "use_for_related_fields = True", but it´s

User groups and permissions

2008-08-31 Thread Ca Phun Ung
Hello fellow Djangonauts, I hit a problem with user permissions within the Django admin area. The other day I gave a user add/edit/delete user permissions so that they could manage staff access on the websites. However, in doing this that particular user is now able to create other users with

Form Wizard template URL

2008-08-31 Thread nss350
Hi, I'm using a form wizard, but can't quite seem to figure out how to set the url for it in a template i.e. what do I put in the {% url %} Another unrelated question. If I'm using the included login, logout views, and I'm trying to get the views to redirect to a path set in the template, how

Re: Question about "Writing your first Django app, part 1"

2008-08-31 Thread patrickk
c = Choice.objects.filter(choice__startswith='Just') results in a queryset (not a single object). you could do: for obj in c: obj.poll you have to loop through the items/objects of the queryset, before getting the related poll-object. btw: c[0].poll should also work. On Aug 31, 12:15 

Re: Question about "Writing your first Django app, part 1"

2008-08-31 Thread gordyt
Howdy Artemis, > >>> c = Choice.objects.filter(choice__startswith='Just') > >>> c.poll > > Traceback (most recent call last): >   File "", line 1, in > AttributeError: 'QuerySet' object has no attribute 'poll' Here is what is happening to you. Choice.objects.filter() returns a QuerySet, not a

Question about "Writing your first Django app, part 1"

2008-08-31 Thread Artemis Fowl
Hello, I am starting out with Django and was trying out the tutorial. I was running the code through the shell as given in the document. But to my surprise, I found an anomaly. The tutorial mentions that the Poll object can access the Choice object and vice versa. The code given is >>> c =

Question related to "Writing your first Django app, part 1" tutorial.

2008-08-31 Thread Artemis Fowl
Hello, I was starting out to learn Django and was trying the tutorial presented in the website. In the part when the shell is used to create Poll and Choice objects, it is mentioned that Choice objects have access to Poll and Poll objects have access to Choice. The tutorial uses this example

Re: Installing django on 10.4 os x and i cant figure this one out.

2008-08-31 Thread Graham Dumpleton
Jason Ourscene wrote: > I have some minor programming background. mainly php. > Ive been trying to install python and django for the last 3 hours. > I've gotten to the point where i have everything working. But when i > run the django-admin.py script i get the following error > > Traceback

Installing django on 10.4 os x and i cant figure this one out.

2008-08-31 Thread Jason Ourscene
I have some minor programming background. mainly php. Ive been trying to install python and django for the last 3 hours. I've gotten to the point where i have everything working. But when i run the django-admin.py script i get the following error Traceback (most recent call last): File

Re: No "normalize" in locale(?)

2008-08-31 Thread Prairie Dogg
Sorry about the thread hijack there, I mistakenly thought the problems were related. I'm using Python 2.5 on Ubuntu Hardy. It seems to me that the issue is the project locale directory is in my project folder. The fact that the locale folder for my project is called "locale" is causing a name

Re: Newbie Question - Regex Field to deal with Feet/Inches

2008-08-31 Thread Ronny Haryanto
On Fri, Aug 29, 2008 at 2:54 AM, bkev <[EMAIL PROTECTED]> wrote: > > Ronny, > > This is fabulous...thank you so very much. If you don't mind me > asking, can you give me an example of how you implemented this method > in your Class? In my case, I've defined the field as a DecimalField > type, but

Django SVN request.get_full_path() return main.fcgi?

2008-08-31 Thread Jason Cui
When I update django SVN yestoday, about from 0.97 to 1.0 beta2, the function request.get_full_path() return wrong value sometimes. When I locate url http://domain/detail/list/, this function return /main.fcgi/ detail/list/, but should be /detail/list/. Who can tell me why? Now I have to add