Re: 5 GET request after one AJAX request

2011-02-06 Thread Cal Leeming [Simplicity Media Ltd]
Could you post some actual logs of this happening? On Sun, Feb 6, 2011 at 11:37 PM, Loïc B. wrote: > Hi, > > title may be confusing, I explain myself. > Using Django, I recently put in place AJAX request handling in my > views. > > Before, no problem : > - one adress

Re: Help on adding CSS to django project

2011-02-06 Thread Martin Tiršel
Hello, please read the documentation, everything you need to know, is described there. For development: http://docs.djangoproject.com/en/1.2/howto/static-files/ And for production: http://docs.djangoproject.com/en/1.2/howto/deployment/modwsgi/ Regards, Martin On Mon, 07 Feb 2011 00:47:27

Re: Amazing work

2011-02-06 Thread Mike Seidle
On Sunday, February 06, 2011 02:54:23 pm Cal Leeming [Simplicity Media Ltd] wrote: > Interesting. See, when I compared Zope to Django, I found Django's > extensive documentation and feature set to be perfect for prototyping, and > then optimizing bottlenecks at a later date, either via C

5 GET request after one AJAX request

2011-02-06 Thread Loïc B .
Hi, title may be confusing, I explain myself. Using Django, I recently put in place AJAX request handling in my views. Before, no problem : - one adress typing on client side <-> one GET request on server side - one click on Submit button on a form (client-side) <-> one POST request on server

Re: Help on adding CSS to django project

2011-02-06 Thread h@ck5t0ck
Guys, Can anyone zipped a working django project which made use of css and mail it to me at hackstock...@gmail.com so that I can study how he went about doing it? Thanks in advance. Best Wishes, h@ck5t0ck On Feb 6, 12:36 pm, "h@ck5t0ck" wrote: > Ronghui Yu, > Can you

Re: Date internationalizaation

2011-02-06 Thread Lachlan Musicman
On Sat, Feb 5, 2011 at 22:38, Simon W wrote: > Hey, > I have a datetime field in my models. When I format the date into letters it > appears in english and I'd like it in another langue. How to? Have you turned on i18n/L10n in your settings?

Re: model names

2011-02-06 Thread Bobby Roberts
ah... i only had that on he admin model On Feb 6, 12:07 pm, Ivo Brodien wrote: > On 06.02.2011, at 18:01, Bobby Roberts wrote: > > > yeah i tried that already and it didn't work > > did you also define the meta class for the Admin class? -- You received this message because

How can I show a list of values in a text input field?

2011-02-06 Thread Nate Reed
I posted this question on StackOverflow, too. I have defined a Model with a ManyToManyField, and I want the field to show the values joined by spaces, for example: I have defined the form to use CharField to represent the multiple values: class MyForm(ModelForm): foo =

answer to question related about the *.html filling with values

2011-02-06 Thread gintare
it is incredibly easy, just difficult to guess out without example. *.html {{Output}} # views.py def web(request): Out, Ww =request.GET.get('Output',''), request.GET.get('sWw','') Out='naujas zodis' sWw= 'off' t =

Re: Amazing work

2011-02-06 Thread Cal Leeming [Simplicity Media Ltd]
Interesting. See, when I compared Zope to Django, I found Django's extensive documentation and feature set to be perfect for prototyping, and then optimizing bottlenecks at a later date, either via C extensions, raw SQL replacement etc. However, as 'cliché' as this may sound, most large

Re: Use development server database with production server

2011-02-06 Thread Cal Leeming [Simplicity Media Ltd]
Hi, Here is the the way that we have done it for the last 18 months, and has proven very useful and almost human error free. I've posted all the concept inside: http://djangosnippets.org/snippets/2349/ This method allows you to separate the settings.py based on the local server hostname, and/or

Re: File Upload

2011-02-06 Thread vanderkerkoff
Thanks again Karen On Feb 6, 6:06 pm, Karen Tracey wrote: > On Sun, Feb 6, 2011 at 12:45 PM, vanderkerkoff wrote: > > I got it :-) > > > import os > > PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) > > > # MEDIA_ROOT = ( > > #      

Re: Database per user

2011-02-06 Thread Chris Hannam
Hi, http://docs.djangoproject.com/en/1.2/topics/db/multi-db/ contain information about setting up multiple databases. I personally have no idea how this would scale to may users. If you are looking to store large amounts of data I would look at an alternative to SQLite. I have found 

Re: File Upload

