Re: Hey can any one help me.

2009-12-15 Thread Javier Guerra
'chiru'tha wrote: > Hey i created a django project on linux read hat, and started the > server.. now i want to access the server from the windows browser. bt > it displays the diagnostic error, cont be able to connect to the > server. can any one help me what the actual problem is.. > thank u. by

I have updated the django and firebird install guide on ubuntu

2009-12-15 Thread mariuz
I’m impressed about the new django-firebird driver from svn.No more patching needed for the first 5 chapters in the django book. So i have updated django+firebird howto and examples from the book are tested with django 1.1.1 and firebird-django latest http://www.firebirdnews.org/?p=3891 -- You re

Re: ORM using tons of memory and CPU

2009-12-15 Thread rebus_
2009/12/15 Tracy Reed : > > I have code which looks basically like this: > > now        = datetime.today() > beginning  = datetime.fromtimestamp(0) > end        = now - timedelta(days=settings.DAYSTOKEEP) > > def purgedb(): >    """Delete archivedEmail objects from the beginning of time until >    

Re: How to choose one row of data

2009-12-15 Thread Tom Evans
On Fri, Dec 11, 2009 at 6:25 PM, Andy wrote: > Tom - DR's method is simple and effective, but I'm guessing you say > it's the worst way because it creates an unnecessary database > request.  Is this a correct assumption?  If not, please explain. > > There are at least 2 things wrong with it IMO:

Re: Should empty formsets call their own clean method?

2009-12-15 Thread Tom Evans
On Fri, Dec 11, 2009 at 10:55 PM, Preston Holmes wrote: > Well something wonky is going on. > > From my readthrough of the code, it *should* get called on empty > formsets: > > is_valid calls total_form_count to get a loop count > total_form_count should be positive even if forms are blank > > is_

Re: Understanding of File Upload in Django

2009-12-15 Thread john2095
I'm confident people will correct my mistakes... A file is transferred from a web browser to a web server by breaking it up into packets at the network layer. Each packet is part of the file and you need the complete set of packets to recreate the whole request, and thus the whole file. Assuming

Re: How to set attribute to the items in a QuerySet.

2009-12-15 Thread Daniel Roseman
On Dec 15, 7:02 am, Xuqing Kuang wrote: > Hi, all. > > Are there any way could keep a attribute new set to a item in QuerySet > object ? > > For example: > > >>> tcs = TestCase.objects.filter(case_id__in = [1123, 1124, 1125]) > >>> tcs > > [, , MigrateOneWayDisk>]>>> tc = tcs[1] > >>> setattr(tc,

Re: Cron vs event triggered action

2009-12-15 Thread john2095
Just to throw it out there... forget about trying to make something happen every ten minutes; or whatever your margin for error is. Instead focus on just testing to see whether two hours have passed when you come to use it. Either lazy (C), or diligent (D)... Solution C: Do nothing at all until so

Re: ORM using tons of memory and CPU

2009-12-15 Thread bruno desthuilliers
On 15 déc, 02:44, Tracy Reed wrote: > I have code which looks basically like this: > > now        = datetime.today() > beginning  = datetime.fromtimestamp(0) > end        = now - timedelta(days=settings.DAYSTOKEEP) > > def purgedb(): >     """Delete archivedEmail objects from the beginning of time

Re: Cron vs event triggered action

2009-12-15 Thread David De La Harpe Golden
Tim Daniel wrote: > So how can I implement solution B? Is there a posibility to create a > cron on a user action that executes only one time? > > NOTE: I don't want to rely on a thread that should stay alive for two > hours ore more inside the server memory. Well, celery uses a "celeryd" daemon

Using Forms to display and edit?

2009-12-15 Thread Doug Blank
Django users, I'm wrestling with how to best create HTML pages that can either be used for displaying or editing data. That is, I'd like the field's values to appear as text in display mode, but in their widgets when in edit/add mode. It appears that Django wasn't designed to do this: the fields a

Re: Understanding of File Upload in Django

2009-12-15 Thread David De La Harpe Golden
sjtirtha wrote: > But what I understand from the documentation is uploading and saving are two > different processes. How can I trigger the saving then? > First, certainly, when a file is uploaded from a client, django puts it somewhere *temporary* initially. You may have conceptualised that as

