Re: Get current user outside a view / without an request object

2009-08-05 Thread Daniel Roseman
On Aug 6, 2:24 am, Julián C. Pérez wrote: > Hi everyone > I'm in trouble because of a form class > I have a form class with attributes defined, but with one thing: > One of the attributes requires the current user, or al least its > username > > The form definition in as shown below: > --- > clas

Re: Select Table or Database based on User

2009-08-05 Thread Daniel Roseman
On Aug 5, 11:38 pm, Wojciech Gryc wrote: > Thanks for your replies! > > The problem with storing the user ID for each table and then filtering > by the ID is that once the data set grows very large, this will become > extremely slow (as far as I understand). > > I expected to have about 2000 piec

Can I link python editor IDLE 1.2.4 to python manage.py shell

2009-08-05 Thread bvemu
Hi Is there any way to launch IDLE 1.2.4 (a python IDE on windows and comes default with python installation) when we want to launch a shell from manage.py for example # python manage.py shell should open up IDLE with the appropriate env variables set Thanks in advance Regards Subramanyam -

Re: django queryset based on when data created

2009-08-05 Thread Malcolm Tredinnick
On Wed, 2009-08-05 at 21:41 -0700, Joru wrote: > Everytime I edit some data, the data order in queryset changed into > the newest edited > Is it posible to get queryset that ordered based when the data created > without having to add creation date for sorting purpose The order results are returne

Re: Static content protection

2009-08-05 Thread Ronghui Yu
My solution now is enclosing the file with a HttpResponse and then return. It is a bit slow.I wonder if we can create a Apache module(or module for other server) to authenticate access to specific file. I don't have experience on this. On Thu, Aug 6, 2009 at 11:59 AM, Dj Gilcrease wrote: > > On

django queryset based on when data created

2009-08-05 Thread Joru
Everytime I edit some data, the data order in queryset changed into the newest edited Is it posible to get queryset that ordered based when the data created without having to add creation date for sorting purpose --~--~-~--~~~---~--~~ You received this message becau

Re: Admin site images not coming up in 1.1

2009-08-05 Thread Joshua Partogi
On Thu, Aug 6, 2009 at 2:34 PM, emily wong wrote: > > Thanks Malcolm, I've figured it out. There were some changes to the > admin's index.html page. I've updated to the 1.1 one. > All the best, > Emily > How did you fix it? Because I experience the same thing too. Regards, -- http://blog.scru

Re: Admin site images not coming up in 1.1

2009-08-05 Thread emily wong
Thanks Malcolm, I've figured it out. There were some changes to the admin's index.html page. I've updated to the 1.1 one. All the best, Emily --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To po

Re: Admin site images not coming up in 1.1

2009-08-05 Thread Malcolm Tredinnick
On Wed, 2009-08-05 at 21:09 -0700, emy_66 wrote: > Hi, > > Just migrating my application to 1.1. Everything works fine except the > images inside the admin site are not showing up. Any ideas why this > may be? Everything worked with 1.0.1 and 1.0.2 I think. Remember that the admin images and CSS

Re: Admin site images not coming up in 1.1

2009-08-05 Thread emily wong
Also it's just the first page of the admin after I log in that the stylesheet is not coming up. Other admin pages are displaying correctly. I have changed in url.py the admin line to '(r'^admin/', include(admin.site.urls)),' as recommended for 1.1 Emily On Aug 6, 2:09 pm, emy_66 wrote: > Hi,

Admin site images not coming up in 1.1

2009-08-05 Thread emy_66
Hi, Just migrating my application to 1.1. Everything works fine except the images inside the admin site are not showing up. Any ideas why this may be? Everything worked with 1.0.1 and 1.0.2 I think. Thanks, Emily --~--~-~--~~~---~--~~ You received this message bec

Re: Static content protection

2009-08-05 Thread Dj Gilcrease
On Wed, Aug 5, 2009 at 7:28 PM, TheIvIaxx wrote: > > Hello, I have a question that probably spans a few different groups. > However I know this setup is familiar withing the django community. > > I have apache handling all django/python stuff and have lighttpd > handling the static content.  All i

