Query executed two times in database (django 1.4, oracle 11g)

2013-09-05 Thread bikeridercz
Dear colleagues, I'm facing a problem probably related to caching infrastructure in DJango. Documentation says that data are fetched from DB once a then readed from cache. However, my results are different. Query is executed two times. On my opinion the first fetch should be enough. Here is a

Re: Problem with translations

2013-09-05 Thread Doug
Follow-up: just for good measure could you tell me what you have in your settings for `LANGUAGE_CODE` and what languages you are trying to support? If by some small chance you are trying to support a language not apart of this set ,

Re: What is the best way to have multiple admin users with there own models?

2013-09-05 Thread Robert Steckroth
Ok, never mind. I copied the entire admin dir to the app directory and it is working fairly well here. So naa.. On Thu, Sep 5, 2013 at 11:15 PM, Robert Steckroth wrote: > The application being created requires client to have an admin interface > specific to external > application/use. In other

What is the best way to have multiple admin users with there own models?

2013-09-05 Thread Robert Steckroth
The application being created requires client to have an admin interface specific to external application/use. In other words, I would like to provide unique Admin model control for a tentative user base. Any thoughts on how one might go about this? Thanks -- Systems/Software Engineer -- You r

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
my models.py : def get_upload_file_name(instance, filename): return "uploaded_files/%s_%s" %(str(time()).replace('.','_'), filename) class Status(models.Model): status = models.TextField() image = models.ImageField(upload_to=get_upload_file_name, blank=True) pub_date = models.DateTimeField(defaul

Re: Problem with translations

2013-09-05 Thread Doug
I've found some other people with the same issue. Looking at the source, the issue is directly related to IOError, so your assumption sounds correct, django

Customize error messages for django-registration

2013-09-05 Thread Tony Lâmpada
Hi, I have a question about django-registration ( https://bitbucket.org/ubernostrum/django-registration), but I can't find their issue tracker or a mailing list for it, so I'll try mu luck here. My application enables login via OpenID and login/password. Some users "forget their password" on FS

Error: unsupported locale setting. how to solve this ?

2013-09-05 Thread Baranidharan Ragupathy
File "C:\PYTHON25\lib\locale.py", line 478, in setlocale return _setlocale(category, locale) Error: unsupported locale setting. Im using Windows7. how to solve this ? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
I did as you told, but I can only see it, when I reload the page served by the django's inbuilt server. Kindly check this - https://mail.google.com/mail/u/0/#sent/140ee7fdc09d4f22 On Thu, Sep 5, 2013 at 2:29 AM, Kelvin Wong wrote: > The MEDIA_ROOT is the local system location where the FileFiel

Re: Self-Referential System or Tree?

2013-09-05 Thread Javier Guerra Giraldez
On Thu, Sep 5, 2013 at 10:50 AM, James wrote: > Do I do so in the template, or in the defining view? for anything more complex than a loop or a check, do it in the view. -- Javier -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscri

Re: Does easy thumbnails for django work for apache server?

2013-09-05 Thread Robin Lery
And also in the uploaded directory it was creating an extra image for the same image. On Thu, Sep 5, 2013 at 11:42 PM, Robin Lery wrote: > I have a page, which is served by apache. When I upload images by the > django's server (on localhost:8000) page, it does show me the uploaded > image prope

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
The problem was the easy-thumbnails tag! After I removed it, I was good to go. Thanks though! On Thu, Sep 5, 2013 at 10:41 PM, Robin Lery wrote: > my models.py : > > def get_upload_file_name(instance, filename): > return "uploaded_files/%s_%s" %(str(time()).replace('.','_'), filename) > > class

Does easy thumbnails for django work for apache server?

2013-09-05 Thread Robin Lery
I have a page, which is served by apache. When I upload images by the django's server (on localhost:8000) page, it does show me the uploaded image properly. However when I upload images by the apache server (on localhost) page, it does not show the uploaded image. Only when I reload the page on the

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Robin Lery
This is my template. Can you please check where I am wrong... Thank you though! {% block content %} {% for Status in status %} {{ Status.creator.get_full_name }} {% if Status.image

Re: Self-Referential System or Tree?

2013-09-05 Thread Javier Guerra Giraldez
On Thu, Sep 5, 2013 at 10:22 AM, James wrote: > I started writing a new model for a client's website. The easiest analogy I > can make is something like a menu, so I wrote just that (start simple, then > add the hard stuff). the main aspect to choose between "just a parent link" (Adjacency List)

Query using object instance gives TypeError

2013-09-05 Thread Cagil Ulusahin
Hello, According to the documentation: -https://docs.djangoproject.com/en/dev/topics/db/queries/#queries-over-related-objects one can query using object instance or instance id: Entry.objects.filter(blog=b) # Query using object instanceEntry.objects.filter(blog=b.id) # Query using id from instan

Re: Self-Referential System or Tree?

2013-09-05 Thread James
That's the main thing about this structure. It is unlikely to change very often, but I don't want it set in stone because there's always a chance it will change. And it will display on most, if not all, pages in this project. But all that caching, etc., is stuff I can deal with later. Because i

Re: Do I always have to run collectstatic to serve uploaded images by apache?

2013-09-05 Thread Kelvin Wong
Check your templates. I bet your tag there is giving the wrong root relative path to the user uploads. https://docs.djangoproject.com/en/dev/ref/templates/builtins/#get-media-prefix If Apache is giving you problems, what does it say in your Apache logs? Try debugging this like you would an Apac

How to pass additional information about fields into template?

2013-09-05 Thread DJ-Tom
Hi, Based on http://jacobian.org/writing/dynamic-form-generation I have now managed to create a data driven form (hooray :-) Basically I'm reading field names from a database and append to a ModelForm in its __init__ method: View: equipments = equipment.objects.filter(category__in=reques

Self-Referential System or Tree?

2013-09-05 Thread James
I started writing a new model for a client's website. The easiest analogy I can make is something like a menu, so I wrote just that (start simple, then add the hard stuff). from django.db import models class Menu(models.Model): parent=models.ForeignKey(Menu) text=models.CharField(max_l

Re: Remove validation on a field if its empty

2013-09-05 Thread Domagoj Kovač
Thanks man! I did not see your post in time so i did this in clean method. This is a bit of a hack, your way is much cleaner. Thanks one more time! def clean(self): super(UserForm, self).clean() if self.instance.pk: password = self.cleaned_data.get("password")

Re: djangoadmin: Multiple record created upon mulitple clicks on "Save" button

2013-09-05 Thread Tom Lockhart
On 2013-09-05, at 5:14 AM, Vincent Tou Liu wrote: > Dear all, > > I am a newbie to djaogo and just started with the django doc 2 days ago. I > have a problem with creating record in django admin page. When I create new > poll record and click on "Save" button 3 times before the page reload

Re: Remove validation on a field if its empty

2013-09-05 Thread Simon Charette
Set `required=False`on your `password` field`. If you want to make sure it's only non-mandatory when the user exists override your `UserForm.__init__` this way: class UserForm(forms.ModelForm): password =

Help with templates

2013-09-05 Thread Daniel Roseman
You should not do this from the standard Python shell, but via the preconfigured Django one which is started with `manage.py shell`. Also, DON'T SHOUT. -- DR. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and

Remove validation on a field if its empty

2013-09-05 Thread Domagoj Kovač
Hi guys, i am working on user CRUD. I am using one form for user creation and update. When user is initially created it is ok to perform password validation - users must have password, but in my edit form i want to have a logic like: when nothing is entered don't do anything, when user enters

djangoadmin: Multiple record created upon mulitple clicks on "Save" button

2013-09-05 Thread Vincent Tou Liu
Dear all, I am a newbie to djaogo and just started with the django doc 2 days ago. I have a problem with creating record in django admin page. When I create new poll record and click on "Save" button 3 times before the page reload, it will create 3 records in the database. How can I limit i

Help with templates

2013-09-05 Thread itsme . vikasmishra
THIS IS THE ERROR I ENCOUNTER WHEN I IMPORT DJANGO IN MY SHELL AND TRY TO USE TEMPLATES THERE from django import template >>> t=template.Template('My name is {{ name }}.') Traceback (most recent call last): File "", line 1, in File "django/template/base.py", line 123, in __init__ if set