Use django's models without running web server

2007-05-07 Thread hoamon
Because i can't find related post here, so i post this example. maybe someone else need. Some times, you just want to use the useful models of django without thinking any sql statement. Maybe you want to run a script to know which user's birthday in your database is today, this little job should

Re: How to specify name for ForeignKey field?

2007-05-07 Thread Russell Keith-Magee
On 5/8/07, Suraj <[EMAIL PROTECTED]> wrote: > > Hi, > I am trying to use a legacy database in Django. The application > has read only access to this database. This database contains > ForeignKey fields which don't fit Django's format of _id. > Is there any way to specify the ForeignKey fields

Re: How to specify name for ForeignKey field?

2007-05-07 Thread Kenneth Gonsalves
On 08-May-07, at 11:45 AM, Suraj wrote: >I am trying to use a legacy database in Django. The application > has read only access to this database. This database contains > ForeignKey fields which don't fit Django's format of _id. > Is there any way to specify the ForeignKey fields name? if y

How to specify name for ForeignKey field?

2007-05-07 Thread Suraj
Hi, I am trying to use a legacy database in Django. The application has read only access to this database. This database contains ForeignKey fields which don't fit Django's format of _id. Is there any way to specify the ForeignKey fields name? Will same problem occur for ManyToMany fields?

Re: In Admininterface: Error: variable not passed into template?

2007-05-07 Thread Michael Lake
Hi all A while ago I had a problem as described below. I found the solution so am posting it here in case others have the same prob in future. The "Error: variable not passed into template?" was appearing where the headings for the table showing the contents of the Data model should have bee

Images being overridden

2007-05-07 Thread robo
Hi everyone, I've encountered a problem where, in my admin, when I upload an image, I get another slot to upload, but once I upload, the new image replaces the original image I created. I tried searching for a solution to this, but to no avail. Can someone explain to me why this happens and how I

View this page "DataCentrica Advanced IT Technologies Pvt. Ltd."

2007-05-07 Thread zalu
Click on http://groups.google.com/group/django-users/web/datacentrica-advanced-it-technologies-pvt-ltd?hl=en - or copy & paste it into your browser's address bar if that doesn't work. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Is that possible to use DISTINCT with get_list?

2007-05-07 Thread Russell Keith-Magee
On 5/7/07, Pythoni <[EMAIL PROTECTED]> wrote: > > I need to find distinct records form my `discussions` table. > I can use > discussions.get_values(fields=['Subject'],order_by=['Pub_date'],distinct=True) > > and it works. But I would like to find distinct records with > get_list not with get_val

Re: Newform and File Upload problem

2007-05-07 Thread scadink
File uploads haven't been completed in newforms. It's not a great situation, but that's what happens with software that's currently in development. What I did in my view that worked: p = Picture() p.title = clean_data['title'] p.save_image_file(image['filename'], image['content']) Basically, t

Re: Creating extensible views ?

2007-05-07 Thread Russell Keith-Magee
On 5/8/07, kahless <[EMAIL PROTECTED]> wrote: > > i guess the signal API would be one possibility ? to simply send out > specific signals like 'render_profile' and 'post_profile' where > multiple application could listen to and respond accordingly ? You can do what you want using a combination of

Re: How do you get at a RadioFieldRenderer object from a template? (newforms)