Re: apache

2009-08-05 Thread alexarsh
If you want to see your app from another computer in local network, you can run: python manage.py runserver 0.0.0.0:8000 Regards, Alex A. On Aug 5, 11:13 am, Salvatore Leone wrote: > Graham Dumpleton ha scritto:> You must recompile mod_python to use a > different Python version. > > Changing t

Re: syncdb does not find app on the PYTHONPATH

2009-08-05 Thread Kenneth Gonsalves
On Thursday 06 Aug 2009 8:45:59 am Matthew wrote: > Just did - I got the same message: > >>> c = coltrane.category() > > Traceback (most recent call last): > File "", line 1, in > AttributeError: 'module' object has no attribute 'category' please give your model and the whole traceback -- re

Re: Static content protection

2009-08-05 Thread theiviaxx
The only thing i can find right now is to deny access based on the remote ip. Not the best solution, but for internal it may work. Filter with a regex possibly. On Aug 5, 7:32 pm, Ronghui Yu wrote: > I have the similar problem. Could not find a good way either. > > > > > > On Thu, Aug 6, 2009 a

Re: syncdb does not find app on the PYTHONPATH

2009-08-05 Thread Matthew
Just did - I got the same message: >>> c = coltrane.category() Traceback (most recent call last): File "", line 1, in AttributeError: 'module' object has no attribute 'category' Thanks, Matthew --~--~-~--~~~---~--~~ You received this message because you are su

Re: Static content protection

2009-08-05 Thread Ronghui Yu
I have the similar problem. Could not find a good way either. On Thu, Aug 6, 2009 at 9:28 AM, TheIvIaxx wrote: > > Hello, I have a question that probably spans a few different groups. > However I know this setup is familiar withing the django community. > > I have apache handling all django/pyth

Re: Select Table or Database based on User

2009-08-05 Thread Javier Guerra
Wojciech Gryc wrote: > Filtering by user ID each time would > be extremely wasteful, would it not? not with the right indexes. -- Javier --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To pos

A form that doesn't render.

2009-08-05 Thread cornjuliox
I've got this form that won't display at all. The page renders properly, right up to the submit button, but the form isn't there and neither is the error message "No comments to display". I've looked over the view and everything looks fine, but it just doesn't work. Could someone take a look at it

Static content protection

2009-08-05 Thread TheIvIaxx
Hello, I have a question that probably spans a few different groups. However I know this setup is familiar withing the django community. I have apache handling all django/python stuff and have lighttpd handling the static content. All is well,works fine and fast. Auth is my problem on the stati

Get current user outside a view / without an request object

2009-08-05 Thread Julián C . Pérez
Hi everyone I'm in trouble because of a form class I have a form class with attributes defined, but with one thing: One of the attributes requires the current user, or al least its username The form definition in as shown below: --- class SendMessageForm(forms.Form): recipientUser = ShowV

Re: building directory path with user table

2009-08-05 Thread neridaj
I've revised my code but files are still getting uploaded to the 'listings' directory. class Listing(models.Model): user = models.ForeignKey(User) zipfile = models.FileField(upload_to='listings') name = models.CharField(max_length=50) order = models.ForeignKey('Order') def ov

Re: syncdb does not find app on the PYTHONPATH

2009-08-05 Thread Kenneth Gonsalves
On Thursday 06 Aug 2009 4:08:03 am Matthew wrote: > Thank you again for your help! maybe it is 'category' with a small 'c' -- regards kg http://lawgon.livejournal.com --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: checking if db schema and model match

