Re: models created from database table

2009-02-04 Thread Karen Tracey
On Thu, Feb 5, 2009 at 12:58 AM, Waruna de Silva wrote: > Thanks Ramior for info > > In Models is it possible to name to Fields as primary keys > > as exmaple, there are two fields > gid = models.IntegerField() > business_id = models.ForeignKey(Business) > > how to make both of them as pri

Re: Model Form Field Ordering

2009-02-04 Thread Karen Tracey
On Thu, Feb 5, 2009 at 1:14 AM, Brian wrote: > > I have a ModelForm subclass where I define a special field. How do I > make that special field appear first in the rendered form (using a > form.as_* method)? > > Here is an example: > > class MyModelForm(forms.ModelForm): >mySpecialField = for

Re: Required help for Basic Data insertion to the database from a form

2009-02-04 Thread Karen Tracey
On Thu, Feb 5, 2009 at 1:23 AM, Neeru wrote: > > thxs, > > I have the Problem in accessing the values from the form. > What Problem? You haven't described any problem, you just dumped a bunch of code in an email and said "hi all, please fix this (quick!) for me". You need to describe what is n

Re: models created from database table

2009-02-04 Thread Karen Tracey
On Thu, Feb 5, 2009 at 1:19 AM, Waruna de Silva wrote: > Thanks > > What is the best possible way to handle that type of a problem > > I don't know, it is not something I've ever needed. If you Google "composite primary keys" and Django you'll get hits that point to the ticket where the feature i

Re: Two forms.Form one page: second form will not show any errors

2009-02-04 Thread Karen Tracey
On Thu, Feb 5, 2009 at 2:03 AM, Gordon wrote: > > Hello, > I have seperate django forms wrapper in one html form tag in my > template. > > When i render, both forms display fully. When I post, errors display > for the first form but not for the second. I am using a tag by tag > approach to the t

Re: Required help for Basic Data insertion to the database from a form

2009-02-05 Thread Karen Tracey
On Thu, Feb 5, 2009 at 2:24 AM, Neeru wrote: > > comming to my problem... > > as far this code works fine. there is no error in this. > I able to display the form text fields in the form when i use the > url. > In views.py file, >how can i access the separate field values that have been >

Re: A Very Puzzling MySQL Issue Performance...

2009-02-05 Thread Karen Tracey
On Thu, Feb 5, 2009 at 12:36 PM, dan0 wrote: > > Hello, > > I am having an issue with my msyqld process responding to a query > after a moderate period of inactivity. I'll issue a simple query such > as "Person.objects.filter(name__icontains='Dan')", which would map to > about 5000 entries in a t

Re: Admin site not using my overridden save()?

2009-02-06 Thread Karen Tracey
On Thu, Feb 5, 2009 at 2:08 PM, Silfheed wrote: > > No, not a direct cut and paste (I guess I should have) > > class person(models.Model): >gender = models.CharField(max_length=1, choices=(('M','male'), > ('F','female'))) >other = models.CharField(manx_length=20, null=True,blank=True) > >

Re: new record - onetoonefield - create related record

2009-02-06 Thread Karen Tracey
On Sat, Jan 31, 2009 at 11:01 AM, John M wrote: > > Hi Karen, and thanks for the reply. > > I've always wanted to use the 1-1 field, but whenever a new parent > record is added, I want it to automatically add (via the save() ) > ovoerride above to the child 1-1 table. > > Yes, the debug does prin

Re: Where to place files on apache server.

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 10:31 AM, djandrow wrote: > > So i set it in Environment Variable then System variables [this is on > windows]: > > PythonPath -- C:\ProgLangs\Python26 > > But i still get File > > "C:\ProgLangs\Python25\Lib\site-packages\mod_python\importer.py", > line 304, in import_modu

Re: No module named PIL - Django - Gae

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 11:51 AM, Edgard Matos wrote: > Somebody can help me? > Not likely, without some more information. As Ned said in the first reply to your original query, you have not shown us enough of your code. You have not shown us any form definition that includes an image, nor have

Re: No module named PIL - Django - Gae

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 12:05 PM, Alex Gaynor wrote: > I'm fairly certain PIL doesn't work on Google App Engine so I think google > has their own image module, you should consult the GAE documentation. > Their own images API apparently uses PIL: http://code.google.com/appengine/docs/python/image

