Re: cannot login to admin site using admin credentials

2011-02-07 Thread xpanta
I have tried this already. I still can't login. :-( On 7 Φεβ, 15:48, Chris Lawlor wrote: > Try running 'python manage.py createsuperuser' on your production > server to create a new superuser account. You should have full > privileges to log in to the admin and make changes using this account.

Slow performance with Django when connected to Oracle

2011-02-07 Thread dw314159
Django gurus: Hello, I am experiencing very slow performance with Django when connected to an Oracle database. The exact same Django application runs far faster with PostgreSQL and SQLite, with the same source data loaded into each database. Looking at the information embedded in “connection.queri

Re: manytomany help

2011-02-07 Thread ivan sugiarto
You must delete those tables and run sync db again.. On 8 Feb 2011 11:32, "Bobby Roberts" wrote: I've got two models: class a (models.Model): id = models.AutoField (primary_key=True) name = models.CharField (max_length=50, blank=False, db_index=True) class aAdmin(admin.ModelAdmin)

manytomany help

2011-02-07 Thread Bobby Roberts
I've got two models: class a (models.Model): id = models.AutoField (primary_key=True) name = models.CharField (max_length=50, blank=False, db_index=True) class aAdmin(admin.ModelAdmin): list_display = ('name',) search_fields = ['name'] admin.site.register(a,aAdmin)

Re: cleaned_data not behaving how I expect it to. (newbie confusion)

2011-02-07 Thread Ben Dembroski
My apologies to the list. I just noticed the commas at the end of the lines in the views.py file. Once I got rid of those, all was much better. On Feb 7, 11:33 pm, Ben Dembroski wrote: > Hi all. > > Another silly question.  I'm hoping someone here can explain something > about the way form va

Re: Questions about documentation management

2011-02-07 Thread Russell Keith-Magee
On Tue, Feb 8, 2011 at 5:50 AM, Aryeh Leib Taurog wrote: > On Feb 7, 10:29 pm, anastasia wrote: > > Disclaimer: I'm not really responsible for django documentation, but > have poked at it a bit, and am somewhat familiar with the platforms. For the record, I *am* responsible for Django's document

cleaned_data not behaving how I expect it to. (newbie confusion)

2011-02-07 Thread Ben Dembroski
Hi all. Another silly question. I'm hoping someone here can explain something about the way form validation and processing is working in the following example of User Registration: >From forms.py class RegistrationForm(forms.Form): username = forms.CharField(label=u'Username', max_length=30

Simple chat function

2011-02-07 Thread Ethan Yandow
Does anyone know of a way of creating a simple chat client using Django and Openfire between different Openfire users? Anything would be great :) thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to djang

Re: read-only Form.as_* views

2011-02-07 Thread Ian Stokes-Rees
On 2/7/11 5:29 PM, Ian Stokes-Rees wrote: > This sounds good. Form Preview could be useful, but right now I just > want to be able to use Generic Views (DetailView.as_view()) to render > the default context object using "as_table()", but I'm failing to do that. > > {{ object.as_table }} returns

Re: read-only Form.as_* views

2011-02-07 Thread Ian Stokes-Rees
This sounds good. Form Preview could be useful, but right now I just want to be able to use Generic Views (DetailView.as_view()) to render the default context object using "as_table()", but I'm failing to do that. {{ object.as_table }} returns nothing, whereas, {{ object.name }} etc. works jus

Re: incrementing counter of an cached data

2011-02-07 Thread Michel Thadeu Sabchuk
You can hit the counter through ajax and still keep the cache of the entire page. This is useful if you have a cache through nginx + memcached. Regards, On 7 fev, 20:15, "Henrik Genssen" wrote: > are you using middleware or a decorator for caching your view? > if you are using a decorator like @

Testing in a project with multiple databases

2011-02-07 Thread Stathis
Hello everyone, I have set up a project with multiple database connections (default and legacy). I use models for the default database, but the legacy db is not managed by models. I issue raw sql to query the legacy database. Django-nose and south are used. I am facing multiple problems: - When

RE: Re: incrementing counter of an cached data

2011-02-07 Thread Henrik Genssen
are you using middleware or a decorator for caching your view? if you are using a decorator like @cache_page from django.views.decorators.cache you can add simply a second decorator befor the caching one, where you count your hits... if you are using a middleware, you have to write your own cache

Re: incrementing counter of an cached data