2009-08-05 Thread kmike
That's a question about database migration. Django doesn't have built- in solution for that. Try using South (http://bitbucket.org/andrewgodwin/south/overview/), it is a very good db migration app. I suggest using development version because (based on my experience) it is more robust than last off

New Django user: best way to load/verify/update/create data from a csv file

2009-08-05 Thread Glaskows
Hi, I need to do the following thing: - form where the user select a csv file (done) - load a view where the file is loaded and parsed (done) (from now on I am having doubts of the proper solution) - present to user a page where there are three list: 1) data entries with errors (missing o in

Announce: django-ldap-groups

2009-08-05 Thread Peter Herndon
I'm pleased to announce the release of django-ldap-groups. Of special interest for building intranet sites, django-ldap-groups allows Django users to authenticate against LDAP, and allows site administrators to map LDAP organizational units (OUs) to Django groups. This mapping allows LDAP-au

Re: multiple projects shared database

2009-08-05 Thread Malcolm Tredinnick
On Wed, 2009-08-05 at 17:59 +0100, Robin Becker wrote: > My boss wants to have two different django controlled websites with a common > database. Is there a way to do this? > > We are already running multiple websites into a single django project and > because they have a disambiguating term in

Re: Practical Django Projects Chp. 3: TinyMCE won't appear in admin

2009-08-05 Thread Matthew
It looks like you have 2 slashes on the line for tiny_mce.js: ...should read: Hopefully that's it. I'm on Chapter 4 and stuck: http://groups.google.com/group/django-users/browse_thread/thread/db2b3bd39a2525fc Let me know if you have the same problem or can help out when you get there :-)

Re: Touch django.wsgi not reloading daemon

2009-08-05 Thread Graham Dumpleton
On Aug 6, 7:53 am, Sean Kemplay wrote: > You are correct - it actually didn't work - it just seemed to. > > The issue was resolved by installing the latest version of mod_wsgi > from source - I am using ubuntu hardy server edition. > > I uninstalled, installed from source, enabled the module us

Re: Select Table or Database based on User

2009-08-05 Thread Maksymus007
On Thu, Aug 6, 2009 at 12:38 AM, Wojciech Gryc wrote: > > Thanks for your replies! > > The problem with storing the user ID for each table and then filtering > by the ID is that once the data set grows very large, this will become > extremely slow (as far as I understand). > > I expected to have a

How to specify site's domain dynamically in development environment

2009-08-05 Thread Margie
My app needs to create a public url for its objects in order to send that out via email. My code does this by prefixing site.domain to the relative portion of the url. When working in my development environment (using runserver), the machine I am running the server on frequently changes. I was

Re: syncdb does not find app on the PYTHONPATH

2009-08-05 Thread Matthew
I tried what you asked, and found no errors when importing, but errors when I tried to use the imported class. It seems as though it finds 'coltrane', but can't find the models in the app. Here is the result: python Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18) [GCC 4.3.3] on linux2 Typ

Re: Select Table or Database based on User

2009-08-05 Thread Wojciech Gryc
Thanks for your replies! The problem with storing the user ID for each table and then filtering by the ID is that once the data set grows very large, this will become extremely slow (as far as I understand). I expected to have about 2000 pieces of information per user, with several dozen users (

Re: adapt admin interface

2009-08-05 Thread Peter Herndon
On 08/05/2009 03:36 PM, sveri wrote: > Hi, > > i wonder if it is possible to change the admin interface of an app > like that: > Yes, it is very possible. > Now i go to the admin interface of Entries and want to add a new > Entry. > Then i select a party for the new entry. > After having that

Re: cache and multple languages

2009-08-05 Thread kmike
Hi, I've recently create an app for advanced view caching. It allow pages to be cached based on anything in request, specific cookies for example. Please check http://bitbucket.org/kmike/django-view-cache-utils/wiki/Home If you have any questions about it feel free to ask. On 5 авг, 20:11, cwurl

Practical Django Projects Chp. 3: TinyMCE won't appear in admin

2009-08-05 Thread Jeff
I have installed TinyMCE to my machine but I cant get it to appear in my admin screen. I am working through "Practical Django Projects" by James Bennett chapter 3. I am using windows not Linux so sometimes my errors are simply forward vs. backwards slashes but it doesn't appear to be the issue thi

Re: Touch django.wsgi not reloading daemon

2009-08-05 Thread Sean Kemplay
You are correct - it actually didn't work - it just seemed to. The issue was resolved by installing the latest version of mod_wsgi from source - I am using ubuntu hardy server edition. I uninstalled, installed from source, enabled the module using the original ubuntu config files that were left

Re: Simultaneous use of the admin interface

2009-08-05 Thread David
> 1) sign into admin as user A in one browser and begin to edit a record > 2) sign into admin as user B in another browser and begin to edit the > SAME record To clarify, both users have their browsers pointing at the editing form for the same instance of the same model, e.g.: http://example.com/