Re: No module named PIL - Django - Gae

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 12:13 PM, Edgard Matos wrote: > My code: > > In model: > class User(db.Model): > user = db.UserProperty() > avatar = db.BlobProperty() > def __unicode__(self): > return self.email > > class UserForm(djangoforms.ModelForm): > class Meta(): > model = User > >

Re: Tuning runserver restart behaviour

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 1:00 PM, tow wrote: > > Is there a way to tune the way in which runserver decides to restart > itself? > The --noreload option can be used to tell runserver not to reload/restart: http://docs.djangoproject.com/en/dev/ref/django-admin/#noreload Karen --~--~-~--~-

Re: html italic tag hinders search code

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 3:05 PM, May wrote: > > I have data entry clerks typing the data, so I cannot have them type > the titles twice. I'm quite sure Jeff wasn't suggesting having anyone type the titles in twice. Rather, when something with a title is saved, you have code (maybe in a save() o

Re: looking for patch to user.messages that adds a category

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 3:54 PM, Margie wrote: > > Hi, > > I was searching for a way to add a class to messages that are created > via user.message_set.create(message="my message here"). I found a > number of people discussing this and found what seems to be patch that > does just what I want: >

Re: ImportError: Could not import settings 'mysite.settings'

2009-02-06 Thread Karen Tracey
On Fri, Feb 6, 2009 at 4:37 PM, djandrow wrote: > > Hello, > > I'm trying to get my django project going on mod_python (this all on > on windows XP) > However when I try to get my project going I get > > ImportError: Could not import settings 'mysite.settings' (Is it on > sys.path? Does it have s

Re: SQLite, swedish signs

2009-02-07 Thread Karen Tracey
On Sat, Feb 7, 2009 at 6:28 AM, Daniel Sandberg wrote: > > I,am getting the following error message when I,am trying to add a swedish > sign: > "'ascii' codec can't encode character u'\xe4' in position 4: ordinal not > in range(128)" > Please include the full traceback that comes with the error.

Re: external non-ascii character is breaking my script

2009-02-07 Thread Karen Tracey
On Sat, Feb 7, 2009 at 11:56 AM, redmonkey wrote: > > Hey everyone, > > I'm trying to create django model instances from data stored in a flat > text file but I get `force_unicode` errors when the script comes > across one of the data items containing the "é" character. > > Can anyone explain to m

Re: external non-ascii character is breaking my script

2009-02-07 Thread Karen Tracey
On Sat, Feb 7, 2009 at 7:27 PM, redmonkey wrote: > > Sure, here's a bit more info. > > The external data is generated by a script and it describes a > catalogue of lot items for an auction site I'm building. The format > includes a lot number, a brief description of the lot for sale, and an > esti

Re: Upload ZIP-File into Database

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 7:24 AM, Robert wrote: > > Dear Community, > > I have a ZIP-File which contains five .lst-Files. I want to fill with > these five files a mysql-database. Is there a possibility to handle > this via the admin interface? I tried the following but it doesn't > work: > This so

Re: mod_python and import path

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 9:44 AM, Jeff wrote: > On Feb 8, 4:29 am, Bradley Wright wrote:> > > And if you're really using mod_python already with Apache, also post > > your vhost file. > vhost file: > #Block conf > files### > >Order a

Re: Extending the User model

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 5:33 PM, Patricio Palma wrote: > > At revision 9820. > > ??? > ??? indeed. What doc are you reading that suggests having something like "admin = meta.Admin(..." under class Meta of your model definition? I've never seen anything like it but I've only been around since 0.

Re: Exception in Django's Exception Handling

2009-02-08 Thread Karen Tracey
On Sun, Feb 8, 2009 at 2:20 PM, Devel63 wrote: > > Django is raising an exception while trying to process an exception, > resulting in no stack traces ... for many different types of errors. > > It has the problem in debug.py, at this line under > technical_500_response: >return HttpResponseS

Re: Troubles with unicode in django-trunk

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 8:07 AM, jfmxl wrote: > > # Create your models here. > > class Poll(models.Model): >question = models.CharField(max_length=200) >pub_date = models.DateTimeField('date published') > > class Choice(models.Model): >poll = models.ForeignKey(Poll) >choice = model

Re: Extending the User model

2009-02-09 Thread Karen Tracey
On Sun, Feb 8, 2009 at 7:51 PM, Patricio Palma wrote: > [snip] > --- > models.py > from django.contrib.auth.models import User > class MyUser(User): >chilean_rut = CLRutField(_('RUT'),primary_key=True) > some_field = models.CharField

Re: Upload ZIP-File into Database

2009-02-09 Thread Karen Tracey
e zip file read from the file system (perhaps using the python shell) using code similar to what you have? If that too is failing, then you've got a problem with your zipfile being acceptable to Python's zip file support and Django can do nothing about that -- again the right place to look

Re: A quick question about slug fields

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 11:50 AM, djandrow wrote: > > I believe these days a statment like this has been depreciated: > > post_slug = models.SlugField(prepopulate_from=('post_title',)) > > I had a look through the docs but couldn't find the answer. > How can you now specify which field the slug is

Re: UnicodeEncodeError with gettext

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 12:21 PM, Scott wrote: > > Thanks for the quick reply - does anyone know if Django 1.0 is patched > into the Google App Engine Django Helper? > Per http://code.google.com/p/google-app-engine-django/source/browse/trunk/CHANGES any reasonably current level of the app engine

Re: Strange 404 error in admin

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 4:17 PM, Julien Phalip wrote: > Hello again, > > I finally fixed it with the following nasty hack: > > class Entry(models.Model): >... some fields ... > > objects = models.Manager() # Nasty hack >published = PublishedEntryManager() > > It seems like

Re: Subclass conflict with admin widgets

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 5:18 PM, phoebebright wrote: > > Yes I see that, it's just if I don't put the custom form in it works > fine: > > class DirectoryAdmin(admin.ModelAdmin): > > >fieldsets = [ >(None, {'fields': ['cat','name','is_live']}),< > CAT FIELD STILL HERE AN OK

Re: Strange 404 error in admin

2009-02-09 Thread Karen Tracey
On Mon, Feb 9, 2009 at 11:45 PM, Julien Phalip wrote: > > On Feb 10, 3:19 pm, Karen Tracey wrote: > > On Mon, Feb 9, 2009 at 4:17 PM, Julien Phalip wrote: > > > Hello again, > > > > > I finally fixed it with the following nasty hack: > > > > &g

Re: Key Erro: 'perms' whenever I try and view a table in Admin

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 9:46 AM, merric wrote: > > Help! Completely stuck with this one. Everytime I try to view any > table in the Admin I get an error. > > I am getting a KEY ERROR with exception value of 'perms': > > Exception Location: C:\Python25\Lib\site-packages\django-trunk\django >

Re: A solution for django/postgresql transaction problem

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 9:58 AM, azer wrote: > > Hi, > I modified django's db/backends/postgresq_psycopg2/base.py and fixed > the problem.I added this lines before "cursor = self.connection.cursor > ()": > ># if transaction is broken, run rollback method >if self.connection.get_transactio

Re: SQLite, swedish signs

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 2:55 PM, DaSa wrote: > > The traceback: > > Environment: > > Request Method: POST > Request URL: http://127.0.0.1:8000/admin/polls/poll/add/ > Django Version: 1.0.2 final > Python Version: 2.5.3 > [snip] > File "C:\Python25\Lib\site-packages\django\utils\encoding.py" in >

Re: SQLite, swedish signs

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 2:55 PM, DaSa wrote: > > The traceback: > > Environment: > > Request Method: POST > Request URL: http://127.0.0.1:8000/admin/polls/poll/add/ > Django Version: 1.0.2 final > Python Version: 2.5.3 > [snip] > File "C:\Python25\Lib\site-packages\django\utils\encoding.py" in >

Re: executing raw sql results in traceback

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 10:28 PM, Bobby Roberts wrote: > > hi gang. For various reasons i've decided to use a raw sql statement > in my view. Following the example located at > http://docs.djangoproject.com/en/dev/topics/db/sql/, I have a view > which looks like this: > > > def searchform(reque

Re: I may have found a bug in inlineformset_factory vicinity

2009-02-10 Thread Karen Tracey
On Tue, Feb 10, 2009 at 5:37 PM, Skylar wrote: > > I get rendered > Id also > User > This is a rather huh?-inducing start to a bug report. Without context, those two outputs look perfectly fine. It really helps if you start with what you are doing at a high level, the code you are using to atte

Re: Verbose field name DjangoUnicodeDecodeError

2009-02-11 Thread Karen Tracey
On Wed, Feb 11, 2009 at 8:22 AM, Joshua Russo wrote: > > I'm developing an app and want to use Portuguese characters in the > verbose field names for my models. The tables were created fine but > when I tried to implement the admin pages I received a > DjangoUnicodeDecodeError when it hit the firs

Re: Verbose field name DjangoUnicodeDecodeError

2009-02-11 Thread Karen Tracey
On Wed, Feb 11, 2009 at 12:29 PM, Joshua Russo wrote: > > Ok, I'm still having issues. > > I'm using Django 1.0.2-final and Python 2.5.4 > > The models.py starts with the proper encoding string of: # -*- coding: > utf-8 -*- > Except apparently your file is not actually encoded in utf-8, see below

Re: Verbose field name DjangoUnicodeDecodeError

2009-02-11 Thread Karen Tracey
On Wed, Feb 11, 2009 at 2:30 PM, Joshua Russo wrote: > Thanks so much. I think you are right. I will let you know tomorrow if > I was able to fix it. I just need to figure out where the encoding is > set in NetBeans and Textpad. I use a combination of both of them. > > It's possible that I didn't

Re: Parent_link=True causes Cannot assign None: "Business.id" does not allow null values.

2009-02-11 Thread Karen Tracey
On Wed, Feb 11, 2009 at 1:36 PM, phoebebright wrote: > > I am following the instructions at the bottom of this page > > http://docs.djangoproject.com/en/dev/topics/db/models/#inheritance-and-reverse-relations > and here > http://docs.djangoproject.com/en/dev/ref/models/fields/#onetoonefield > > I

Re: Really dumb question re output variable for debugging

2009-02-11 Thread Karen Tracey
On Wed, Feb 11, 2009 at 3:01 PM, phoebebright wrote: > > I need to see the contents of some objects that are passed as > parameters into a function. I can stop the function (assert false) > and look at the traceback, but it doesn't tell me the contents of the > objects. I have tried print statem

Re: Parent_link=True causes Cannot assign None: "Business.id" does not allow null values.

2009-02-11 Thread Karen Tracey
> Thanks for your interest! Have to finish this tonight. > This is just a guess, since I don't really have time to look into this closely at the moment, but I'd try using something other than 'id' as the name of your OneToOne with parent_link field=True field. Karen

Re: File Uploading

2009-02-12 Thread Karen Tracey
On Thu, Feb 12, 2009 at 8:02 AM, huw_at1 wrote: > > Hi all, > > I am trying to write a simple app that allows a user to select a file > (via the browse button) from which data can be read in and parsed. I > have read several examples but none seem to do exactly what I want. I > have built a form

Re: executing raw sql results in traceback

2009-02-12 Thread Karen Tracey
On Thu, Feb 12, 2009 at 8:11 AM, Bobby Roberts wrote: > > On Feb 11, 8:38 pm, Bobby Roberts wrote: > > On Feb 11, 8:01 am,BobbyRoberts wrote: > > > > > there shouldn't be really. The client has a search form and due to > > > the way they want the search done there are about 40 option checkboxes

Re: Entering unicode bytestrings in Django

2009-02-12 Thread Karen Tracey
On Thu, Feb 12, 2009 at 12:18 PM, LaundroMat wrote: > > Hi - > > I'm scraping some information from a website, but I'm having some > trouble with special characters such as é. I'm using BeautifulSoup for > the scraping, and would like to be able to have Django print out muy > strings correctly (o

Re: Django unittests will not upload non-.txt files

2009-02-12 Thread Karen Tracey
On Thu, Feb 12, 2009 at 1:26 PM, Robert wrote: > > I'm am trying to build an application that handles several types of > uploads. Currently, it will work fine for .txt type files, but for > all other kinds of files, the file is truncated to about 3 KB. > > I have determined that the file gets tr

Re: executing raw sql results in traceback

2009-02-12 Thread Karen Tracey
On Thu, Feb 12, 2009 at 10:26 AM, Bobby Roberts wrote: > > My apologies... I didn't see Alex's post. Google some times collapses > threads on me. Replacing % with %% seemed to work. It queries the > database and returns a dataset like this: > > ((6L, u'WI', u'ST', u'test3', u'test3', u'test3',

Re: [Fwd: Error with File object]

2009-02-12 Thread Karen Tracey
On Thu, Feb 12, 2009 at 9:55 AM, Stefan Tunsch wrote: > I think I found a bug in the trunk. > > I downgraded to rev 9700 and it started to work again. > > Regards, Stefan > I opened a ticket to track this: http://code.djangoproject.com/ticket/10249 Karen --~--~-~--~~~

Re: Error loading sqlite3 module

2009-02-13 Thread Karen Tracey
On Fri, Feb 13, 2009 at 1:16 AM, Sandeep wrote: > > I just installed Python 2.6.1 and Django 1.0.2 on Windows. > > I am new to Python and Django and am following the tutorial for > Django. > > Per tutorial, I am setting the 'DATABASE_ENGINE' to sqlite3 in > settings.py file. However, I get the fo

Re: raise ValidationError has no effect

2009-02-14 Thread Karen Tracey
On Sat, Feb 14, 2009 at 11:07 AM, Alistair Marshall < runninga...@googlemail.com> wrote: > > I have been trying to create a custom field that allows the user to > enter a flowrate and clean the data back to kg/s or mol/s. > > I though I had everything sorted, when I type '10 tones/year', it > corr

Re: Etags

2009-02-15 Thread Karen Tracey
On Sun, Feb 15, 2009 at 5:59 AM, mermer wrote: > > I am trying to get Etags working in Django - so that if a page has not > been updated (and the client has already seen the page) it is returned > by the client's browser rather than rendered by django. > > The code below is proof of concept. Ho

Re: assertRaises doesnt catch custom error

2009-02-15 Thread Karen Tracey
On Sun, Feb 15, 2009 at 9:46 AM, pault wrote: > > Malcom many thanks for your reply I created a new project and app to > with only one model and one test. > It still fails I know I am missing something but I cant figure out > what that is. > > I tested this on both mac OSx10.5 and vista (both pyt

Re: Different ways of working against a SQLite3 dB

2009-02-15 Thread Karen Tracey
On Sun, Feb 15, 2009 at 10:31 AM, DaSa wrote: > > Thx! But I have the correct chcp coding. I can write swedish signs in > the promt, it is when I try to add them in the SQLite3 dB it goes > wrong. > > I believe it is the "python manage.py shell" that can't handle swedish > signs. If I insert an o

Re: Negative value in forms.Integerfield throws TypeError

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 4:26 AM, coan wrote: > > I'm validating a form, and use forms.IntegerField(min_value=0,). > > If I submit a -1 value in that field, it throws a TypeError: not all > arguments converted during string formatting. > How come it doesn't raise a forms.ValidationError, and how s

Re: Admin hangs while updating a modified, repopulated model [update]

2009-02-16 Thread Karen Tracey
2009/2/16 haestan none > Sorry, it looks like I had a wrong assumption in my original question. The > server seems to hang as soon as I try to update a model with an URLField > that is set to 'http://localhost:8000' (this is where the built-in > webserver is running). > > Is this a bug or can't

Re: Custom template tags in admin with hacking to source?

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 11:49 AM, Daniel Roseman < roseman.dan...@googlemail.com> wrote: > > On Feb 16, 4:23 pm, Ben Gerdemann wrote: > > Is it possible to add a custom template tag to the admin without > > modifying the Django source? I'd like to add a tag to display a > > different submit_line,

Re: Different ways of working against a SQLite3 dB

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 3:53 PM, DaSa wrote: > > > Thx for your tips! > > I tried to update my Python version but it did not work. > Updating Python failed? Or changing to 2.6 did not affect your problem? > > Today I have my data in an Excel document, and I have a script that > parse the exce

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Karen Tracey
On Mon, Feb 16, 2009 at 8:19 PM, Kevin Audleman wrote: > > Alex, > > I managed to get it to work, and the column is even sortable! Thanks > for your help. > > Here's my code for reference for anyone else who comes across this > post: > > class UserAdmin(admin.ModelAdmin): > There are some extensi

Re: HttpResponse post

2009-02-17 Thread Karen Tracey
On Tue, Feb 17, 2009 at 3:04 AM, Miguel wrote: > [snip] > params = urllib.urlencode({"Ds_Merchant_Titular": > Ds_Merchant_Titular, "Ds_Merchant_MerchantCode": Ds_Merchant_MerchantCode}) > #f= urllib2.urlopen("https://sis.sermepa.es/sis/realizarPago > ",params) > >return f ->

Re: uploading files

2009-02-17 Thread Karen Tracey
On Tue, Feb 17, 2009 at 11:50 AM, Tonu Mikk wrote: > Alex Gaynor wrote: > > Uploaded files have a name attribute that contains their name. > Yes, but how does one take advantage of that in this code? > You simply use the name attribute of the UploadedFile instance you are working with. For exam

Re: Was there a recent change in the intial_data-loading code?

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 9:13 AM, Jim wrote: [snip] > > > Snip of output: > > : > Running post-sync handlers for application pkgs > Running post-sync handlers for application tinymce > Running post-sync handlers for appl

Re: Extract values from form fields in templates

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 8:52 AM, koranthala wrote: > > Hi, >I am unable to extract values from form fields inside templates. >For example: > I have mutiple text fields in which one field says whether the > second field is X or not and the second field containing the actual > data. (T

Re: Python Versions and manage.py

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 10:44 AM, djandrow wrote: > > Hello, > > I have python 2.5 and 2.6 installed on my computer and when i try to > run manage.py sqlall I get an error: > > raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e) > django.core.exceptions.ImproperlyConfigured: Error l

Re: sql query for manytomany table

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 1:43 PM, May wrote: > > I need to get the institution name through an intermediary table (two > foreign keys) to display in a template. > > The code is here: > > http://dpaste.com/122204/ > > Thank you anyone, > (Your subject line says manytomany but I don't see any evide

Re: Weird error on Foreign key save?

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 2:30 PM, Alfonso wrote: > > I've got an invoice model that foreign key's to a customer model, when > the invoice is saved I'm update a few fields in that related customer > model to make other code in my setup work. I keep getting > "unsupported operand type(s) for ** or

Re: can template var be passed into template tag?

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 2:35 PM, Margie wrote: > > Is there a way to pass a template variable into a custom template > tag? Certainly. Please read: http://docs.djangoproject.com/en/dev/howto/custom-template-tags/#passing-template-variables-to-the-tag Karen --~--~-~--~~--

Re: sql query for manytomany table

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 2:46 PM, May wrote: > > Hello Karen, > > Here are my views and models: > > http://dpaste.com/122204/ > > http://dpaste.com/14/ > > > The manytomany table is actually a tertiary table. I was just trying > to use django terms, so people would understand what type of tab

Re: sql query for manytomany table

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 3:13 PM, May wrote: > > Hello Karen, > > Yes, I seem confused here. I've been trying everything. The key is > that this query works correctly in the postgres database to retrieve > the institutionname (institution), using the contact id retrieved from > Project: > > sele

Re: sql query for manytomany table

2009-02-18 Thread Karen Tracey
Regarding whether to dpaste or not: Ideally, there is a happy medium were the bulk of a problem is described in email and dpaste (or simliar) is used for full specifics of the code, if necessary, to get help. Usually when the line (or section) of code that is causing the problem is identified, it

Re: sql query for manytomany table

2009-02-18 Thread Karen Tracey
On Wed, Feb 18, 2009 at 4:14 PM, May wrote: > > Hello Karen, > > What I need then is to rewrite the model statement. I imported the > tables from MySQL, so the table structures were already set. Should I > add a manytomany field in the contact table? I'm concerned about > django creating a new

Re: Weird error on Foreign key save?

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 5:24 AM, Alfonso wrote: > > Karen, > > Good point - I will certainly use dpaste in the future. Here's the > traceback, I should have copied that in right from the start: > > Traceback: > [snip] File "/home/queryclick/webapps/django/lib/python2.5/django/contrib/ > admin/o

Re: Django Models blank=False Problem

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 7:45 AM, madhav wrote: > > I have a model something like this: > class CandidateEmailMessage(models.Model): >from_email = models.EmailField(max_length=100) >to_email = models.EmailField(max_length=100) >body = models.TextField() >objects = CandidateEmailMes

Re: Any way to show progress during a short process job?

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 9:04 AM, Adam Stein wrote: > > Thanks Kevin and Malcom for responding. > > Kevin is right in that I don't need AJAX. I came up with a different > method that also allows me to change the string above my progress bar to > reflect what I'm actually doing at the moment. > >

Re: CheckboxInput widget has a flaw when used with an IntegerField

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 11:56 AM, Mark Jones wrote: > > forms.IntegerField(widget=forms.CheckboxInput(attrs={'value':1}), > required=False) > > won't work because > >def value_from_datadict(self, data, files, name): >if name not in data: ># A missing value means False beca

Re: admin foreignkey selection box question

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 12:53 PM, Bobby Roberts wrote: > > > Set a __unicode__ method on your Auction model. > > -- > > DR. > > Hi Daniel... I'm new to the python world... can you tell me what that > even is? > A quick read through the tutorial would have covered it. If you don't want to be bot

Re: problem with PIL and Python2.5

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 1:22 PM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > > I get an error when I try to upload a jpeg file. > > I've tried to compile PIL from scratch, and > python setup.py build_ext -i > > says: > --- JPEG support ok > --- ZLIB (PNG/ZIP) support ok > --- FREETY

Re: CheckboxInput widget has a flaw when used with an IntegerField

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 2:08 PM, Mark Jones wrote: > > Maybe because I have a list of values that I want the user to be able > to select between. A list of 4 or so things that I want the user to > be able to choose one or more of. Is there some better way to get > this accomplished? > At the u

Re: admin foreignkey selection box question

2009-02-19 Thread Karen Tracey
On Thu, Feb 19, 2009 at 1:44 PM, Bobby Roberts wrote: > On Feb 19, 1:08 pm, Karen Tracey wrote: > > On Thu, Feb 19, 2009 at 12:53 PM, Bobby Roberts > wrote: > > > > > > Set a __unicode__ method on your Auction model. > > > > -- > > > >

Re: send_mail / mail_admins to qmail server

2009-02-19 Thread Karen Tracey
On Fri, Feb 20, 2009 at 1:15 AM, Reza Muhammad wrote: > > Hello All, > > I'm trying to play around with a send_mail/mail_admins function but > couldn't get it to work properly. I hope someone can help me out :) > > > I'm trying to create a "send feedback" feature in my application which > will ba

Re: send_mail / mail_admins to qmail server

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 3:55 AM, Reza Muhammad wrote: > > On Feb 20, 2009, at 2:19 PM, Karen Tracey wrote: > > ... > > >> > > Or does it fail not because of the password? because I can connect to >> the mail server from my regular email client with pretty muc

Re: Trouble with admin select related

2009-02-20 Thread Karen Tracey
On Thu, Feb 19, 2009 at 7:10 PM, Trey wrote: > > I'm not sure if other people have stumbled onto this but I am having a > LOT of trouble getting the admin to use select related. > You know select_related is a performance optimization, right? It doesn't affect results in any way, just the number

Re: Writing custom model fields with Multi-table inheritance

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 10:21 AM, gordyt wrote: > > Howdy Viktor, > > On Feb 1, 1:36 pm, Viktor wrote: > > Hi, > > > > did you got any response or did you managed to solve your problem? > > I've just started to search for a UUIDField, and it would be great to > > have proper uuid columns for pos

Re: Connecting to Oracle

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 10:52 AM, Brandon Taylor wrote: > > Hi everyone, > > I'm having a hell of a time getting connected to Oracle... > > We're running Intel MacBooks, OS X 10.5.6, Python 2.6.1, Django Trunk, > Oracle InstantClient 10_2. > > We have tried using cx_Oracle-5.0 and 4.4.1. cx_Oracle

Re: PostgreSQL case sensitive icontains

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 12:00 PM, Alessandro Ronchi < alessandro.ron...@soasi.com> wrote: > > with postgreSQL I get case sensitive filters also with icontains. I do not see this behavior: Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyrig

Re: Multiple form validation

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 1:21 PM, flagg wrote: > > Ok this is driving me nuts. I have two form objects that manipulate > two models. I am trying to run the is_valid() method on both and then > save the form data to the DB. > > def all_valid(form1, form2): >return form1.is_valid() and form2.i

Re: Problem outputting date in template as timestamp

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 6:21 PM, Jeff FW wrote: > > I just tried running the code that the "U" date-formatting parameter > uses, and for me, it was off by about 11.5 days. According to the > documentation, the "U" parameter is not implemented: > http://docs.djangoproject.com/en/dev/ref/templates

Re: OperationalError 1366 Incorrect string value ... for column 'message'

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 8:00 PM, SeanB wrote: > > I have an application that include Unicode strings (Greek and Hebrew), > running on a dev machine and an (inside the firewall) release machine > configured (to the best of my ability) with the same Python, Django, > MySql and connector. > > When e

Re: Writing custom model fields with Multi-table inheritance

2009-02-20 Thread Karen Tracey
On Fri, Feb 20, 2009 at 6:14 PM, gordyt wrote: > > Karen I made a small sample to illustrate the problem and posted it > here: > > http://dpaste.com/hold/123199/ > > It's an extremely simple test case and instructions are included in > the comments. I'm not sure if this error is related to the i

Re: Send_mail usage on development server.

2009-02-23 Thread Karen Tracey
On Mon, Feb 23, 2009 at 10:18 AM, NoviceSortOf wrote: > > Note: Ubuntu Hardy development server. > > I've having problems getting Send_mail to work on my development > server. > It works fine on the production server but when I attempt to send on > the development server I get the following error.

Re: ImageField causing error when rendering with "The Image" attribute has no file associated with it.

2009-02-23 Thread Karen Tracey
On Thu, Feb 19, 2009 at 7:30 AM, mermer wrote: > > Since I've upgraded to Django ver 1.00, I'm suddenly getting the > following error with my ImageFields. > > The tag is {{ model.image.url}} and it throws an error if the image > field in the database is null (even if it is set to null in the mod

Re: select_related() and reverse foreign keys -OR- how to I get a blog post and its comments?

2009-02-23 Thread Karen Tracey
On Mon, Feb 23, 2009 at 12:40 PM, sphogan wrote: > > I'm surprised that this hadn't come up for me before, but nonetheless, > here I am. > > My problem is that I want to get related items (in a similar situation > to getting blog articles with their comments) without looping a second > lookup (si

Re: Table or view does not exist - Oracle

2009-02-23 Thread Karen Tracey
On Mon, Feb 23, 2009 at 10:15 AM, Brandon Taylor wrote: > > Hi everyone, > > Still fighting with Oracle :( > > Quick recap...my setup is: > > OS X 10.5.6 (Intel), cx_Oracle-5.0.1 (Intel), instantclient_10_2, > Django Trunk, Python 2.6.1 > > > If I run Django in shell, I am able to connect to Oracl

Re: UnicodeEncodeError pb

2009-02-23 Thread Karen Tracey
On Mon, Feb 23, 2009 at 7:01 PM, Alex Gaynor wrote: > On Mon, Feb 23, 2009 at 6:58 PM, arbi wrote: > >> >> Hi all, >> >> I got kind of classical error : "UnicodeEncodeError, 'ascii' codec >> can't encode character u'\xe9' in position 11: ordinal not in range >> (128)" >> >> In fact, it raises wh

Re: UnicodeEncodeError pb

2009-02-23 Thread Karen Tracey
On Mon, Feb 23, 2009 at 7:10 PM, arbi wrote: > > Here is the Traceback, need something else? > > Traceback: > File "/Library/Python/2.5/site-packages/django/core/handlers/base.py" > in get_response > 86. response = callback(request, *callback_args, > **callback_kwargs) > File "/U

Re: django apache authentication strange behavior with apache indexing.

2009-02-24 Thread Karen Tracey
On Fri, Feb 20, 2009 at 12:59 PM, Jlcarroll wrote: > > I posted this a couple of days ago and didn't get a response. Thought > that I might try again. > > I am creating a private genealogy web page of pictures/obituaries/data > files/census records etc... all just a set of files within a director

Re: A solution for django/postgresql transaction problem

2009-02-25 Thread Karen Tracey
On Wed, Feb 25, 2009 at 10:29 PM, Sushant Sinha wrote: > > I am also facing the same problem. Here is the description of my > problem. The code tries to create a new user and emits an error when > an error happens: > > try: >user = auth.models.User.objects.create_user(uname, email, password >

Re: Django nube

2009-02-26 Thread Karen Tracey
On Thu, Feb 26, 2009 at 2:41 AM, john wrote: > > I am trying to follow the Django | Writing your first Django ap part 1 > tutorial. When I get to the python manage.py syncdb command I get the > following: > > Traceback (most recent call last): > [snip] >raise ImproperlyConfigured, "Please fi

Re: Configuring django cms with mod_python

2009-02-26 Thread Karen Tracey
On Thu, Feb 26, 2009 at 7:22 AM, stuart wrote: > > Hi, > > I'm new to django and am having problems configuring the django-cms > application with apache (using mod_python). I have followed the > install steps (http://django-cms.org/installation/) but Apache throws > the following error: > > Impor

<    2   3   4   5   6   7   8   9   10   11   >