Testing Django applications

2009-12-15 Thread HB
Hey, Grails framework offers a huge set of tools to facilitate testing (unit and integration) I heard the same thing is true for Rails Does Django offers the same thing? Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: Testing Django applications

2009-12-15 Thread Jonas Obrist
HB wrote: > Hey, > Grails framework offers a huge set of tools to facilitate testing > (unit and integration) > I heard the same thing is true for Rails > Does Django offers the same thing? > Thanks. > > -- > > You received this message because you are subscribed to the Google Groups > "Django use

how to get the list_display properly?

2009-12-15 Thread Viktor
hi, I've just noticed that even the contrib apps' admin interface is bogus in django 1.1 namely, the first column name should be the "check all" checkbox, instead that column receives a the first header of list_display, and finally the last column does not have a header. is this really a bug? t

Caching pages that take a long time to generate

2009-12-15 Thread Tom Evans
Hi all (This is all running django 1.1.1) On our site, we have a lot of pages that take a long time to generate, mainly because they make a lot of expensive SOAP-like calls to other servers. Some of the pages take exceptionally long periods of time (> 30 seconds) to generate a full web page. In o

can any on help me how to create a sample model project.

2009-12-15 Thread 'chiru'tha
hi.. I'm new to Django, i need it in my project applications, can any one guide me to create a new model project(using MySql database). plz give the process in detail.. OS-- read hat DB:mysql5 python2.6 Django-1.1.1 thanku.. -- You received this message because you are subscribed to the Google

Re: Complicated Form "Workflow" - Need ideas/direction

2009-12-15 Thread derek
Baurzhan If you are serious about doing this, you may want to look at what has been "invented" elsewhere. The one example I know of (and have used) is Apache Cocoon's flow model: http://cocoon.apache.org/2.1/userdocs/flow/continuations.html Worth reading around ideas/concepts. Derek On Dec 14,

Re: can any on help me how to create a sample model project.

2009-12-15 Thread Simon Brunning
2009/12/15 'chiru'tha : > hi.. > I'm new to Django, i need it in my project applications, can any one > guide me to create a new model project(using MySql database). plz give > the process in detail.. http://lmgtfy.com/?q=django+tutorial -- Cheers, Simon B. -- You received this message because

Re: can any on help me how to create a sample model project.

2009-12-15 Thread 'chiru'tha
hey i've seen dat.. bt i cont able to create a new one.. i'm doing some mistake while setting settings. If u createed a project.. plz tell me the process in detail.. plz. thanku.. On Dec 15, 6:25 pm, Simon Brunning wrote: > 2009/12/15 'chiru'tha : > > > hi.. > > I'm new to Django, i need it in my

Re: can any on help me how to create a sample model project.

2009-12-15 Thread Simon Brunning
2009/12/15 'chiru'tha : > hey i've seen dat.. bt i cont able to create a new one.. i'm doing > some mistake while setting settings. If u createed a project.. plz > tell me the process in detail.. plz. > thanku.. Sorry, but that *is* the process. Why don't you tell us what went wrong? Perhaps we c

django and MSSQL

2009-12-15 Thread miocn
Help: django + mssql the old system to add some content, the database is MSSQL 7.0, I intend to use django 1.1, feasible? Django 1.1 and MSSQL How do I connect?? thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, sen

Re: Complicated Form "Workflow" - Need ideas/direction

2009-12-15 Thread Baurzhan Ismagulov
On Tue, Dec 15, 2009 at 05:18:56AM -0800, derek wrote: > If you are serious about doing this, you may want to look at what has > been "invented" elsewhere. The one example I know of (and have used) > is Apache Cocoon's flow model: > http://cocoon.apache.org/2.1/userdocs/flow/continuations.html >

Inventory model design

2009-12-15 Thread yummy_droid
Hi, I wanted to design a system that would keep inventory data for items. The items themselves are different enough, that they don't conform to a simple model. E.g., the products are for a bakery company. The company keeps inventory of solid items, liquid items, and items that are used in partial

Re: can any on help me how to create a sample model project.