2011-02-07 Thread ozgur yilmaz
No suggest? 2011/2/7 ozgur yilmaz > Hi, > > I'm using file caching. But need to increment a field for storing product > hits. Is there an optimal way to do this? > > Thanks, > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Database synchronization with sometimes-connected mobile client

2011-02-07 Thread Eric Chamberlain
We had to work through similar issues with our iPhone and iPad applications. We wanted to decouple the server development from the iOS applications and decided to not try and mirror the device and server database schemas, we pass objects back and forth and let each implementation store the under

Re: Questions about documentation management

2011-02-07 Thread Aryeh Leib Taurog
On Feb 7, 10:29 pm, anastasia wrote: Disclaimer: I'm not really responsible for django documentation, but have poked at it a bit, and am somewhat familiar with the platforms. > - What platform does Django use for its documentation? (e.g. a wiki? > DocBook?) Sphinx http://sphinx.pocoo.org/ Base

Re: Sorting list view on based on field from joined table

2011-02-07 Thread Aryeh Leib Taurog
On Feb 7, 10:50 pm, SimpleDimple wrote: > I am new to django and building a school system but am experience > developer otherwise having firm grip over rails, php, .net and java. > > I can see the list and do sorting & search but only based on the > fields which are in the same table... what if I

Re: Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Shawn Milochik
Perhaps some deeper background will help: http://docs.djangoproject.com/en/1.2/ref/contrib/contenttypes/ Shawn -- 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 f

Re: read-only Form.as_* views

2011-02-07 Thread Aryeh Leib Taurog
On Feb 7, 10:57 pm, Ian Stokes-Rees wrote: > I love the fact that I can quickly and easily get a "view" of my objects in > Django, but is there any current way to get "read-only" views of objects > where fields are not editable?  I want to be able to display the "forms" > once they are completed b

Re: Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Ian Stokes-Rees
On 2/7/11 3:50 PM, Shawn Milochik wrote: > Because when the model isn't abstract, the fields > in the base model aren't created for the subclass -- the subclass has > a foreign key to an instance of the base model. > That last bit should explain why you need to have the base app in > installed ap

incrementing counter of an cached data

2011-02-07 Thread ozgur yilmaz
Hi, I'm using file caching. But need to increment a field for storing product hits. Is there an optimal way to do this? Thanks, -- 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.

Re: Setting session variable at the time of login

2011-02-07 Thread Shawn Milochik
1. You'll have to create your own login view. You can look at Django's view and just copy it. You can use the built-in authentication and template and everything, plus whatever else you want to do. 2. Here's how you do that: http://docs.djangoproject.com/en/1.2/topics/auth/#storing-additional-info

Re: default header template file

2011-02-07 Thread Shawn Milochik
This will help you a lot: https://github.com/robhudson/django-debug-toolbar It shows you the templates being used and a bunch of other stuff. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us

Re: Filtering List based on a custom dropdown

2011-02-07 Thread SimpleDimple
I can live w/o AJAX for now to keep it simple. What I am not clear is on how to do the postback from javascript ? I mean on what URL and pass on which variables ? and thru GET or POST or shall i do form.submit() ?? On Feb 8, 1:45 am, Joel Goldstick wrote: > On Mon, Feb 7, 2011 at 3:38 PM, Sim

read-only Form.as_* views

2011-02-07 Thread Ian Stokes-Rees
I love the fact that I can quickly and easily get a "view" of my objects in Django, but is there any current way to get "read-only" views of objects where fields are not editable? I want to be able to display the "forms" once they are completed but with the fields displayed just as table entrie

default header template file

2011-02-07 Thread SimpleDimple
I am new to django and building a school system but am experience developer otherwise having firm grip over rails, php, .net and java. When I login, I can see the username of user logged-in in the header... I want to add more info from sessions there, so I am wondering which template file is it fo

Re: Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Shawn Milochik
On Mon, Feb 7, 2011 at 3:43 PM, Ian Stokes-Rees wrote: > On 2/7/11 3:38 PM, Shawn Milochik wrote: >> Is your base model abstract? If it is not, then the ORM will want to >> create it in the database. > > No, it isn't abstract.  It has a particular content model and methods > associated with it.  W

Sorting list view on based on field from joined table

2011-02-07 Thread SimpleDimple
I am new to django and building a school system but am experience developer otherwise having firm grip over rails, php, .net and java. I can see the list and do sorting & search but only based on the fields which are in the same table... what if I want to sort on or search on field which is in ano

Re: Filtering List based on a custom dropdown