2007-05-07 Thread Joseph Heck
Interesting solution Bill! Thanks for sharing! I'll see if I can't make that mechanism work for me... Malcolm's response was also great in detail, and now I think I need to digest some and see how I can use it, and if there's a good generic solution for me. -joe On 5/7/07, Bill Fenner <[EMAIL P

Re: How do you get at a RadioFieldRenderer object from a template? (newforms)

2007-05-07 Thread Bill Fenner
I did this with an accessor function in the form class: class NonWgStep1(forms.Form): add_edit = forms.ChoiceField(choices=( ('add', 'Add a new entry'), ('edit', 'Modify an existing entry'), ('delete', 'Delete an existing entry'), ), widget=forms.RadioSelect)

Re: migrating 400 images

2007-05-07 Thread Nate Straz
On Mon, May 07, 2007 at 05:14:16PM -, Milan Andric wrote: > Wow, interact() is very cool. Now I just need to find write one that > does a similar thing with html body and the local img srcs recursively > on files within a directory. Is there a library that parses html > pages, I'm sure there

override get_next_by_FOO() / get_previous_by_FOO()

2007-05-07 Thread roderikk
Hi all, I have recently started with django and have been able to do good work with the excellent documentation. Thank you. However, now I am a little baffled. I have created a gallery app. The model exists of a Gallery and Photo which has a foreign key to the Gallery. Now if I want to use the

Re: Creating extensible views ?

2007-05-07 Thread Steven Armstrong
kahless wrote on 05/07/07 23:02: > Hi, > I've found documentation on how to make applications to work together > smoothly .. but is there also some documentation on how i could make > an application (or views of an application) extensible.. > > For example like in eclipse having "extension points

DB error when sorting by a column in the generated admin

2007-05-07 Thread Hancock, David (DHANCOCK)
Django 0.96, Python 2.4, Linux, development webserver I have a with clicking certain column headings for sorting in the contrib Admin lists. I think I brought this on myself. The class reseller below used to be simply a CHOICES list, but that got unwieldy, so I created the class and gave fuel_rele

Creating extensible views ?

2007-05-07 Thread kahless
Hi, I've found documentation on how to make applications to work together smoothly .. but is there also some documentation on how i could make an application (or views of an application) extensible.. For example like in eclipse having "extension points" where 3rd party applications could hook int

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread Sam Morris
On Mon, 07 May 2007 09:19:58 -0700, RollyF wrote: > I am using fedora 6 distribution which comes with Python 2.4.3. I then > installed Python 2.5.1 and re-installed the packages I needed for my > application. I verified that at the terminal, when I typed in "python", > what's loaded is Python 2.

Re: Need some help with Amazon S3

2007-05-07 Thread Frédéric Sidler
i'm currently playing with amazon EC2 and S3 for data and ressources. I found that Adrian Holovty used S3 for chicagocrime.org http://www.holovaty.com/blog/archive/2006/04/07/0927/?highlight=s3 2007/5/7, Kyle Fox <[EMAIL PROTECTED]>: > > > 1) We found S3 to be a bit slow, both upstream and down.

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread Greg Donald
On 5/7/07, RollyF <[EMAIL PROTECTED]> wrote: > I run "/sbin/ldconfig -v" and restarted Apache again. Still showing > the same python2.4 exception when I run the application. > I am not sure what to put in ld.so.config. I saw a couple of > references to python2.4 libs while in verbose mode of runni

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread RollyF
Greg, Thank you again. This is very informative. "which python" returns /usr/local/bin/python which is the location of python2.5 I restarted Apache several times using "/etc/init.d/httpd restart", including a hard reboot of the server. I originally recompiled Python from source using: ./co

Re: Newform and File Upload problem

2007-05-07 Thread guillaume
Well, my message was maybe a little long. I still have not found answers to my problem. To make it short, Is there anywhere a short example of file upload using newform ? The most simple thing with a model with 1 FileField, the smallest template and form associated and the handling code. That wou

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread Jeremy Dunck
On 5/7/07, Greg Donald <[EMAIL PROTECTED]> wrote: ... > > Are you compiling a new Python from source? If so did you add the > Python libs path to your ld.so.config? Did you run ldconfig? Is apache running as the same user as you, and if not, is it locating your 2.5 on the path? --~--~-

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread Greg Donald
On 5/7/07, RollyF <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] ~]$ python > Python 2.5.1 (r251:54863, May 4 2007, 14:56:43) Seems like the correct Python is in your path already. > [EMAIL PROTECTED] ~]$ $PATH > -bash: /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/rxferoli/ > bin: No su

Re: a comment on comments system and voting

2007-05-07 Thread [EMAIL PROTECTED]
Probably. That's what I did. It's not too hard (which is to say, a newb like me figured it out). I understand the comment system is getting reworked, though. On May 4, 10:48 am, "omat * gezgin.com" <[EMAIL PROTECTED]> wrote: > Hi, > > I feel like commenting and voting should be two separate appl

Ultimate, hand picked, genuine sites

2007-05-07 Thread Shortcut Weebly
ShortIntroduction Well, cut short, Shortcut takes you to those ultimate, hand picked, genuine sites that add bucks to your pocket, without any strings attached! What you will find here: Links

Short Introduction to smart work

2007-05-07 Thread Shortcut Weebly
ShortIntroduction Well, cut short, Shortcut takes you to those ultimate, hand picked, genuine sites that add bucks to your pocket, without any strings attached! What you will find here: Links

KeyError