2009-12-15 Thread chiranjeevi muttoju
i cont able to understand how to modify the settings for mysql.. when i run the cammand 'python manage.py shell' it gives the error no modulr fing for No module named MySQLdb the actual error is:: --- [r...@scci01 book]# python manage.py shell Traceback

Re: can any on help me how to create a sample model project.

2009-12-15 Thread Simon Brunning
2009/12/15 chiranjeevi muttoju : > i cont able to understand how to modify the settings for mysql.. > when i run the cammand 'python manage.py shell' > it gives the error no modulr fing for No module named MySQLdb You've not installed the database module that Python needs to talk to MySql - see

Re: Complicated Form "Workflow" - Need ideas/direction

2009-12-15 Thread DrBloodmoney
When I run into similar situations with regards to flow, interface, I try to approach from a different angle. In this case, where you have different checks (before they can create an Event, the venue must exist, etc.) I line those up first. - Create event view, select Venue. - If venue does not e

Re: can any on help me how to create a sample model project.

2009-12-15 Thread chiranjeevi muttoju
i've downloaded the mysql connector "MySQL-python-1.2.3c1.tar.gz' could u please tellme how to instal that in linux.. On Tue, Dec 15, 2009 at 7:36 PM, Simon Brunning wrote: > 2009/12/15 chiranjeevi muttoju : > > i cont able to understand how to modify the settings for mysql.. > > when i run the c

Re: can any on help me how to create a sample model project.

2009-12-15 Thread Simon Brunning
2009/12/15 chiranjeevi muttoju : > i've downloaded the mysql connector "MySQL-python-1.2.3c1.tar.gz' > could u please tellme how to instal that in linux.. If you untar it, you should find installation instructions in the README. -- Cheers, Simon B. -- You received this message because you are

Re: can any on help me how to create a sample model project.

2009-12-15 Thread chiranjeevi muttoju
hey i installed django on one machine, and sql in another machine.. in which mechine i need to install the sql connector. On Tue, Dec 15, 2009 at 7:51 PM, Simon Brunning wrote: > 2009/12/15 chiranjeevi muttoju : > > i've downloaded the mysql connector "MySQL-python-1.2.3c1.tar.gz' > > could u ple

Re: can any on help me how to create a sample model project.

2009-12-15 Thread Simon Brunning
2009/12/15 chiranjeevi muttoju : > hey i installed django on one machine, and sql in another machine.. in which > mechine i need to install the sql connector. The Django machine. -- Cheers, Simon B. -- You received this message because you are subscribed to the Google Groups "Django users" gr

MySQLdb module for Python 2.5 on Windows XP

2009-12-15 Thread OkaMthembo
Hi guys, I'm a Django noob and am having a few hair-raising experiences (maybe it's because i'm on Windows?). I successfully installed Django and fired up the dev server. Now, i got to the part in the walkthrough where i must edit the MySQL settings module and specify a user and password. I can lo

Re: MySQLdb module for Python 2.5 on Windows XP

2009-12-15 Thread OkaMthembo
Pardon me, the settings module edited is the Django application one and not that of MySQL. On Tue, Dec 15, 2009 at 4:33 PM, OkaMthembo wrote: > Hi guys, > > I'm a Django noob and am having a few hair-raising experiences (maybe it's > because i'm on Windows?). I successfully installed Django and

Re: can any on help me how to create a sample model project.

2009-12-15 Thread chiranjeevi muttoju
$ tar xfz MySQL-python-1.2.1.tar.gz $ cd MySQL-python-1.2.1 $ # edit site.cfg if necessary $ python setup.py build $ sudo python setup.py install # or su first this is the installation process specified.. I think the 3rd step is for mysql settings.. i instaled the my sql in other mechine

Re: Filter (AND excluding empty values)