2011-02-06 Thread Karen Tracey
On Sun, Feb 6, 2011 at 12:45 PM, vanderkerkoff wrote: > I got it :-) > > import os > PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) > > # MEDIA_ROOT = ( > # os.path.join(PROJECT_PATH, 'static/media/'), > # ) > > MEDIA_ROOT =

Re: File Upload

2011-02-06 Thread vanderkerkoff
I got it :-) import os PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) # MEDIA_ROOT = ( # os.path.join(PROJECT_PATH, 'static/media/'), # ) MEDIA_ROOT = '/Users/mjdavies/Sites/django/governors/static/media/' statically pointing the media root works I use the same method above

Re: File Upload

2011-02-06 Thread vanderkerkoff
Hi Karen I promise you I'm changing the code that I'm displaying, I've been updating the app all day, just tying off some loose ends now. I've tried copying and pasting all the variables but it looks like garbage in dpaste. One thing that I'm not sure if right is the value of the the_file

Re: model names

2011-02-06 Thread Ivo Brodien
On 06.02.2011, at 18:01, Bobby Roberts wrote: > yeah i tried that already and it didn't work did you also define the meta class for the Admin class? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: model names

2011-02-06 Thread Bobby Roberts
yeah i tried that already and it didn't work On Feb 6, 11:38 am, Joel Goldstick wrote: > On Sun, Feb 6, 2011 at 11:33 AM, Bobby Roberts wrote: > > if i have a model name "Facility", django adds an "s" to it in /admin > > and it shows up as

Database per user

2011-02-06 Thread Giilp
Hi, I am a starting in Django, working on the architecture of my future application. My application involves users creating a large amount of points. In the old application (php), there was significant perf. issues because of the large amout of points in the database. I was wondering if it would

Re: File Upload

2011-02-06 Thread Karen Tracey
On Sun, Feb 6, 2011 at 11:11 AM, vanderkerkoff wrote: > Hi Karen > > Thanks for getting back > > Here's the model def > > http://dpaste.com/391872/ > > I cut and pasted that model definition, plus the model admin shown earlier, into a test project, and I'm able to add

Re: model names

2011-02-06 Thread Joel Goldstick
On Sun, Feb 6, 2011 at 11:33 AM, Bobby Roberts wrote: > if i have a model name "Facility", django adds an "s" to it in /admin > and it shows up as Facilitys. How can I make it show up as > "Facilities" in /admin? > > -- > You received this message because you are subscribed

Re: File Upload

2011-02-06 Thread vanderkerkoff
Hiya both I'm outputting all the data types I'm saving now in a save in the admin.py, they're all strings :-( I'm going to kick myself when I find it On Feb 6, 4:11 pm, vanderkerkoff wrote: > Hi Karen > > Thanks for getting back > > Here's the model def > >

Re: handle runtime exceptions in django view functions

2011-02-06 Thread Shawn Milochik
Use Python's logging. http://docs.python.org/library/logging If you're using the 1.3 beta, logging config is built into settings.py. Then, in your try/except blocks, you can log anything you want; pass the exception message and the traceback into your call to the logger, and it'll all be

population of *.html fields from Django

2011-02-06 Thread gintare
I would like to use only plain html field names Reading them is not a problem with request in views. How to populate html document back ? I have *.html with lines: #in views.py item = request.POST.get('cbnWw','') #do smth with item #now i would like to return item back to html.

model names

2011-02-06 Thread Bobby Roberts
if i have a model name "Facility", django adds an "s" to it in /admin and it shows up as Facilitys. How can I make it show up as "Facilities" in /admin? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: File Upload

2011-02-06 Thread vanderkerkoff
Hi Karen Thanks for getting back Here's the model def http://dpaste.com/391872/ On Feb 6, 3:33 pm, Karen Tracey wrote: > On Sun, Feb 6, 2011 at 9:50 AM, vanderkerkoff wrote: > > I'm trying to upload a file in a project, the app is called Documents, >

Re: File Upload

2011-02-06 Thread Chris Hannam
Hi, startswith is usually a string method. Looks like something is calling .startwith() on a tuple rather than the expected string. When you instantiate your model are you certain all the values are correct? Try logging all the values before creating the model and look for a tuple where there

Re: How to know if is a update or insert??

2011-02-06 Thread Marc Aymerich
On Sun, Feb 6, 2011 at 2:53 PM, andmart wrote: > In a insert or in a update, the pk is already filled in > ModelAdmin.save_model. > > The creation of object in database is in ModelForm.save. > > So, I think it's not the way to handle it. > > I notivced googling there is a

Re: File Upload

