Re: returning related field as part of __str__() method?

2006-08-23 Thread Ivan Sagalaev
[EMAIL PROTECTED] wrote: > I apologize in advance if this is a stupid question - I'm new to > Django, and a little over my head (but loving it!) > > I'm trying to return a field from a foreign key relationship as part of > my __str__ method. When I do, I get this output in the admin interface: >

Re: Foreign key spaghetti

2006-08-23 Thread Sybren Stüvel
Hi folks, I don't like replying to my own mails, but I'm working against a deadline here. Is it possible to do what I want? Luke wrote: > limit_choices_to is (essentially) a class level attribute, and has > no access to instance level data. which probably means that I can't do what I want base

Is this a transaction use case?

2006-08-23 Thread [EMAIL PROTECTED]
Hi all, i have the following scenario for a real-estate search engine: "Ad" table where i define the properties of the ad such as created_on, expires_on, user_id and is related with a 1-1 FK to the "Property" table which defines stuff such as sq_feet, district_id etc... I'd like to keep them se

Re: Lost in the Admin section...

2006-08-23 Thread Reinhard Knobelspies
Regarding (7) and (8) you might want to have a look at http://www.vonautomatisch.at/django/filebrowser/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djan

Re: extract keywords from model

2006-08-23 Thread richard mendes
Thanks i will take a look at it and see if i can use it. richard --~--~-~--~~~---~--~~ 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 unsubscri

Re: TinyFCK or FCKEditor image uploader

2006-08-23 Thread Scater
http://groups.google.com/group/django-users/browse_thread/thread/a28f4d79a801ae5e/4011309ec4836dff?lnk=gst&q=FCKeditor&rnum=2#4011309ec4836dff --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

HTTPS access