Re: Simultaneous use of the admin interface

2009-08-05 Thread David
On Aug 5, 5:21 pm, Margie wrote: >  I think > that when fields became editable in 1.1, this was not handled and > needs to be adressed in order for multiple people to modify at once. > Thanks Margie. I wasn't referring to list_editable though, but perhaps the problem is the same? --~--~-

Re: default blank choice on form.Form select widget

2009-08-05 Thread jheasly
Hey Paulo, No I hadn't seen the ticket. Thanks for the heads up. Hard to tell from Trac what is holding up 4092. I see 10969 is more recent, but a different angle of attack on the issue. — John --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: Select Table or Database based on User

2009-08-05 Thread Paulo Almeida
Yeah, the way I do that is have a foreign key with the user in the table with private data and then filter by user when retrieving data in the view. On Wed, Aug 5, 2009 at 10:11 PM, Maksymus007 wrote: > > > > > Hi everyone, > > > > I'm sure this has come up in the past, but I sincerely can't fin

Re: Django/ Python 3 - nervous about starting large project

2009-08-05 Thread Wayne Koorts
Hi Tony, > However, I'm nervous about the Python 3 situation.  What if I start > building a large project based on Django/Python 2.6, and then a year > or two down the road the project starts limping because of all of the > cool new Python 3 modules coming out?  And I've got a bunch of Django/ >

Re: Simultaneous use of the admin interface

2009-08-05 Thread Margie
I posted this same issue to the issue tracker a couple months ago, here is the report: http://code.djangoproject.com/ticket/11313 I do believe this is a shortcoming of the admin interface. I think that when fields became editable in 1.1, this was not handled and needs to be adressed in order fo

Re: Touch django.wsgi not reloading daemon

2009-08-05 Thread Graham Dumpleton
On Aug 5, 11:12 pm, Sean Kemplay wrote: > Hi all. > > I have resolved this by adding user=www-data group=www-data to the > WSGIDaemonProcess: > > WSGIDaemonProcess sean75_ispy user=www-data group=www-data That change shouldn't have made any difference as those are the defaults for user/group a

Re: Memory error

2009-08-05 Thread Peter Herndon
On 08/05/2009 04:09 PM, drakkan wrote: > The code is something like this > > obj=DBModels.objects.filter(somefilter) > results=[] > for o in obj: >results.append({'field1':o.field1,'field2':o.field2}) > > return JsonResponse(results) > > where JsonResponse is a class derived from HttpResponse

Re: Django/ Python 3 - nervous about starting large project

2009-08-05 Thread Berco Beute
No worries, Python 2.6 will be actively supported for many, many years to come and the differences between 2.6 and 3 are not that huge. You can program for 2.6 while keeping in mind the code will be ported to 3 one day. It'll make a shift a breeze. 2B On Aug 5, 10:47 pm, snfctech wrote: > Hello

Re: Multiple instances of the same form on one page: how to get the right POST data?

2009-08-05 Thread Maksymus007
On Wed, Aug 5, 2009 at 11:16 PM, Berco Beute wrote: > >> You forgot to set the prefix here, so the form that the user is >> submitting their data from doesn't have the fields named correctly. You >> need to set it up exactly the same way at this point as you did in the >> POST path, with the excep

Re: Multiple instances of the same form on one page: how to get the right POST data?

2009-08-05 Thread Berco Beute
> You forgot to set the prefix here, so the form that the user is > submitting their data from doesn't have the fields named correctly. You > need to set it up exactly the same way at this point as you did in the > POST path, with the exception of not prepopulating with data. Thanks, the missing

Re: Select Table or Database based on User

2009-08-05 Thread Maksymus007
> > Hi everyone, > > I'm sure this has come up in the past, but I sincerely can't find it > in any of the Django tutorials, documentation, or websites. I > apologize in advance if I missed something! > > I'm trying to develop a website where different users store their own > sets of contacts / art