2007-05-07 Thread Stephan Jennewein
Hi, I get a keyerror in the admin interface if my primary key is also a foreign key and I try to open an object. KeyError at /admin/swi/switchport/TS4-01A-44/ 'anschlnr' Request Method: GET Request URL: http://localhost:1200/admin/swi/switchport/TS4-01A-44/ Exception Type: KeyError

Re: migrating 400 images

2007-05-07 Thread Milan Andric
On May 5, 7:17 am, Nate Straz <[EMAIL PROTECTED]> wrote: > > >>> from blog.migrate import loadCOREBlog > > In loadCOREBlog I loaded all of the Zope libraries and started iterating > through whatever needed to be migrated. When I detected a problem I > would use Python's code.interact function t

Re: Authentication of static files without mod_python?

2007-05-07 Thread AndyB
> You may be able to use something like mod_auth_mysql to access the db > directly for authentication (assuming you use mysql). Authorization > doesn't seem possible without using python. It's a shared server (or else I'd just install mod_python). When you say 'doesn't seem possible' what do you

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread RollyF
Greg, Thank you for the quick reply. I got the following while checking the path: >>> [EMAIL PROTECTED] ~]$ python Python 2.5.1 (r251:54863, May 4 2007, 14:56:43) [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import

Re: is this a template bug?

2007-05-07 Thread Joseph Heck
My first thought is "what's in {{ item.inleiding }}". If it included the , then it would be displayed when you rendered that down. Do something like: {{ item.inleiding|escape }} to isolate that element and see what "pops out". On 5/7/07, Enquest <[EMAIL PROTECTED]> wrote: > > Consider the fo

Re: Translation of class names

2007-05-07 Thread Joseph Heck
Do you want your site to be mixed language, or always in Russian? Assuming you want the first, there's good instructions at http://www.djangoproject.com/documentation/i18n/. Make sure you have the middleware included and running, and then take advantage of the url/view setup to explicitly change

Re: Upgrade from Python 2.4 to 2.5

2007-05-07 Thread Greg Donald
On 5/7/07, RollyF <[EMAIL PROTECTED]> wrote: > How do I configure Apache2 or mod_python to use Python 2.5? Adjust your paths so the place where you installed your new Python 2.5 is ahead of your old Python's path. -- Greg Donald http://destiney.com/ --~--~-~--~~~--

Re: Authentication of static files without mod_python?

2007-05-07 Thread Steven Armstrong
AndyB wrote on 05/07/07 18:17: > I've read the docs on linking Apache authentication with Django's > (http://www.djangoproject.com/documentation/apache_auth/) and also > found a snippet on Django Snippets (http://www.djangosnippets.org/ > snippets/62/). > > The first method definitely requires mo

Upgrade from Python 2.4 to 2.5

2007-05-07 Thread RollyF
I am using fedora 6 distribution which comes with Python 2.4.3. I then installed Python 2.5.1 and re-installed the packages I needed for my application. I verified that at the terminal, when I typed in "python", what's loaded is Python 2.5. I am runnign apache2 and mod_python. I recompiled and in

vSelectMultipleField

2007-05-07 Thread sansmojo
Hey, all! I think I'm missing something easy here, but I can't seem to alter the style of a vSelectMultipleField using CSS. Here's my change_form.htm (events is the name of the ManyToManyField)l: {% extends "admin/change_form.html" %} {% block extrastyle %} .vTextField { width: 50em } #id_even

Authentication of static files without mod_python?

2007-05-07 Thread AndyB
I've read the docs on linking Apache authentication with Django's (http://www.djangoproject.com/documentation/apache_auth/) and also found a snippet on Django Snippets (http://www.djangosnippets.org/ snippets/62/). The first method definitely requires mod_python and the second one seems to as wel

Re: Using Django Models outside of Django

2007-05-07 Thread jeffhg58
I think this documentation will provide what you are looking for http://code.djangoproject.com/wiki/InitialSQLDataDiangoORMWay jeff -- Original message -- From: johnny <[EMAIL PROTECTED]> > > I have a python script that runs in a multi threaded manner for > backend t

Re: Need some help with Amazon S3

2007-05-07 Thread Kyle Fox
1) We found S3 to be a bit slow, both upstream and down. Upstream is slow largely because of the SOAP overhead (from what I understand), and we were sending lots of data (about 5 resized images for each image uploaded to django). Downstream, well, not much you can do about that, regardless of h

Re: Apache2/mod_python/Django problem

2007-05-07 Thread RollyF
rob, Thanks. It's the permissions. It's running now. -Rolly On May 4, 3:32 pm, oggie rob <[EMAIL PROTECTED]> wrote: > Check Unix permissions for the todo directory and/or settings.py file. > If apache can't access them, it won't run properly. > > -rob > > On May 4, 6:49 am, RollyF <[EMAIL PROT

Newform and File Upload problem

2007-05-07 Thread schmidg
Hello everybody. I am a Django newbie experimenting with some stuff. I am very impressed by the framework, that made me want to learn more about it. I am trying to do some file upload but I have a problem. I tried many information sources but could not find a simple example of what I am trying to

Re: Using Django Models outside of Django

2007-05-07 Thread James Bennett
On 5/7/07, johnny <[EMAIL PROTECTED]> wrote: > I have a python script that runs in a multi threaded manner for > backend to update certain flags in the table. I want to use django > models to do this. I was wondering if I import the django models just > like any other python, would that work? Y

Using Django Models outside of Django

2007-05-07 Thread johnny
I have a python script that runs in a multi threaded manner for backend to update certain flags in the table. I want to use django models to do this. I was wondering if I import the django models just like any other python, would that work? Also, what about the database connection, can I just c

Re: sitemap for django 0.95.1

2007-05-07 Thread James Bennett
On 5/7/07, Paul Rauch <[EMAIL PROTECTED]> wrote: > if you take a look at the first line of > http://www.djangoproject.com/documentation/sitemaps/ > there is written: "New in Django development version" > meaning: No, not even in 0.96 That's incorrect. The sitemaps app was part of Django 0.96. It

Re: Flex + django

2007-05-07 Thread Don Arbow
I've dabbled in Flex with Django on the backend, using JSON as the transport mechanism. It's not that difficult, you just skip all the HTML template stuff and handle data requests and serve them accordingly. No different than implementing AJAX in the traditional way. I used the Cairngorm f

Re: sitemap for django 0.95.1

2007-05-07 Thread Paul Rauch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mary schrieb: > Does the sitemap work for version 0.95.1 > Casue when i went to this url > http://www.djangoproject.com/documentation/0.95/sitemaps/ > it gave me error page > > Thanks you in advance ; > Mary Adel > > if you take a look at the first

sitemap for django 0.95.1

2007-05-07 Thread Mary
Does the sitemap work for version 0.95.1 Casue when i went to this url http://www.djangoproject.com/documentation/0.95/sitemaps/ it gave me error page Thanks you in advance ; Mary Adel --~--~-~--~~~---~--~~ You received this message because you are subscribed to

is this a template bug?

2007-05-07 Thread Enquest
Consider the following code 9 {% for item in news %} 10 11 {{ item.titel }} 12 13 {{ item.inleiding }} › lees meer 14 15 16 {% endfor %} The templa

Fwd: Amanda Bynes !

2007-05-07 Thread Kooooool forwords
[image: AMANDA BYNES ,ADVERTISEING ,ADS] [image: AMANDA BYNES ,ADVERTISEING ,ADS] [image: AMANDA B

Is that possible to use DISTINCT with get_list?

2007-05-07 Thread Pythoni
I need to find distinct records form my `discussions` table. I can use discussions.get_values(fields=['Subject'],order_by=['Pub_date'],distinct=True) and it works. But I would like to find distinct records with get_list not with get_values, because i need to sent the results to paginator, Is t

Re: Transaction Support in Models

2007-05-07 Thread Russell Keith-Magee
On 5/7/07, Ali Alinia <[EMAIL PROTECTED]> wrote: > > hi Russ, > I have crawled! all of the documentation, > but I don't find anything to help me. > in which section of documetation is my answer? > tnx Russ, (and I'm so sorry for my quick replies) This would be a good place to start: http://www.d

Re: Transaction Support in Models

2007-05-07 Thread Ali Alinia
hi Russ, I have crawled! all of the documentation, but I don't find anything to help me. in which section of documetation is my answer? tnx Russ, (and I'm so sorry for my quick replies) --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Transaction Support in Models

2007-05-07 Thread Russell Keith-Magee
On 5/7/07, Ali Alinia <[EMAIL PROTECTED]> wrote: > > still another question with models: > what about ordering and update/delete statements that have limit > clause? > for example, I want to delete/update records first five records of my > table (model) order by creation date (field:creation_date)

Re: Flex + django

2007-05-07 Thread makoto tsuyuki
Hello, You should check DjangoAMF. It's very fun and usable. http://djangoamf.sourceforge.jp/index.php?DjangoAMF_en On 5月7日, 午後5:14, [EMAIL PROTECTED] wrote: > Does anybody have got any experience with connection Flex(presentation > layer) and  Django(server-side)? > Do you think  this connecti

Re: Translation of class names

2007-05-07 Thread Konstantin Pavlovsky
up! nobody used i18n things? On 3 май, 16:05, Konstantin Pavlovsky <[EMAIL PROTECTED]> wrote: > hi all > > I am working with administrative interface. and want to make it > "speak" russian > if it possible to translate names of Classes using i18n things? > > ive translated field lables with lazy

Welcome to Shortcut - Shortcut takes you to those ultimate, hand picked...

2007-05-07 Thread Shortcut Weebly
ShortIntroduction Well, cut short, Shortcut takes you to those ultimate, hand picked, genuine sites that add bucks to your pocket, without any strings attached! What you will find here: Links

Blog archive

2007-05-07 Thread Alessandro Ronchi
How can I make automatically the links for the blog archive, taking all the years of my blog entries and list them with a link to /2005 /2006 /2007 archives? -- Alessandro Ronchi Skype: aronchi - Wengo: aleronchi http://www.alessandroronchi.net - Il mio sito personale http://www.soasi.com - Svi

Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-07 Thread Nicolas Steinmetz
Mike Axiak wrote: > > Hi, > > I copied the code exactly as you have it and tested, and -- as I > expected -- it worked fine. Are you sure you set the first_name and > last_name fields correctly? > Perhaps you're looking at the wrong object? Strange, it works well now. I did not know what I mad

Re: delete obsolete content type entries...

2007-05-07 Thread Jens Diemer
That surprises me. Does nobody have the same problems? Still nobody delete a model class? How to clean up the django tables? With phpMyAdmin? -- Mfg. Jens Diemer A django powered CMS: http://www.pylucid.org --~--~-~--~~~---~--~~ You received this messag

Re: Bug with __str__(self) if we use "return %s %s" ???

2007-05-07 Thread Nicolas Steinmetz
Russell Keith-Magee wrote: > On 5/4/07, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: >> >> > In Django admin (0.96), when I save data, I have : >> > >> > L'objet Photo "first_name last_name" a �t� modifi� avec succ�s >> > Oups : The object Photo "first_name last_name" has been sucessfully modi

Re: Transaction Support in Models

2007-05-07 Thread Ali Alinia
still another question with models: what about ordering and update/delete statements that have limit clause? for example, I want to delete/update records first five records of my table (model) order by creation date (field:creation_date) and rate (field:rate) how can i do that in my models? --~

Re: Transaction Support in Models

2007-05-07 Thread Ali Alinia
tnx Martin :-) --~--~-~--~~~---~--~~ 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]