2009-12-15 Thread Alex Robbins
Does it work for one case at a time? Have you tried q = request.GET.get('city') properties = Property.objects.filter(city=q) I would make sure it is working for each variable before combining them together. (Maybe you already have, I don't know.) Alex On Dec 14, 5:32 pm, Osiaq wrote: > Andy, I

Re: can any on help me how to create a sample model project.

2009-12-15 Thread chiranjeevi muttoju
the content of that file is.. [options] # embedded: link against the embedded server library # threadsafe: use the threadsafe client # static: link against a static library (probably required for embedded) embedded = False threadsafe = True static = False # The path to mysql_config. # Only use th

Re: MySQLdb module for Python 2.5 on Windows XP

2009-12-15 Thread OkaMthembo
I followed Simon Brunning's advice on a similar post and ended up getting the correct module from Sourceforge. Thank you. Regards, Lloyd On Tue, Dec 15, 2009 at 4:36 PM, OkaMthembo wrote: > Pardon me, the settings module edited is the Django application one and not > that of MySQL. > > > On Tue

Re: can any on help me how to create a sample model project.

2009-12-15 Thread Simon Brunning
2009/12/15 chiranjeevi muttoju : > ImportError: No module named setuptools Seems pretty self-evident to me. Try installing setuptools first. -- Cheers, Simon B. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: variable {% url %} parameter

2009-12-15 Thread Baurzhan Ismagulov
On Mon, Dec 14, 2009 at 02:12:00AM -0800, bruno desthuilliers wrote: > >     (r'^app/(?P\d+)/$', create_update.update_object, > >      {'model': App}, 'app-edit'), > > > > Now, using {% url 'app-edit' object.pk %} in a form throws > > TemplateSyntaxError, mentioning "NoReverseMatch: Reverse for > >

Re: Django authentication, not permit 2 users with the same name to login in same time

2009-12-15 Thread Nicu Marcu
Need to be other solution, like using sessions? 2009/12/15 rebus_ > 2009/12/14 NMarcu : > > Hi all, > > > > How can I do, to not let the same user to be logged from 2 > > different location, in the same time. I want, when a user admin is > > login, and another user try to login with the same u

Re: how to get the list_display properly?

2009-12-15 Thread Daniel Roseman
On Dec 15, 12:48 pm, Viktor wrote: > hi, > > I've just noticed that even the contrib apps' admin interface is bogus > in django 1.1 > > namely, the first column name should be the "check all" checkbox, > instead that column receives a the first header of list_display, and > finally the last column

Re: variable {% url %} parameter

2009-12-15 Thread Daniel Roseman
On Dec 15, 3:36 pm, Baurzhan Ismagulov wrote: > On Mon, Dec 14, 2009 at 02:12:00AM -0800, bruno desthuilliers wrote: > > > (r'^app/(?P\d+)/$', create_update.update_object, > > > {'model': App}, 'app-edit'), > > > > Now, using {% url 'app-edit' object.pk %} in a form throws > > > TemplateSyntaxErro

Re: How to use debugger from doctest

2009-12-15 Thread Bill Freeman
IIUC, the test jig redirects stdin and stdout so that it can drive interpreter input from the corresponding substrings of the doc test strings, and capture the output to compare it to the corresponding substrings of the doc test strings. So pdb is waiting for input from the doctest string and it's

Re: What exactly does order_with_respect_to do?

2009-12-15 Thread smcoll
This is probably a dead thread, but... i think the answer given is incorrect. 'order_with_respect_to' adds an '_order' integer field to the model. Each set of instances that share a parent object of the relation specified by 'order_with_respect_to' get ordered as a set. So in the example, three

Photo Gallery Suggestions

2009-12-15 Thread Kevin Monceaux
Django Fans, Somewhere back in the pre-1.x days(via the newforms-admin branch) I converted one of the sites I act as webmaster for, The Waco Agility Group's site actually, to Django. I got sidetracked exploring other frameworks and haven't done much with Django since then. I think I've decided t

problems downloading django

2009-12-15 Thread Michael K
I don't know when this started, as I've not needed to download django in a while, but I've come across a strange issue. Pardon if this is going to the wrong place. I tried to download the TAR file(s) for releases, but I get a ~5Mb corrupted tar.gz from the website. With this in mind, I tried th

Re: Photo Gallery Suggestions

2009-12-15 Thread Kevin Monceaux
Oops, I knew I'd leave out at least one. On Tue, Dec 15, 2009 at 10:42:10AM -0600, Kevin Monceaux wrote: > Some of the items on my wish list include: Customizable upload/save path, preferably including a directory named after the photo's ID, to avoid filename collisions. -- Kevin htt

Re: ORM using tons of memory and CPU

2009-12-15 Thread Tracy Reed
On Tue, Dec 15, 2009 at 09:43:02AM +0200, Jani Tiainen spake thusly: > If you have DEBUG=True setting Django also records _every_ SQL query > made to database and depending on a case, it might use quite lot of > memory. My settings.py contains: DEBUG = False -- Tracy Reed http://tracyreed.org

Re: Photo Gallery Suggestions

2009-12-15 Thread patrickk
what we usually do with the filebrowser is this: we create a custom gallery (gallery-model with gallery-images as tabularinlines) with a filebrowsefield for a folder - when you add a gallery you just select a folder on your filesystem. we overwrite the save-method (of the gallery) in order to find

Re: ORM using tons of memory and CPU

2009-12-15 Thread Tracy Reed
On Tue, Dec 15, 2009 at 03:35:29AM -0800, bruno desthuilliers spake thusly: > looks like settings.DEBUG=True to me. Nope. settings.py has DEBUG = False > wrt/ the other mentioned problem - building whole model instances for > each row - you can obviously save a lot of work here by using a > value

Re: What exactly does order_with_respect_to do?

2009-12-15 Thread Hanne Moa
2009/12/15 smcoll : > i'd be curious to know if anyone has seen an admin implementation for > reordering with this field.  i'd also heard some chatter a while back > that this might be removed in future releases of Django, because it > leans toward the "magic" end of things I always end up making

Re: problems downloading django

2009-12-15 Thread Michael K
On Dec 15, 12:30 pm, Michael K wrote: > I tried to download the TAR file(s) for releases, but I get a ~5Mb > corrupted tar.gz from the website.   With this in mind, I tried the > SVN, and here's what that resulted in: > > svn: PROPFIND request failed on '/svn/django/trunk' > svn: PROPFIND of '/svn

Re: variable {% url %} parameter

2009-12-15 Thread Baurzhan Ismagulov
On Tue, Dec 15, 2009 at 08:00:54AM -0800, Daniel Roseman wrote: > Should be {% url app-edit object_id=object.pk %} - ie drop the quotes > around app-edit. Yes, this worked. Thanks, Daniel and Bruno! With kind regards, -- Baurzhan Ismagulov http://www.kz-easy.com/ -- You received this message b

Admin UnicodeEncodeError

2009-12-15 Thread goome
Hello i have a model with a CharField field. When in the admin panel i try to insert a new record for the model with a text containing "é" for the field, i got """UnicodeEncodeError at /admin/abruzzodavedere/servizio/4/ 'ascii' codec can't encode character u'\xe8' in position 14: ordinal not in ra

How to customize form styled by django-uni-form?

2009-12-15 Thread Continuation
This is a question about django-uni-form. But I figure many people here may have experienced with django-uni-form so I'd try asking here. I'm using django-uni-form to style my form using the filter my_form| as_uni_form: {{ my_form|as_uni_form }}

Re: ORM using tons of memory and CPU

2009-12-15 Thread Jirka Vejrazka
Hi, correct me if I got it wrong, but you essentially need these 4 things: 1) obtain the date for the the newest messages to delete 2) get cacheID of all objects to be deleted 3) delete the files 4) delete these objects from the database So, you could use something like this: # get the date

No module named urls (again)

2009-12-15 Thread Pablo Solera
Hi everyone, This is my first post ans as usual it deals with a problem. I hope it isn´t answered yet. I´ve searched across the group and didn ´t find the solution (A similar problem didn´t detail the solution - no renaming here) Ok lets describe it: I´m trying to start developing with eclipse +

Re: No module named urls (again)

2009-12-15 Thread Michael K
On Dec 15, 3:18 pm, Pablo Solera wrote: > When I try to run the same server from eclipse, it seems that > something is not correct. > I got the error: ImportError at / "No module named urls" > I do have the urls.py on my application, and averything works fine out > of eclipse. > > Could it be a

Re: ORM using tons of memory and CPU

2009-12-15 Thread Jirka Vejrazka
Well, I was bound to get something wrong :) > to_be_purged = > archivedEmail.objects.filter(received__lte=newest_to_delete).values('cacheID', > flat=True) the end of the line should be .values_list('cacheID', flat=True) # not .values( Cheers Jirka -- You received this message becau

South data migration problem.

2009-12-15 Thread Shawn Milochik
I added a new ManyToMany field to one of my models. The foreign key is to a model in a different Django application in our project. The migration to add the foreign key works perfectly. I did remember to add the --freeze otherappname.modelname to the command line. I also added the --freeze othe

Re: South data migration problem.

2009-12-15 Thread Shawn Milochik
Sorry to reply to my own post -- I just realized I left out a useful detail: I added a foreign key to the Study model to several tables, and a ManyToMany to Study to two tables. The data migration works flawlessly for the tables where I'm setting the foreign key to the Study instance -- it onl

Help me to fix problem related to migration from one server to another

2009-12-15 Thread Oleg Oltar
Hi, I've moved my django application from one server to another, and spotted strange bug with media after it: Traceback (most recent call last): File "/usr/lib/python2.5/site- packages/Django-1.1.1-py2.5.egg/django/core/handlers/base.py", line 92, in get_response response = callback(request,

Re: South data migration problem.

2009-12-15 Thread Shawn Milochik
Okay, okay. So I'm still replying to my own post. On the bright side, I figured it out. First point of interest: If I stop referrering to my model with orm.Message, and just use Message (as imported from my app at the top), everything works fine. Second point of interest (discovered AFTER

stringformat in {% url %}

2009-12-15 Thread neridaj
Hello, I'm trying to format a variable inside a {% url %} tag with stringformat but I can't get it right. All I want to do is concatenate a pound sign (#) to an id i.e., "#123456789", here is what I have: Thanks for any help, J -- You received this message because you are subscribed to the G

Re: How to customize form styled by django-uni-form?

2009-12-15 Thread Preston Holmes
On Dec 15, 12:02 pm, Continuation wrote: > This is a question about django-uni-form. But I figure many people > here may have experienced with django-uni-form so I'd try asking here. > > I'm using django-uni-form to style my form using the filter my_form| > as_uni_form: > > >       >          

Re: stringformat in {% url %}

2009-12-15 Thread neridaj
nevermind, I'm doing this a different way. On Dec 15, 1:46 pm, neridaj wrote: > Hello, > > I'm trying to format a variable inside a {% url %} tag with > stringformat but I can't get it right. All I want to do is concatenate > a pound sign (#) to an id i.e., "#123456789", here is what I have: > >

Re: How to use debugger from doctest

2009-12-15 Thread Bill Freeman
Untested, but it looks like you can do: import pdb, sys; pdb.Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__).set_trace() On Tue, Dec 15, 2009 at 11:07 AM, Bill Freeman wrote: > IIUC, the test jig redirects stdin and stdout so that it can drive > interpreter input from > the corresponding subs

Re: Using Forms to display and edit?

2009-12-15 Thread Margie Roginski
When I want to just display data in a form (as opposed to letting user edit it), I create a specialized widget. For example, I have a model that has multiple datetime fields, and I don't want the user to be able to edit them, but I do want to display their values. Here's a widget I use where you

How to use an alternative template system (trunk version)?

2009-12-15 Thread Measurement and statistics
According to the latest document: http://docs.djangoproject.com/en/dev/ref/templates/api/#using-an-alternative-template-language, it will be much easier to replace the django template system than before. Has anyone tried the new approach? I tried, but I couldn't make it work. -- You received this

Re: How to use debugger from doctest

2009-12-15 Thread Bill Freeman
Or maybe: import pdb, sys; pdb.Pdb(stdin=sys.__stdin__, stdout=sys.__stdout__).set_trace(sys._getframe().f_back) On Tue, Dec 15, 2009 at 5:32 PM, Bill Freeman wrote: > Untested, but it looks like you can do: > >   import pdb, sys; pdb.Pdb(stdin=sys.__stdin__, > stdout=sys.__stdout__).set_trace

Legacy Postgres Database and Sequencers

2009-12-15 Thread D. Rick Anderson
Hi all! I'm new to Django (been a Zope developer for years), and I'm working on an app to front-end a legacy postgres database, and running into a few snags. The database uses sequences for all of the PKs, and when I attempt to insert a new record: i = Person(name="Rick", facility_id=123) i.save(

Re: Using Forms to display and edit?

2009-12-15 Thread Doug Blank
On Tue, Dec 15, 2009 at 5:45 PM, Margie Roginski wrote: > When I want to just display data in a form (as opposed to letting user > edit it), I create a specialized widget.  For example, I have a model > that has multiple datetime fields, and I don't want the user to be > able to edit them, but I d

Re: Filter (AND excluding empty values)

2009-12-15 Thread Osiaq
Yes, this one is working properly. Actually I can use i.e properties = Property.objects.filter( Q(city=t) & Q(category=c ) & Q (status=s) ) These parameters are working perfect for: city='Tokio', category='House', status='For Rent' But fails for: city='Tokio', category null, status null Similar

Re: Legacy Postgres Database and Sequencers

2009-12-15 Thread Shawn Milochik
If it's a legacy database, but the tables actually have a field named 'id' (which is Django's default primary key), maybe the Django ORM is assuming that that's the primary key. Does a field in your model have primary_key = True set? http://docs.djangoproject.com/en/dev/topics/db/models/#automa

Re: How to use debugger from doctest

2009-12-15 Thread Phui Hock
Thanks for the replies. The problem I described earlier exhibits only in Django doctest. If you write a doctest and run with plain python interpreter, such as this: test.py def print_i(i): """ >>> i = 1 + 1 >>> i 2 >>> import pdb; pdb.set_trace() """ print i $ python -

Re: How to implement GROUP BY in Django object models?

2009-12-15 Thread thai.pham
Hello Daniel, Because I'm new to Django. I don't know how to apply the examples in that document to my case. Would you mind telling me what I should do with the above SQL query? Thai. On Dec 15, 2:47 pm, Daniel Roseman wrote: > > http://docs.djangoproject.com/en/dev/topics/db/aggregation/ > --

Re: Filter (AND excluding empty values)

2009-12-15 Thread Phui Hock
I suppose you can do something like: Property.objects.filter( city=t, Q(category__isnull=True) | Q(category=c), Q (status__isnull=True) | Q(status=s) ) On Dec 16, 9:17 am, Osiaq wrote: > Yes, this one is working properly. > Actually I can use i.e > > properties = Property.objects.filter( Q(city

Re: Admin UnicodeEncodeError

2009-12-15 Thread Karen Tracey
On Tue, Dec 15, 2009 at 2:42 PM, goome wrote: > Hello > i have a model with a CharField field. > When in the admin panel i try to insert a new record for the model > with a text containing "é" for the field, i got > """UnicodeEncodeError at /admin/abruzzodavedere/servizio/4/ > > 'ascii' codec can

Re: Help me to fix problem related to migration from one server to another

2009-12-15 Thread Karen Tracey
On Tue, Dec 15, 2009 at 4:09 PM, Oleg Oltar wrote: > Hi, > > I've moved my django application from one server to another, and spotted > strange bug with media after it: > > Traceback (most recent call last): > > File "/usr/lib/python2.5/site- > packages/Django-1.1.1-py2.5.egg/django/core/handler

Multiple icontains using OR - Is it possible?

2009-12-15 Thread tm
Hello Django Users, I'm trying to use icontains to check 2 fields in the same table for a keyword entered into a search. ex I've tried: queryset = MyModel.objects.filter(summary__icontains=q).filter (title__icontains=q) and queryset = MyModel.objects.filter(summary__icontains=q, title__icontai

Re: Pydev + Django + Ubuntu 9.10

2009-12-15 Thread paul.dorman
I can confirm that removing the Python interpreter and re-adding solved this issue for me. I'm using Karmic packages for Eclipse and for Django. On Dec 8, 8:32 am, Brian McKeever wrote: > I'm using django from the repositories. > Installed this > way:http://docs.djangoproject.com/en/dev/topics/i

Trying to limit a ForeignKey in the admin site, but formfield_for_foreignkey isn't working

2009-12-15 Thread Eric Chamberlain
How do I get the default_provider field to only list providers that belong to this Partner? class Partner(Model): id = UUIDField(primary_key=True) ... default_provider = ForeignKey('Provider', null=True, blank=True) providers = ManyToManyField('Provider', related_name='provider_

Re: Multiple icontains using OR - Is it possible?

2009-12-15 Thread HARRY POTTRER
you're going to need the Q object, it seems. from django.db.models import Q MyModel.objects.filter(Q(summary__icontains=q) | Q (title__icontains=q)) On Dec 15, 10:32 pm, tm wrote: > Hello Django Users, > > I'm trying to use icontains to check 2 fields in the same table for a > keyword entered in

Re: Filter (AND excluding empty values)

2009-12-15 Thread Osiaq
Well, still the same: VIEW: def search(request): t=request.GET['city'] c=request.GET['category'] s=request.GET['status'] properties =Property.objects.filter(Q(city__isnull=True)|Q(city=t), Q(category__isnull=True) | Q(category=c), Q

Re: csrf error on login and admin

2009-12-15 Thread Paddy Joy
Try 'django.middleware.csrf.CsrfMiddleware' instead of 'django.contrib.csrf.middleware.CsrfMiddleware' Paddy On Dec 15, 4:28 pm, Kenneth Gonsalves wrote: > On Tuesday 15 Dec 2009 9:07:38 am Kenneth Gonsalves wrote: > > > > I tried another browser - same problem of erratic behaviour, at times > >

Re: Filter (AND excluding empty values)

2009-12-15 Thread Phui Hock
I see. I think this is probably you are looking for: params = ['city', 'category', 'status'] kwargs = dict([(p, request.GET.get(p)) for p in params if request.GET.get(p)]) # use just the request params whose value is not empty string Property.objects.filter(**kwargs) On Dec 16, 12:40 pm, Osiaq w

Re: Filter (AND excluding empty values)

2009-12-15 Thread creecode
Hello Osiaq, On Dec 15, 8:40 pm, Osiaq wrote: > Is there anyway to force filter to exclude null values from the > statement? > Logic: "if 'city' is null(or 0), exclude it from search term" ? Did you try the exclude method < http://docs.djangoproject.com/en/dev/ref/models/querysets/#exclude-kwa

FK to an Abstract class? Alternative?

2009-12-15 Thread Victor Hooi
heya, We have a small project where we need to store a series of exam results for students. Some exams receive a grade out of 100, others are simply a pass/fail, while others are given a one-word grade (e.g. pass, fail, credit, distinction). In a sense, they all do map to a 0 to 100 scale (e.g.

Re: can any on help me how to create a sample model project.

2009-12-15 Thread chiranjeevi muttoju
hi as i said that i had installed the mysql in other machine. when i installing the python-mysql connector using the command python setup.py build it giving the fallowing error: [r...@scci01 MySQL-python-1.2.3c1]# python setup.py build sh: mysql_config: command not found Traceback (most recent cal

Can a django form render a javascript (interactive) calendar?

2009-12-15 Thread codingJoe
I'm specifically using Google AppEngine, but this seems like this is more a django question. I need an my template to render an interactive Table that someone can click a date, or "Today". The typical javascript calendar will do. I can do this without django, but I would like my form to automati

Re: Can a django form render a javascript (interactive) calendar?

2009-12-15 Thread Kenneth Gonsalves
On Wednesday 16 Dec 2009 12:23:48 pm codingJoe wrote: > Is it possible for django to render a javascript calendar? How so? > If this is possible, a code snippet would be very helpful. > same as in normal html - you will have to manually render the form and attach the javascript calendar with th

Re: Can a django form render a javascript (interactive) calendar?

2009-12-15 Thread Kenneth Gonsalves
On Wednesday 16 Dec 2009 12:32:21 pm Kenneth Gonsalves wrote: > On Wednesday 16 Dec 2009 12:23:48 pm codingJoe wrote: > > Is it possible for django to render a javascript calendar? How so? > > If this is possible, a code snippet would be very helpful. > > > > same as in normal html - you will ha

Re: FK to an Abstract class? Alternative?

2009-12-15 Thread Maksymus007
On Wed, Dec 16, 2009 at 6:21 AM, Victor Hooi wrote: > heya, > > We have a small project where we need to store a series of exam > results for students. > > Some exams receive a grade out of 100, others are simply a pass/fail, > while others are given a one-word grade (e.g. pass, fail, credit, > di

Django editor for Debian

2009-12-15 Thread NMarcu
Hello all, Can you tell me a good Django editor for Debian? Something more pretty then default text editor. Something to can edit templates also. Thanks. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to dj