Django/ Python 3 - nervous about starting large project

2009-08-05 Thread snfctech
Hello. We are researching technologies to begin what may become a pretty large intranet Dashboard project. I'm a PHP developer, so the fact that Django uses Python doesn't give me a head-start - but I've been wanting to consider it, because I am interested in learning Python. However, I'm nervo

Select Table or Database based on User

2009-08-05 Thread Wojciech Gryc
Hi everyone, I'm sure this has come up in the past, but I sincerely can't find it in any of the Django tutorials, documentation, or websites. I apologize in advance if I missed something! I'm trying to develop a website where different users store their own sets of contacts / articles / etc. If

Simultaneous use of the admin interface

2009-08-05 Thread David
Using Django 1.1 if I do: 1) sign into admin as user A in one browser and begin to edit a record 2) sign into admin as user B in another browser and begin to edit the SAME record 3) make a change as user A and press Save 4) make a different change as user B and press Save The result is that A's

adapt admin interface

2009-08-05 Thread sveri
Hi, i wonder if it is possible to change the admin interface of an app like that: Imagine i have a model: class Entries(models.Model): party = models.ForeignKey('party.Parties') politician = models.ForeignKey('politician.Politicians') name = ... Now i go to the admin interface of En

Re: Apache and mod_wsgi on Ubuntu