Flex + django

2007-05-07 Thread mars_22
Does anybody have got any experience with connection Flex(presentation layer) and Django(server-side)? Do you think this connection could be a good idea? -- Dziecko - instrukcja obsługi >>> http://link.interia.pl/f1a51 --~--

Re: Using Admin to not delete records with other records associated with them.

2007-05-07 Thread Lismoreboy
Here is a DRY preserving hack for models.py to implement CASCADE RESTRICT in django: # START models.py DRY hack for restricted cascade # # Where you wish to restrict the cascade: put the word "restrict" into the related_name property of the ForeignKey field # e.g. # # nl_group = models.ForeignK

Re: Transaction Support in Models

2007-05-07 Thread Martin Winkler
> do models support transactions? Yes, with the TransactionMiddleware. And it's well documented: http://www.djangoproject.com/documentation/transactions/ > can we have multiple orders in our models(getting /fetching) records > from our backend DB? Sure. default ordering is defined in the model

Transaction Support in Models

2007-05-07 Thread Ali Alinia
hi every body, i want to now: A. do models support transactions? if yes, how? and if no, why? B. can we have multiple orders in our models(getting /fetching) records from our backend DB? C. can we use stored procedures (sp) through our models? --~--~-~--~~~---~--~-

Re: How do you get at a RadioFieldRenderer object from a template? (newforms)

2007-05-07 Thread Malcolm Tredinnick
Hey Joe, On Sun, 2007-05-06 at 11:53 -0700, Joseph Heck wrote: > I'm missing the connection in newforms to get to the pieces I want to > manipulate in the templates. > > I have a newform with a single ChoiceField, set up with a RadioSelect() > widget: > > example_choices = ((1,'a'), >