2011-02-07 Thread Joel Goldstick
On Mon, Feb 7, 2011 at 3:38 PM, SimpleDimple wrote: > I am new to django and building a school system but am experience > developer otherwise having firm grip over rails, php, .net and java. > > I have student table and in list I can see list of all students/ > records in student table(pasted

Re: Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Ian Stokes-Rees
On 2/7/11 3:38 PM, Shawn Milochik wrote: > Is your base model abstract? If it is not, then the ORM will want to > create it in the database. No, it isn't abstract. It has a particular content model and methods associated with it. When you say the ORM will "want" to create it in the DB, do you me

Setting session variable at the time of login

2011-02-07 Thread SimpleDimple
I am new to django and building a school system but am experience developer otherwise having firm grip over rails, php, .net and java. 1) I am using django admin, I want to set a variable at the time of user login... the user login is coming from django code so I have no idea how to capture "after

Filtering List based on a custom dropdown

2011-02-07 Thread SimpleDimple
I am new to django and building a school system but am experience developer otherwise having firm grip over rails, php, .net and java. I have student table and in list I can see list of all students/ records in student table(pasted below is my code) what I want here is a custom dropdown listi

Questions about documentation management

2011-02-07 Thread anastasia
Hello, My name is Anastasia Cheetham. I'm a developer with and the documentation lead for the Fluid Project (http://fluidproject.org). We're beginning the process of restructuring and redesigning the documentation for our Infusion framework. Part of that process will include migrating to a new pla

Re: Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Shawn Milochik
Is your base model abstract? If it is not, then the ORM will want to create it in the database. Shawn -- 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 g

Getting value from session in ModelForm

2011-02-07 Thread SimpleDimple
I am new to Django and building a school system but am an experienced developer otherwise having firm grip over rails, .net, php & java. I have the following class where on teacher add/edit form, I am trying to filter values in class drop down based on school. The value of school_id is saved in s

Including apps for inherited models in INSTALLED_APPS

2011-02-07 Thread Ian Stokes-Rees
Does it make sense that inherited models also need their apps included in INSTALLED_APPS? Right now if I have: base/models.py: class MyBaseModel(django.db.models.Model): stuff and then elsewhere: derived/models.py: class MyDerivedModel(base.MyBaseModel): stuff I need to include both "

Re: Is there a way to know which user changed a particular model through the admin site?

2011-02-07 Thread Shawn Milochik
Go to http://docs.djangoproject.com/ and type 'admin user' in the search box. The first result is a FAQ containing this question and answer. -- 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@googl

Re: 'module' object has no attribute 'Form'

2011-02-07 Thread Shawn Milochik
The problem is your "star" import from localflavor, which contains a 'forms' module. Just import what you need from localflavor. Shawn -- 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@googlegrou

Re: Is there any way to get the ip address of the user in the post_save signal?

2011-02-07 Thread Cal Leeming [Simplicity Media Ltd]
Hey, In previous projects, we have addresses this issue by making the HTTP Request object available globally. I have placed the code you need to do this here: http://djangosnippets.org/snippets/2352/ Please note, this method is slightly frowned upon in t

Error when editing Inline OneToOneField

2011-02-07 Thread Pascal Germroth
Hi, using SVN revision 15440 I get some weird behaviour: Part of my model looks like this: - from django.contrib.gis.db import models class Address(models.Model): uuid = UuidField(primary_key=True) readable = models.CharField(max_length=200) geo = models.GeometryField() def sa

'module' object has no attribute 'Form'

2011-02-07 Thread shireknight
I created a form in forms.py with this code: === from django import forms from django.forms import widgets from django.contrib.localflavor.us import * import datetime class InquiryForm(forms.Form): === Exception Value: 'module' object has no attri

Re: problem with date and decimal changes between 1.1.1 and 1.2.4

2011-02-07 Thread Ramiro Morales
On Mon, Feb 7, 2011 at 2:13 PM, Jop wrote: > Hallo, > > I am upgrading a Django project from 1.1.1 to 1.2.4. Unfortunately I'm > running into some trouble concerning date and decimal formatting in > 1.2.4. What I'm looking for is to match the original situation as we > need the dates to be the sam

Re: problem with date and decimal changes between 1.1.1 and 1.2.4

2011-02-07 Thread creecode
Hello Job On Feb 7, 9:13 am, Jop wrote: > I am upgrading a Django project from 1.1.1 to 1.2.4. Unfortunately I'm > running into some trouble concerning date and decimal formatting in > 1.2.4. I don't have an answer but have you looked at the localization file for nl to see if something has chan