2009-08-05 Thread Steve1234
Thanks, I got it working. I searched this forum and I even read the page referenced but still missed the answer. Thanks again this forum is very helpful. The fix was to add one line to the django.wsgi file to end up with this: import os import sys sys.path.append('/home/steve) sys.path.append('/h

Re: default blank choice on form.Form select widget

2009-08-05 Thread Paulo Almeida
Did you see this ticket? http://code.djangoproject.com/ticket/4092 Maybe you can use the patch code to customize your field. - Paulo On Wed, Aug 5, 2009 at 8:01 PM, JHeasly wrote: > > The doc page "Creating forms from models" > (http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#to

Re: Memory error

2009-08-05 Thread drakkan
The code is something like this obj=DBModels.objects.filter(somefilter) results=[] for o in obj: results.append({'field1':o.field1,'field2':o.field2}) return JsonResponse(results) where JsonResponse is a class derived from HttpResponse that add a simplejson.dumps I have a really large databa

Re: Memory error

2009-08-05 Thread Peter Herndon
On 08/05/2009 12:26 PM, drakkan wrote: > No I'm not serving static file I have a very large json file > dinamycally generated (based on a db query) > Please post the relevant view and model code, so we can see what's happening. Also, if your db query is actually a really large number of db

default blank choice on form.Form select widget

2009-08-05 Thread JHeasly
The doc page "Creating forms from models" (http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#topics- forms-modelforms) describes how "If the model field has choices set ... [snip] ... The choices will normally include the blank choice which is selected by default. ... " I have a form

Re: Have I found a bug? Deletion and rolled back transactions

2009-08-05 Thread Peter Bengtsson
2009/8/5 Alex Gaynor : > > On Wed, Aug 5, 2009 at 11:31 AM, Peter Bengtsson wrote: >> >> I have found that when running this as a normal server, the rollback >> DOES work. It's just in tests it doesn't work. >> >> On 5 Aug, 17:27, Peter Bengtsson wrote: >>> Here's the models: >>> >>> # models.py

Re: multiple projects shared database

2009-08-05 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 There is no problem with that, as long as your code accounts for it. Luke luke.seelenbin...@gmail.com Robin Becker wrote: > My boss wants to have two different django controlled websites with a common > database. Is there a way to do this? > > We

Re: Have I found a bug? Deletion and rolled back transactions

2009-08-05 Thread Alex Gaynor
On Wed, Aug 5, 2009 at 11:31 AM, Peter Bengtsson wrote: > > I have found that when running this as a normal server, the rollback > DOES work. It's just in tests it doesn't work. > > On 5 Aug, 17:27, Peter Bengtsson wrote: >> Here's the models: >> >> # models.py >> class Article(models.Model): >>

multiple projects shared database

2009-08-05 Thread Robin Becker
My boss wants to have two different django controlled websites with a common database. Is there a way to do this? We are already running multiple websites into a single django project and because they have a disambiguating term in the urls eg each url has /lang/brand/path we can map the UR

Re: Unit test failing with 302 instead of 200, using Django's TestCase class

2009-08-05 Thread Paulo Almeida
Mystery solved. The fixtures were not being imported after all. My list_experiments view imports files from a certain folder, and that was the experiment data being listed. Then the database was rolled back before the view_experiment test started, and naturally the experiment with id 1 was not the

Re: Sending File Upload Handler errors to the view

2009-08-05 Thread Kai
I've found a reason for why I couldn't get it working and a solution as well. It would appear that Django uses lazy evaluation for request.FILES to determine when the upload handler is called. Therefore, the upload handler is only evoked when and if you attempt to access request.FILES. Additional

Re: Have I found a bug? Deletion and rolled back transactions

2009-08-05 Thread Peter Bengtsson
I have found that when running this as a normal server, the rollback DOES work. It's just in tests it doesn't work. On 5 Aug, 17:27, Peter Bengtsson wrote: > Here's the models: > > # models.py > class Article(models.Model): >     title = models.CharField(max_length=100) > > # urls.py > urlpatter

Have I found a bug? Deletion and rolled back transactions

2009-08-05 Thread Peter Bengtsson
Here's the models: # models.py class Article(models.Model): title = models.CharField(max_length=100) # urls.py urlpatterns = patterns('', (r'^delete-rolledback/$', delete_rolledback), ) # views.py def delete_rolledback(request): transaction.enter_transaction_management() transac

Re: Memory error

2009-08-05 Thread drakkan
No I'm not serving static file I have a very large json file dinamycally generated (based on a db query) On 5 Ago, 15:28, Mike Ramirez wrote: > On Wednesday 05 August 2009 04:08:15 am drakkan wrote: > > > > > here is the excpetion returned while trying to serve a large file: > > > Traceback: > >

Re: field order:ModelForm

2009-08-05 Thread Emily Rodgers
2009/8/5 Ludwik Trammer : > >> I tried adding a fields attribute to the Meta class (which I think is >> what you would do in the dev version), but that didn't work. > > Django 1.1 stable is out and supports this feature, so if you can > upgrade it will probably be the easiest solution. OK I will

DjangoCon '09 - DoubleTree Green Room Block

2009-08-05 Thread Robert Lofthouse
I would like to make everyone aware that the room block ends on Monday, August 17th. You will still be able to register for the conference up to the 4th September, but accommodation-wise you will either have to register with the DoubleTree Green hotel at the regular rate or try and find cheaper ac

Sending File Upload Handler errors to the view

2009-08-05 Thread Kai
Hi all, I want to stop any file uploads that don't end in my designated extension as soon as they're received. To do this, I define a custom Upload Handler and write new_file to look something like this: def new_file(self, field_name, file_name, content_type, content_length, charset=None):

Re: Counting results

2009-08-05 Thread Randy Barlow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 When ideas fail declared: > Hi, I was wondering what is the simpliest way to count the number of > objects returned in a QuerySet? > > Basically i have a blog and i want to count the number of comment > relating to each post and display it, the blog

Re: Counting results

2009-08-05 Thread Luke Seelenbinder
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I believe QuerySets have a .count() method. Luke luke.seelenbin...@gmail.com When ideas fail wrote: > Hi, I was wondering what is the simpliest way to count the number of > objects returned in a QuerySet? > > Basically i have a blog and i want to

Counting results

2009-08-05 Thread When ideas fail
Hi, I was wondering what is the simpliest way to count the number of objects returned in a QuerySet? Basically i have a blog and i want to count the number of comment relating to each post and display it, the blog posts are shown on a seperate page to the comments but i guess you would still have

Re: Searchform with pagination and GET parameters - easy solution needed

2009-08-05 Thread Alex Gaynor
On Wed, Aug 5, 2009 at 10:03 AM, tom wrote: > > Hi folks, > > i want to build a searchform (with GET parameters) and also want to > use pagination. But i can't find an easy solution for this common > case. > My solution has a searchform, a view and a template. Can anybody tell > me if this is a go

Searchform with pagination and GET parameters - easy solution needed

2009-08-05 Thread tom
Hi folks, i want to build a searchform (with GET parameters) and also want to use pagination. But i can't find an easy solution for this common case. My solution has a searchform, a view and a template. Can anybody tell me if this is a good solution? I'm not sure because i find it very complicate

Django-Checks?

2009-08-05 Thread Cristiano
Some guy made a pretty handy site/tool for Symfony developers: http://symfony-check.org/ Basically it's a site that gives you a checklist of things you ought to go through before deploying/putting live your site. Anyone got a clue of something like this for Django, or iswilling to work on buildi

Re: field order:ModelForm

2009-08-05 Thread Ludwik Trammer
> I tried adding a fields attribute to the Meta class (which I think is > what you would do in the dev version), but that didn't work. Django 1.1 stable is out and supports this feature, so if you can upgrade it will probably be the easiest solution. --~--~-~--~~~---~-

Re: Multiple data formats for one view

2009-08-05 Thread Ludwik Trammer
If you do this just for unintrusive AJAX functionality you can simply use HttpRequest.is_ajax() http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.is_ajax if request.is_ajax(): # return data serialized to JSON or XML else: # render data in HTML template

Use of the ORM in long running (non web) daemon

2009-08-05 Thread wam
I am using the Django ORM to build and manipulate models from outside of a web context and within a long running daemonized application. I'm using the django ORM talking to a postgresql db for this processing since the results of this external processing are then used by a Django based web reporti

cache and multple languages

2009-08-05 Thread cwurld
Hi, I have been successfully running a multi-language site for a while now. The users language pref is stored (along with other data) in a cookie. Recently, I have been trying to cache some of the more common and processor intensive views. Since the language code is not in the url, I can't figur

Re: apache ok (mod_wsgi) bue some issue with admin backend

2009-08-05 Thread Salvatore Leone
Graham Dumpleton ha scritto: > > > The mod_python documentation is not really appropriate for explaining > how static files are hosted when using mod_wsgi as mod_wsgi handles it > differently. Instead see documentation on mod_wsgi site. > > http://code.google.com/p/modwsgi/wiki/IntegrationWithDj

Re: No data in template available

2009-08-05 Thread Frulli58
Now i understand and this way it makes sense. Thank you very much Uli On 5 Aug., 15:54, Daniel Roseman wrote: > On Aug 5, 1:44 pm, Frulli58 wrote: > > > > > Hi together, > > till now we worked with PHP. For a new database I desided to try > > python and django. > > I´m trying to find the right

Re: No data in template available

2009-08-05 Thread Daniel Roseman
On Aug 5, 1:44 pm, Frulli58 wrote: > Hi together, > till now we worked with PHP. For a new database I desided to try > python and django. > I´m trying to find the right way and now I have a problem, that I can > ´t get data within a template. > My view: > from Django_Demo.news.models import D300,

Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs
Ticket #11638 ... --~--~-~--~~~---~--~~ 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 django-users+un

Re: Memory error

2009-08-05 Thread Mike Ramirez
On Wednesday 05 August 2009 04:08:15 am drakkan wrote: > here is the excpetion returned while trying to serve a large file: > > Traceback: > File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" > in get_response > 92. response = callback(request, *callback_args, >

Re: Calculating a date

2009-08-05 Thread Mike Dewhirst
adelaide_mike wrote: > This should really be a Python enquiry, but I am sure someone will > know: > > I need to calculate the date 12 weeks before today. What is the best > way? TIA This might give you a clue ... from datetime import date def anniversary_this_week(self, tday=date.today()):

Re: Calculating a date

2009-08-05 Thread Spajderix
From what i know, you can operate on datetime.datetime objects using datetime.timedelta, eg: datetime.datetime.now() - datetime.timedelta(days=84) will give you datetime.datetime object with date of today - 12 weeks Link to manual: http://docs.python.org/library/datetime.html#datetime.timede

Re: Calculating a date

2009-08-05 Thread krylatij
from datetime import date, timedelta a = date.today() - timedelta(7 * 12) print a 2009-05-13 --~--~-~--~~~---~--~~ 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@goog

Re: Calculating a date

2009-08-05 Thread Mike Ramirez
On Wednesday 05 August 2009 06:01:11 am adelaide_mike wrote: > This should really be a Python enquiry, but I am sure someone will > know: > > I need to calculate the date 12 weeks before today. What is the best > way? TIA > > Mike > --~--~-~--~~~---~--~~ > You rece

field order:ModelForm

2009-08-05 Thread Emily Rodgers
Hi, I am using django 1.0.2, and I was wondering if it is possible to change the order of the fields (it seems you can do this in the dev version)? I have added an extra field in my form (that doesn't actually correspond with a field in the model). It is being listed after the model fields, and

Re: Memory error

2009-08-05 Thread drakkan
No sorry isn't a file upload but is django to serve a large file On 5 Ago, 13:47, krylatij wrote: > tryhttp://docs.djangoproject.com/en/dev/ref/settings/#file-upload-max-me... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Touch django.wsgi not reloading daemon

2009-08-05 Thread Sean Kemplay
Hi all. I have resolved this by adding user=www-data group=www-data to the WSGIDaemonProcess: WSGIDaemonProcess sean75_ispy user=www-data group=www-data Regards, Sean On Aug 5, 1:46 pm, Sean Kemplay wrote: > Hi All, > > I have the following in my virtual host config: > > WSGIDaemonProcess sea

Calculating a date

2009-08-05 Thread adelaide_mike
This should really be a Python enquiry, but I am sure someone will know: I need to calculate the date 12 weeks before today. What is the best way? TIA Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django u

Re: Multiple data formats for one view

2009-08-05 Thread Sam Lai
I have a piece of middleware which assigns the right MIME type based on URL extension, then I have templates for XML, JSON and HTML. My view function simply gets the required context objects, then passes it to the appropriate template. This could probably be generified to make it more reusable.

Re: Validation

2009-08-05 Thread StevenC
There seems to be nothing on the doccumentation. On 5 Aug, 12:12, StevenC wrote: > NameError at /application/ > name 'input_formats' is not definedRequest Method: POST > Request URL:http://webapps.stamford.ac.uk/application/ > Exception Type: NameError > Exception Value: name 'input_formats' is

Touch django.wsgi not reloading daemon

2009-08-05 Thread Sean Kemplay
Hi All, I have the following in my virtual host config: WSGIDaemonProcess sean75_ispy WSGIProcessGroup sean75_ispy and the following in my django.wsgi: import os, sys sys.path.append('/srv/home/sean75/django/') os.environ['DJANGO_SETTINGS_MODULE'] = 'ispy.settings' import django.core.handlers.

No data in template available

2009-08-05 Thread Frulli58
Hi together, till now we worked with PHP. For a new database I desided to try python and django. I´m trying to find the right way and now I have a problem, that I can ´t get data within a template. My view: from Django_Demo.news.models import D300, D200, D840 from django.http import HttpResponse f

Re: HttpResponseRedirect and encoding

2009-08-05 Thread alecs
After jumping to sqlite Internal Server Error is not raised, just Environment: Request Method: GET Request URL: http://172.16.23.33/file/2840e589359de657b7275adcb60d4fbea6472e2a7746b3c9d451cb4b Django Version: 1.1 Python Version: 2.6.2 Installed Applications: ['django.contrib.auth', 'django.co

checking if db schema and model match

2009-08-05 Thread Sam Lai
I hope this hasn't been asked before; had a quick look through the archives and docs but couldn't find anything. Is it possible to get django (e.g. via manage.py) to CHECK if the db schema and model match? I don't want it to change anything, just to tell me if there is a mismatch, and what that i

Re: HttpResponseRedirect and encoding

2009-08-05 Thread Jarek Zgoda
Wiadomość napisana w dniu 2009-08-05, o godz. 13:29, przez alecs: > The problem happens when django is trying to path.encode('us- > ascii') ... > What can be the reason and how to prepare string to be successfully > processed ? If path is bytestring, calling .encode() will first try to decode i

  1   2   >