2011-02-06 Thread Karen Tracey
On Sun, Feb 6, 2011 at 9:50 AM, vanderkerkoff wrote: > I'm trying to upload a file in a project, the app is called Documents, > here's the admin.py > > [snipped] More interesting than the admin.py for this model would have been the model definition itself. > > I keep getting

CheckboxSelectMultiple widget not ticked correctly according to loaded CharField value

2011-02-06 Thread Haisheng HU
So I have a form: class ProjectUpdateForm(ModelForm): products = MultipleChoiceField(label = u'Products', widget=CheckboxSelectMultiple) def __init__(self, *args, **kwargs): self.fields['products'].choices = [(x.code, x.name) for x in Product.objects.order_by('code')]

File Upload

2011-02-06 Thread vanderkerkoff
Hello everyone I'm trying to upload a file in a project, the app is called Documents, here's the admin.py from django.contrib import admin from governors.documents.models import Document import datetime class DocumentAdmin(admin.ModelAdmin): fields =

Re: Upgrading to 1.2.4

2011-02-06 Thread vanderkerkoff
Aha I had the old admin line still in the urls file beneath the new one, it was twistin the melons :-) I've deleted the old line and all is well. On Feb 6, 1:38 pm, vanderkerkoff wrote: > Hi Guys > > I've gone a long way to upgrade an application we wrote in ages ago in >

Re: different length queries

2011-02-06 Thread gintare
Thanks a lot for the answers! I did not found that it is possible to use dictionaries and lists in query. In the end i used raw function to form string according form input. Lists and Dictionaries is much better way, since i am not tied to certain database. regards, gintare On Feb 3, 12:08 pm,

Re: how to make a datatime filed model without timestamp?

2011-02-06 Thread Aryeh Leib Taurog
On Feb 5, 1:04 pm, Nima Gaemi wrote: > hello, > i am using Djano 1.3 rev.15387 and i made a field > 'last_updated=models.DateTimeField(auto_now=True)' > when i wanted to get the data out of the database i wanted to get a > delta with datetime module of python but i was warned

Re: How to define each model in its own file

2011-02-06 Thread Mark (Nosrednakram)
If there isn't anything in your models/__init__.py nothing will get loaded. You might try somthing like the following in your models/ __init__.py: from app.models import modelname from app.models import anothermodelname Where modlenames are actually individual files with model definitions.

Re: Having trouble creating instances of another model in the __init__ of one model

2011-02-06 Thread Aryeh Leib Taurog
On Feb 5, 5:09 pm, Daniel Klein wrote: > So I need to create the two teams for a new game instance when I > create the game instance? That just feels so clumsy. Doesn't seem so terrible to me, but if you're likely to do it in several places you could use a custom ModelManager

Re: How to know if is a update or insert??

2011-02-06 Thread andmart
In a insert or in a update, the pk is already filled in ModelAdmin.save_model. The creation of object in database is in ModelForm.save. So, I think it's not the way to handle it. I notivced googling there is a boolean parameter named change and I'm using it. On 4 fev, 21:09, Marc Aymerich

Upgrading to 1.2.4

2011-02-06 Thread vanderkerkoff
Hi Guys I've gone a long way to upgrade an application we wrote in ages ago in really old django to new django, I've got stuck some way into it though. Front end all sorted, I can fire up the app so the admin.py stuff is all working, but when I click on anything inside the admin, for this

Re: Amazing work

2011-02-06 Thread Mike Seidle
On Thursday, February 03, 2011 08:02:43 pm Cal Leeming [Simplicity Media Ltd] wrote: > May I ask, how well did you get along with Zope? From what I can tell, > Django is suited for SME, where as Zope is the kinda thing that banks would > be using etc. Cal - I just used Django to write a credit

How to define each model in its own file

2011-02-06 Thread h@ck5t0ck
Hi Guys, Am very new to django and am working on a relatively large web application which includes over 15 models. Now I want to define each model in its own file and store them in a folder called models, so I first created the folder "models" and created a file "__init__.py" in that folder and

Re: Help on adding CSS to django project

2011-02-06 Thread h@ck5t0ck
Ronghui Yu, Can you please tell me which middleware you're talking about here? I've still not been able to get my css to work. On Feb 5, 11:29 am, Ronghui Yu wrote: > It seems that you need to setup your web server to support static contents, > django has a middleware to do

handle runtime exceptions in django view functions

2011-02-06 Thread km
Hi all, How do I log exceptions to a file from view functions at runtime ? I am using nginx (0.8.54) + uwsgi (0.9.6.7) + django(1.2.4) setup with python 2.7 the uwsgi doesnt seem to log any errors from the django views even when I use --logto option for uwsgi pls let me know thanks, KM -- You