problem with date and decimal changes between 1.1.1 and 1.2.4

2011-02-07 Thread Jop
Hallo, I am upgrading a Django project from 1.1.1 to 1.2.4. Unfortunately I'm running into some trouble concerning date and decimal formatting in 1.2.4. What I'm looking for is to match the original situation as we need the dates to be the same for xml feeds etc and the point for javascript. I kno

Django URL Detail

2011-02-07 Thread Amit
Hello, In my Django application (basically handover to me), I am hitting the Web-Server with some http request which bring me data. I would come to know about the complete URL; http://domain_name/address In order to get problem thoroughly one should visit: http://stackoverflow.com/que

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

2011-02-07 Thread Nate Reed
Bill, thanks for your reply. I considered rendering the form manually, and that would be a fine solution. I ended up creating a custom widget (MultiValueTextWidget) that joins the input values. I don't know if this is the best solution, but it solves the problem of rendering the values as a sing

Re: Is there any way to get the ip address of the user in the post_save signal?

2011-02-07 Thread creecode
On Feb 7, 6:38 am, Joel Goldstick wrote: > can you use the http request object: > > http://docs.djangoproject.com/en/dev/ref/request-response/#quick-over... I think the problem there is that the HttpRequest object isn't available by default to the post_save signal. Some of the ways you might

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

2011-02-07 Thread Bill Freeman
On Sun, Feb 6, 2011 at 4:25 PM, Nate Reed wrote: > 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 va

Re: Amazing work

2011-02-07 Thread Jon J
Cal, You are so right. I've always taken it as a rule of thumb that the bigger a corporation is, the bigger and bloated their software is. It's gotten to the point where I won't touch jobs with a ten foot pole whose companies are built upon Microsoft products. On Sun, Feb 6, 2011 at 1:54 PM, Cal

Re: Is there any way to get the ip address of the user in the post_save signal?

2011-02-07 Thread Joel Goldstick
On Mon, Feb 7, 2011 at 8:43 AM, Stodge wrote: > Is there any way to get the ip address of the user in the post_save signal? > Thanks > > -- > 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@googl

Re: cannot login to admin site using admin credentials

2011-02-07 Thread Chris Lawlor
Try running 'python manage.py createsuperuser' on your production server to create a new superuser account. You should have full privileges to log in to the admin and make changes using this account. On Feb 7, 8:15 am, xpanta wrote: > Hi, > > it seems that my problem is a bit complicated. I have

Is there any way to get the ip address of the user in the post_save signal?

2011-02-07 Thread Stodge
Is there any way to get the ip address of the user in the post_save signal? Thanks -- 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

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

2011-02-07 Thread andmart
Marc, I found a reference in docs. http://docs.djangoproject.com/en/1.2/ref/contrib/admin/#modeladmin-methods On Feb 6, 2:00 pm, Marc Aymerich wrote: > 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. > > > T

Is there a way to know which user changed a particular model through the admin site?

2011-02-07 Thread Stodge
I need to know who changed a particular model through the admin site so I can create a log entry. The post_save signal has no knowledge of the user that changed the model and overriding the model's save method won't tell me the user either. Is there a way to know which user changed a particular

Re: How to define each model in its own file

2011-02-07 Thread Alendit
Hi, as far as i know you also have to define the app_label as Meta parameter like this class Meta: app_label = "your_app_name" Regards, Alendit. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-

cannot login to admin site using admin credentials

2011-02-07 Thread xpanta
Hi, it seems that my problem is a bit complicated. I have tried much but to no avail. So, please help me! Some time ago I migrated to postgresql from mysql. I don't know if I did something wrong. Anyway, my webapp works "almost" flawlessly. Since then I never needed to login using admin rights (

BDD test scenario localisation

2011-02-07 Thread Sultan Imanhodjaev
Hello, I was wondering if there any way to localise BDD test according to project requirement is there any issue? Sultan -- 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

Re: How to define each model in its own file

2011-02-07 Thread Sultan Imanhodjaev
It is also possible to import you models from *models/** from within * models.py* file. On Sun, Feb 6, 2011 at 8:02 PM, Mark (Nosrednakram) wrote: > 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__.

Re: population of *.html fields from Django

2011-02-07 Thread Sam Lai
On 7 February 2011 03:34, gintare wrote: > 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: > > >   textarea> >   >   > > #in views.py > item = request.POST.get('cbnWw','')