2006-08-23 Thread zenx
"Ruby has different libraries that provide higher-level access to network protocols such as FTP, HTTP or HTTPS. This article shows the usage of net::http, net::https, open-uri and the rio library." (http://www.juretta.com/log/2006/08/13/ruby_net_http_and_open-uri/) I would like django to connect

Re: HTTPS access

2006-08-23 Thread Ian Holsman
does urllib2 ( http://pydoc.org/2.4.1/urllib2.html ) do what you need? On 23/08/2006, at 7:54 PM, zenx wrote: > > "Ruby has different libraries that provide higher-level access to > network protocols such as FTP, HTTP or HTTPS. This article shows the > usage of net::http, net::https, open-uri an

Re: HTTPS access

2006-08-23 Thread zenx
Oh yes!!! Thank you Ian! I've search for more info about urllib2 and I have come to this: http://www.holovaty.com/blog/archive/2004/06/20/0242 It seems that Adrian had already created a python interface to Gmail using urllib2 :D Thank you for your help and thanks to Adrian, too! --~--~

Webdav access - OT

2006-08-23 Thread toth anna
I need to provide webdav access (upload) to my customer. Problem is, uploaded files should hold not in filesystem, but in database (which other "end" is in django). Our diversified solutions are converges to python, so i'm searching for pythonic way. Google gives me a lot of hits about webdav clie

Re: Custom upload fields and filters

2006-08-23 Thread Jay Parlar
On 8/22/06, Enrico <[EMAIL PROTECTED]> wrote: > > Hi all, > > I've made custom file upload fields with some extra features: > > - automatic upload_to path (based on app/model/field names) > - automatic renaming the filename based on the primary key > - maximum width and/or height for images > > I'

Re: Multiple rows in a form

2006-08-23 Thread Stewart
Hi Thanks for the reply. I *think* I get the forms stuff generally, the bit I'm having trouble with is having a maniplator deal with a list of objects of the same type. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Grou

Re: Is this a transaction use case?

2006-08-23 Thread DavidA
[EMAIL PROTECTED] wrote: > Hi all, > > i have the following scenario for a real-estate search engine: > > "Ad" table where i define the properties of the ad such as created_on, > expires_on, user_id and is related with a 1-1 FK to the "Property" > table which defines stuff such as sq_feet, distri

Re: Is this a transaction use case?

2006-08-23 Thread [EMAIL PROTECTED]
DavidA wrote: > The identity value is set in the new instance once you call save so you > can simply do this: > > p = Property(sq_feet=2300, ...) > p.save() # now p.id is set > > a = Ad(property=p, ...) > a.save() > > The equivalent of the @@Identity trick is handled during 'save'

Re: Passing user.is_superuser through form

2006-08-23 Thread cyberco
Thanks to everyone here, this really helped me out. One thing I still have questions about it Eric's remark: > --- > Take note that, since the is_superuser is not a required field, iirc, > you don't have to set it in new_data if your intent leave the value the > same. > --- I indeed want to keep

Re: Custom tags and template inheritance

2006-08-23 Thread Enrico
Makes sense. :) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED

upload files to another server

2006-08-23 Thread zenx
I was reading some django performance tips: http://www.jacobian.org/writing/2005/dec/12/django-performance-tips/ One of them is: "Use a separate media server" But how could I upload files with Django FileField or ImageField to another webserver than the one using django? --~--~-~--~~

Re: Custom upload fields and filters

2006-08-23 Thread Enrico
I've never edited a wiki, but seems easy, I'll post the code soon. Regards. Enrico --~--~-~--~~~---~--~~ 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@googlegroup

IN field lookup with empty list

2006-08-23 Thread Enrico
Hi, I realized that using the IN field lookup with an empty list, it generates a SQL error (at least on MySQL). Maybe the lookup could check if the list is empty before writing the SQL condition. I know that I could the check myself before applying the filter, but doing directly on the DB api c

Re: django cannot connect to mysql after upgrade

2006-08-23 Thread garaged
On 8/22/06, Baczek <[EMAIL PROTECTED]> wrote: > > Just wanted to add that I got hit by that too, just now. Hoping for a > quick fix here or in django... http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=383603 python-mysqldb_1.2.1-p2-3_i386.deb <-- Corrects the problem Max -- -BEGIN GEEK CO

sqlite3+mod_python problems?

2006-08-23 Thread Wiktor Grębla
Hi. Today I've been trying (preparing) to switch from my testing configuration (lighttpd+flup+django-fastcgi) to apache+mod_python, so far without success . From my point of view, there is something wrong happening between sqlite and mod_python, but the error messages look enigmatic. I've c

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread James Mulholland
Does nobody have any ideas about this?!? I stumbled across a link which tells part of the story, so I now think it's more correct to use this: def save(self, data): temp = Message( contact_type = data['contact_type'], mobile_number = data['mobile_number'],

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread Ivan Sagalaev
James Mulholland wrote: > temp.set_teams(data['teams']) > temp.save() This looks like 0.91 syntax that was changed in 'magic-removal' process. Now it should look like this: temp = Message(...) temp.save() for id in data['teams']: temp.teams.add(Team(id)) BTW, sav

Re: upload files to another server

2006-08-23 Thread Gabriel Puliatti
On 8/23/06, zenx <[EMAIL PROTECTED]> wrote: > But how could I upload files with Django FileField or ImageField to > another webserver than the one using django? I think it meant something like a separate server, not a machine. Like using apache to run Django and lightTPD to serve the media files

Re: upload files to another server

2006-08-23 Thread Jay Parlar
On 8/23/06, Gabriel Puliatti <[EMAIL PROTECTED]> wrote: > > On 8/23/06, zenx <[EMAIL PROTECTED]> wrote: > > But how could I upload files with Django FileField or ImageField to > > another webserver than the one using django? > > I think it meant something like a separate server, not a machine. > >

Uses cases for dynamically changing MEDIA_URL

2006-08-23 Thread Rob Hudson
We've got a couple of cases in our current PHP libraries that we're trying to find equivalents for in Django. Here are a few scenarios we have currently to pull media (mostly videos) from different places depending on the user or user preferences... 1. During development and testing we host the

Connecting FCKeditor's Image Browser to Django

2006-08-23 Thread Nathan R. Yergler
Following up on my message last week, I've released a simple connector to connect FCKeditor's image browser to a Django application. You can find the project at http://code.google.com/p/django-fckconnector/, and basic documentation in http://django-fckconnector.googlecode.com/svn/trunk/fckeditor_

Re: Image validation works only once

2006-08-23 Thread Ian Clelland
On 8/22/06, cyberco <[EMAIL PROTECTED]> wrote: > > In my model: > > = > image = models.ImageField(upload_to='pics', > validator_list=[validators.isValidImage], blank=True) > = Without looking more closely at the code involved, I'm not sure why you'd

Re: upload files to another server

2006-08-23 Thread zenx
Thank you! I will take a look at it. --~--~-~--~~~---~--~~ 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 emai

Re: Custom upload fields and filters

2006-08-23 Thread Enrico
That's it, my first wiki page. :) http://code.djangoproject.com/wiki/CustomUploadAndFilters/ --~--~-~--~~~---~--~~ 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@g

Re: Trouble accessing photos in my template

2006-08-23 Thread keukaman
Thank you. I took your advice and changed "photoid" to "entry". I'm new to this, so can you elaborate a bit on why it's better to name that field 'entry'? SmileyChris wrote: > {% for photo in object.photo_set.all %} > > {% endfor %} > > PS: It would be better to call the field 'entry' rather tha

django.forms.DatetimeField.html2python(data) throwing AttributeError

2006-08-23 Thread mukappa
>>> from django import forms >>> f = forms.DatetimeField(field_name='dt') >>> f.html2python("") >>> f.html2python(None) Traceback (most recent call last): File "", line 1, in ? File "/usr/lib/python2.3/site-packages/Django-0.95-py2.3.egg/django/forms/__init__.py", line 779, in html2python

Post to PayPal with urlllib [newbie question]

2006-08-23 Thread [EMAIL PROTECTED]
I've got a product page that submits to the PayPal shopping cart, and I have form controls on that page with values that need to modify the price. (discount codes) In my research, it appears that I need to post the page to a view, check the discount code, and then send the data via post to the Pa

Re: sqlite3+mod_python problems?

2006-08-23 Thread Michael
I've hit the same problem :(after searching on this group and net I found thatcurently django dosen't work well with sqlite.Try to use mysql or psqlOn 8/24/06, Wiktor Grębla <[EMAIL PROTECTED]> wrote: Hi.Today I've been trying (preparing) to switch from my testingconfiguration (lighttpd+flup+djang

Re: Post to PayPal with urlllib [newbie question]

2006-08-23 Thread Jeremy Dunck
On 8/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > So far, so good, but I'm not sure how to proceed. I should be able to > capture and modify the post data, then urlencode the post values using > urllib, but I cannot figure out how to post the form data AND redirect > the page to the paypa

Re: Trouble accessing photos in my template

2006-08-23 Thread garaged
On 8/23/06, keukaman <[EMAIL PROTECTED]> wrote: > > Thank you. I took your advice and changed "photoid" to "entry". I'm new > to this, so can you elaborate a bit on why it's better to name that > field 'entry'? I will assume I'm actually in the same channel that Chris here. On django models, eve

admin, users, groups and permissions

2006-08-23 Thread Luis P. Mendes
Hi, After setting up the admin interface, I get access to the users and groups list. >From the FAQ, I've read that """ If you'd like to use the admin site to create users, upgrade to the Django development version, where this problem was fixed on Aug. 4, 2006. """ Not only, I'd like to create u

Re: admin, users, groups and permissions

2006-08-23 Thread Jay Parlar
On 8/23/06, Luis P. Mendes <[EMAIL PROTECTED]> wrote: > My admin interface has another issue that I think it was not supposed to > happen. I can see a list of the users but when I try do access each of > them, the web page required is not found. Do I have to insert some url > definitions in the

Re: sqlite3+mod_python problems?

2006-08-23 Thread Wiktor Grębla
Michael napisa³(a): > I've hit the same problem :( > after searching on this group and net I found that > curently django dosen't work well with sqlite. I can't believe it's that bad ;(, if so, I'll have to switch to mysql or postgress. I hope it's gonna be clarified/fixed soon. W. -- Talker

Request object

2006-08-23 Thread victor
Hello, I'm a Java programmer and new to the world of Python and Django. Because of this, I could be missing something obvious trying to access the request object from file urls.py in my project. Is it possible? Where does the request object defined in the views as a parameter come from? Thank y

my private django repository goes public

2006-08-23 Thread dummy
Hi all, I put some packages for django onto sf.net http://svn.sourceforge.net/viewvc/django-userlibs/trunk/ It contains some media packaged ajax toolkits mochikit, prototype, dojo and the wysiwyg-editors tinymce and fckeditor. If anybody has an idea for other libs to be created, please call.

Re: Request object

2006-08-23 Thread James Bennett
On 8/23/06, victor <[EMAIL PROTECTED]> wrote: > Where does the request object defined in the views as a parameter come > from? The request object is instantiated very early on in Django's processing, but it's never passed as any sort of argument that something in the URLs file can work with; Djan

Re: Request object

2006-08-23 Thread victor
Hello James, Thank you for the quick and complete response. I'll check both Django's middleware documentation and your description of Django's request lifecycle. Regards, Victor --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Re: sqlite3+mod_python problems?

2006-08-23 Thread James Bennett
On 8/23/06, Michael <[EMAIL PROTECTED]> wrote: > I've hit the same problem :( > after searching on this group and net I found that > curently django dosen't work well with sqlite. I'm not sure if that's the case here; it seems that it worked fine under the built-in server, and worked fine under F

Admin select multiple ?

2006-08-23 Thread [EMAIL PROTECTED]
Maybe I missed this in the docs but... Is there any way to specify a model that uses choices so that the user can select multiple items? For example: BEDROOMS = ( ('1', '1'), ('2', '2'), ('3', '3'), ('4', '4'), ('5', '5'), ('6', '6'), ) class ApartmentBuilding(models.Mode

'free_comment_form' tag has invalid content-type

2006-08-23 Thread garth
Hi I'm trying to add free comments to my Django App and having problems The following Error shows up. 'free_comment_form' tag has invalid content-type c:\python24\lib\site-packages\Django-0.95-py2.4.egg\django\contrib\comments\templatetags\comments.py in __call__, line 160 line 158 seems to be

Re: Admin select multiple ?

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 5:12 PM, [EMAIL PROTECTED] wrote: > Maybe I missed this in the docs but... Is there any way to specify a > model that uses choices so that the user can select multiple items? Hey Jay -- No, there's no way to do this with ``choices``. I'd suggest just using a ``ManyToManyFi

Re: sqlite3+mod_python problems?

2006-08-23 Thread Wiktor Grębla
James Bennett napisa³(a): > My initial guess is that the problem has to do with permissions on the > filesystem; the built-in server and FastCGI both typically run as your > user on the system, which means they have permission to access > anything your user account can access. > > Apache, however

Re: Uses cases for dynamically changing MEDIA_URL

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 11:16 AM, Rob Hudson wrote: > Are these two scenarios possible in Django? Of course :) Remember -- settings files are just Python code. This means you can include any type of logic in them that you like. I often write settings files that work a bit differently on differ

Re: my private django repository goes public

2006-08-23 Thread garaged
On 8/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi all, > > I put some packages for django onto sf.net > http://svn.sourceforge.net/viewvc/django-userlibs/trunk/ > > It contains some media packaged ajax toolkits mochikit, prototype, dojo and > the wysiwyg-editors tinymce and fckedito

Re: Webdav access - OT

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 5:26 AM, toth anna wrote: > I need to provide webdav access (upload) to my customer. > Problem is, uploaded files should hold not in filesystem, > but in database (which other "end" is in django). > Our diversified solutions are converges to python, so i'm > searching for pytho

Re: IN field lookup with empty list

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 8:27 AM, Enrico wrote: > I realized that using the IN field lookup with an empty list, it > generates a SQL error (at least on MySQL). > [snip] > Any thoughts? I *thought* this was fixed in trunk; what version of Django are you running? If you are on trunk, posting the code

Re: upload files to another server

2006-08-23 Thread Jacob Kaplan-Moss
On Aug 23, 2006, at 8:13 AM, zenx wrote: > I was reading some django performance tips: > http://www.jacobian.org/writing/2005/dec/12/django-performance-tips/ > One of them is: "Use a separate media server" > But how could I upload files with Django FileField or ImageField to > another webserver th

Re: Lost in the Admin section...

2006-08-23 Thread Sean Schertell
On Aug 23, 2006, at 5:32 PM, Reinhard Knobelspies wrote: Thanks for all your help so far everyone. So I'm still in search of answers to these questions: (2) The 24 hour clock widget doesn't work for me. This is a nightclub so shows are almost always listed as 7:00pm or 12:30am etc. (am/pm). Is

FreeComment doesn't work with slugs?

2006-08-23 Thread [EMAIL PROTECTED]
I've been refactoring some stuff to use slugs, and it looks like FreeComment needs an object.id Is this correct or have I missed something? Derek --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" grou

Re: my private django repository goes public

2006-08-23 Thread Ian Holsman
It looks good, and it's BSD licensed as well.. I'm just wondering why you need to include the source of dojo in it? wouldn't it be easier to just link to them and maintain them separately? On 24/08/2006, at 6:43 AM, [EMAIL PROTECTED] wrote: > > Hi all, > > I put some packages for django onto sf.

Re: 'free_comment_form' tag has invalid content-type

2006-08-23 Thread garth
Ok forget this I've found the soultion.. I had a model blog.Post But the {% free_comment_form for blog.post object.id %} should be in lower case. Any reason why this is so. Cheers Garth --~--~-~--~~~---~--~~ You received this message because you are subscri

Re: Webdav access - OT

2006-08-23 Thread Ian Holsman
On 24/08/2006, at 8:31 AM, Jacob Kaplan-Moss wrote: > > This is probably not what you want to hear, but I'd *strongly* > recommend that you not store files in the database. Filesystems are > made for, well, storing files, and it's almost always bad design when > you stuff them into a relational

Re: Uses cases for dynamically changing MEDIA_URL

2006-08-23 Thread Rob Hudson
Great, that looks simple. What about the case for passing in a GET variable being passed in to switch between media coming from localhost vs. the default MEDIA_URL, as in case #2? Most likely I'd grab the GET variable and store it in the session. Can the settings reference session data, or woul

Yet another Django application

2006-08-23 Thread Viktor Kerkez
http://code.google.com/p/zmaj/ is an application for Linux system administration. It's intended to be replacement for Webmin (Yes, a big bite, I know... But I concluded that it's easyer to write the whole application from scratch then to learn Perl and write modules for Webmin ;) Currently 4 mod

Re: Post to PayPal with urlllib [newbie question]

2006-08-23 Thread Derek Hoy
On 8/23/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > ... I should be able to > capture and modify the post data, then urlencode the post values using > urllib, but I cannot figure out how to post the form data AND redirect > the page to the paypal URL in one shot. I'm just about to do the

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread Russell Keith-Magee
On 8/23/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote: James Mulholland wrote:> temp.set_teams(data['teams'])> temp.save()This looks like 0.91 syntax that was changed in 'magic-removal' process.Now it should look like this: temp = Message(...) temp.save() for id in data['teams']:

Re: FreeComment doesn't work with slugs?

2006-08-23 Thread DavidA
[EMAIL PROTECTED] wrote: > I've been refactoring some stuff to use slugs, and it looks like > FreeComment needs an object.id > > Is this correct or have I missed something? > > Derek The FreeComment model assumes the primary key of the object it refers to is an integer, so you can't make the pri

Oh, no, don't evaluate that QuerySet!

2006-08-23 Thread Karen Tracey
I hit an interesting gotcha when passing a QuerySet in a template context: if the template tries to access a nonexistant context variable, the QuerySet gets evaluated. More than that, it gets repr() called on it, which can be quite expensive for a large QuerySet. (In fact it brings my poor machi

Application Prefix

2006-08-23 Thread Vance Dubberly
So I've got this insane requirement that says I need to isolate all my django apps under a prefix ... as suchhttp://www.sitename.com/prefix/I'm not really the kind guy  to hardcode the prefix into all my templates and so on. So I came up with a solution that makes my stomach turn. That is: In settt

Re: Application Prefix

2006-08-23 Thread Russell Keith-Magee
On 8/24/06, Vance Dubberly <[EMAIL PROTECTED] > wrote: So I've got this insane requirement that says I need to isolate all my django apps under a prefix ... as such...Somebody please tell me I've been hitting the crack pipe a bit to hard and that there is a more elegant solution to this silliness,

Re: Yet another Django application

2006-08-23 Thread Sean Schertell
On Aug 24, 2006, at 8:24 AM, Viktor Kerkez wrote: > > http://code.google.com/p/zmaj/ > > is an application for Linux system administration. It's intended to be > replacement for Webmin (Yes, a big bite, I know... But I concluded > that it's easyer to write the whole application from scratch then

Re: Webdav access - OT

2006-08-23 Thread toth anna
Jacob Kaplan-Moss <[EMAIL PROTECTED]> írta: > This is probably not what you want to hear, but I'd *strongly* > recommend that you not store files in the database. Filesystems are > made for, well, storing files, and it's almost always bad design when > you stuff them into a relational datab

Confused on Where to Put SQL

2006-08-23 Thread bradford
It seems like I'm constantly using custom SQL statements, because the ORM won't offer what's necessary to achieve the desired data query/manipulation. Right now I need to wrap up the following in a transaction that will be called a few hundred times in a for loop. delete from table ... create te

Re: Webdav access - OT

2006-08-23 Thread toth anna
Ian Holsman <[EMAIL PROTECTED]> írta: > http://www.atmarkit.co.jp/flinux/special/webdav03/webdav01a.html > describes something similar to what you want by the looks of the > pictures (but in japanese) :) I hope my doctor does not have to learn surgery from japanese boo

Re: Application Prefix

2006-08-23 Thread Ivan Sagalaev
Vance Dubberly wrote: > I'm not really the kind guy to hardcode the prefix into all my > templates and so on. There is not yet officially introduced and documented but working feature (The Right Feature!) for making URLs in your templates to automatically point to your views by their current

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread Ivan Sagalaev
Russell Keith-Magee wrote: > temp = Message(...) > temp.save() > temp.teams = Team.objects.filter(id__in=data['teams']) > > i.e., there is no need to iterate through the data (which isn't really > efficient, since every add is a separate db operation). Instead, you can > assign an iterable to a