Re: dull look after install on ubuntu

2011-08-10 Thread Gelonida N
On 08/10/2011 04:53 AM, Peter Kovgan wrote:
> Thank you guys.
> 
> I use development server of django(manage.py runserver).
> 
> I created an app. from the official site of the django, this one of the
> first tutorial.
> 
> I did it on windows installation.
> 
> Then I came home, installed the same app on ubuntu.
> 
> Now my conf is:
>> django 1.3
>> on python 2.7.1
>> ubuntu 11.04
>> looking through firefox 4
> 
> and it stopped show "stattic content"
> 
> HERE IS COLLECTSTATIC::
> 
> . . . 
> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/management/commands/collectstatic.py",
> line 41, in __init__
> self.storage = get_storage_class(settings.STATICFILES_STORAGE)()
>   File
> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py",
> line 23, in __init__
> raise ImproperlyConfigured("You're using the staticfiles app "
> django.core.exceptions.ImproperlyConfigured: You're using the
> staticfiles app without having set the STATIC_ROOT setting.
> 
> I tried to resolve it myself, but nothing has worked.
> 
> I used answers to another threads, but probably my installation is
> somehow different.
> 
> What exactly I specify in MEDIA_ROOT = ''" ?
> 


Very probably an error in settings.py

STATIC_ROOT has to be an absolut path name using '/' and not '\'
characters pointing to a directory, that is empty (collectstatic will
store files there)


STATICFILES_DIRS should point to the directory, where you put your
static files.

As Praveen pointed out.: A dump of settings.py might help



-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Peter Kovgan
my settings.py


# Django settings for mysite project.

DEBUG = False
TEMPLATE_DEBUG = DEBUG

ADMINS = (
# ('Your Name', 'your_em...@example.com'),
)

MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mysite',  # Or path to database file if
using sqlite3.
'USER': 'root',  # Not used with sqlite3.
'PASSWORD': 'java100',  # Not used with sqlite3.
'HOST': '127.0.0.1',  # Set to empty string for
localhost. Not used with sqlite3.
'PORT': '3306',  # Set to empty string for
default. Not used with sqlite3.
}
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute filesystem path to the directory that will hold user-uploaded
files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = ''

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/";, "http://example.com/media/";
MEDIA_URL = ''

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = ''

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/";
STATIC_URL = '/static/'

# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/";, "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = 't4++q(htx^awwb*$h-0qdm5wd!$+kc6ohv_p48j3b2*&cm!tm*'

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'mysite.urls'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"/home/peter/django-projects/templates", #Something like this...

)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'polls',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
}
   

making history

2011-08-10 Thread Mike Dewhirst

I want to update a history record whenever a particular record changes.

Is it reasonable to call a method from within the save method of a model 
to go off and do the work?


def updatehistory(recordx):
""" if HistoryX doesn't exist, insert it so the RecordX
author can add commentary. Also, add to the story with
changed values from recordx every time RecordX.save() """
pass

class RecordX(models.Model):
... various fields including 'ancestor' ...
def save(self, **kwargs):
super(RecordX, self).save(**kwargs)
updatehistory(self)

class HistoryX(models.Model):
relation = models.OneToOneField(RecordX, to_field='ancestor')
story = models.TextField()


Is there a better way?

Thanks

Mike

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Set order from admin

2011-08-10 Thread Isaac

Hi folks,

I've having trouble to find a clear solution to my problem. All I want 
is to set a relation between 2 classes, and set filter order from admin 
to the rest of queries.


pseudocode:

Class A
has_many B
Class B
foreign_key A

And then, I want to retrieve B objects from a given A instance in the 
same order as introduced (or changed) in admin.


Any clue about some clear mode to implement it in django?

Thanks in advance

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to order "links" in the Admin?

2011-08-10 Thread Andre Lopes
Hi,

Thanks for the reply.

I use the field "website_position" to control the position of the url,
this is an Integer field.

The model I use is this:

from django.db import models
import datetime

class Directory(models.Model):
  website_name = models.CharField(max_length=200)
  website_url = models.CharField(max_length=200)
  website_position = models.IntegerField()
  pub_date = models.DateTimeField('date published')


Now I will populate the database with data:


website_name | website_url| website_position | pub_date
Google   | http://www.google.com| 1  |
10-08-2011
Yahoo| http://www.yahoo.com | 2  |
10-08-2011
Altavista | http://www.altavista.com  | 3
| 10-08-2011


The output of this will be: Google, Yahoo, Altavista

Another example: (Here I will reorder the links positions)


website_name | website_url| website_position | pub_date
Google   | http://www.google.com| 3  |
10-08-2011
Yahoo| http://www.yahoo.com | 2  |
10-08-2011
Altavista | http://www.altavista.com  | 1
| 10-08-2011


Ant the output will be: Altavista, Yahoo, Google

The thing here is that I control the positions of the links in Django
Admin with integers in the field "website_position". I'd like to know
if Django Admin have a better way to deal with this. There is possible
to control this with arrows to change the position of links, I click
in the up arrow and the link go up... I click in a down arrow and the
link goes down... This is possible in the Django Admin?


Best Regards,



On Tue, Aug 9, 2011 at 6:43 PM, Jian Chang  wrote:
> you should figure out what it is based on to order these urls.
>
> i use time stamp to order them.
>
>
> 2011/8/10 Andre Lopes 
>>
>> Hi,
>>
>> I'm testing Django for my first project using it.
>>
>> I have a model like this:
>> 
>> from django.db import models
>> import datetime
>>
>> class Directory(models.Model):
>>   website_name = models.CharField(max_length=200)
>>   website_url = models.CharField(max_length=200)
>>   website_position = models.IntegerField()
>>   pub_date = models.DateTimeField('date published')
>> 
>>
>> Basicaly this model is for storing URL's, but I need to order them,
>> and for that I use "website_position" to control if the link will be
>> at the top or at the end or in the middles...
>>
>> My question is, there is a better way to control the positions of the
>> links? Django Admin have any feature that could help to deal with this
>> specific case?
>>
>> Please let me know.
>>
>> Best Regards,
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



MySQLdb module not found even though it's installed.

2011-08-10 Thread babak
Hi I've installed MySQLdb om my mac and can import it:

Python 2.6.7 (r267:88850, Jul 20 2011, 12:30:08)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb

But when I try to create database I get the following error

$./manage.py syncdb

Traceback (most recent call last):
  File "./manage.py", line 14, in 
execute_manager(settings)
  File "/Users/project/django/core/management/__init__.py", line 438,
in execute_manager
utility.execute()
  File "/Users/project/django/core/management/__init__.py", line 379,
in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/Users/project/django/core/management/__init__.py", line 261,
in fetch_command
klass = load_command_class(app_name, subcommand)
  File "/Users/project/django/core/management/__init__.py", line 67,
in load_command_class
module = import_module('%s.management.commands.%s' % (app_name,
name))
  File "/Users/project/django/utils/importlib.py", line 35, in
import_module
__import__(name)
  File "/Users/project/django/core/management/commands/syncdb.py",
line 7, in 
from django.core.management.sql import custom_sql_for_model,
emit_post_sync_signal
  File "/Users/project/django/core/management/sql.py", line 5, in

from django.contrib.contenttypes import generic
  File "/Users/project/django/contrib/contenttypes/generic.py", line
6, in 
from django.db import connection
  File "/Users/project/django/db/__init__.py", line 77, in 
connection = connections[DEFAULT_DB_ALIAS]
  File "/Users/project/django/db/utils.py", line 91, in __getitem__
backend = load_backend(db['ENGINE'])
  File "/Users/project/django/db/utils.py", line 32, in load_backend
return import_module('.base', backend_name)
  File "/Users/project/django/utils/importlib.py", line 35, in
import_module
__import__(name)
  File "/Users/project/django/db/backends/mysql/base.py", line 14, in

raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
module: No module named MySQLdb


Any idea? could it have something to do with that I also have python
2.5 installed on my computer?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: [Commercial] Freelance developer looking for long-term/contract based work

2011-08-10 Thread Subhranath Chunder
Now I'm available for immediate start of work.

Looking for long-term work only, on hourly basis. I can put in as many as
monthly 100 hours if required.
Please let me know if anyone is interested to hire me, asap.

On Fri, Aug 5, 2011 at 8:58 PM, Subhranath Chunder wrote:

> Have updated my Linkedin profile with project details.
>  On Jul 29, 2011 7:41 PM, "Subhranath Chunder" 
> wrote:
> > Hi,
> >
> > I'm an experienced Django developer, with good experience in web
> application
> > development using Django as the underlying backbone. Have done numerous
> > projects in this, and my entire work experience is also build around it.
> >
> > Summary: I love to work on challenging Django/Python projects, which
> > involves working and experimenting with new and interesting ideas and
> > technologies.
> > Fancy my chances to work on performance enhancements and optimizations of
> > web applications, along with architectural designs of web products.
> >
> > Skillset: Web application development, Django/Python, GAE, jQuery,
> Facebook
> > Application Development
> >
> > Links to some publicly available code snippets of mine:
> > http://scratch-blog.appspot.com
> > https://github.com/subhranath
> >
> > LinkedIn profile (Needs to update the projects section soon):
> > http://in.linkedin.com/pub/subhranath-chunder/24/50/a01
> >
> > Currently, I'm switching work from a full-time employee to a full-time
> > freelancer.
> > Thus, I'm looking for some nice and interesting long-term or contractual
> > opportunity for work engagement.
> >
> > I could surely use some help to get some project, to get me started on my
> > freelancer career.
> > Please let me know if anyone is interested, or need any more details.
> >
> > Thanks,
> > Subhranath Chunder.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQLdb module not found even though it's installed.

2011-08-10 Thread Subhranath Chunder
You can check with the following:

python manage.py shell

then do the,
import MySQLdb

If this fails then you are probably running on different python
environments.


On Wed, Aug 10, 2011 at 2:02 PM, babak  wrote:

> Hi I've installed MySQLdb om my mac and can import it:
>
> Python 2.6.7 (r267:88850, Jul 20 2011, 12:30:08)
> [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import MySQLdb
>
> But when I try to create database I get the following error
>
> $./manage.py syncdb
>
> Traceback (most recent call last):
>  File "./manage.py", line 14, in 
>execute_manager(settings)
>  File "/Users/project/django/core/management/__init__.py", line 438,
> in execute_manager
>utility.execute()
>  File "/Users/project/django/core/management/__init__.py", line 379,
> in execute
>self.fetch_command(subcommand).run_from_argv(self.argv)
>  File "/Users/project/django/core/management/__init__.py", line 261,
> in fetch_command
>klass = load_command_class(app_name, subcommand)
>  File "/Users/project/django/core/management/__init__.py", line 67,
> in load_command_class
>module = import_module('%s.management.commands.%s' % (app_name,
> name))
>  File "/Users/project/django/utils/importlib.py", line 35, in
> import_module
>__import__(name)
>  File "/Users/project/django/core/management/commands/syncdb.py",
> line 7, in 
>from django.core.management.sql import custom_sql_for_model,
> emit_post_sync_signal
>  File "/Users/project/django/core/management/sql.py", line 5, in
> 
>from django.contrib.contenttypes import generic
>  File "/Users/project/django/contrib/contenttypes/generic.py", line
> 6, in 
>from django.db import connection
>  File "/Users/project/django/db/__init__.py", line 77, in 
>connection = connections[DEFAULT_DB_ALIAS]
>  File "/Users/project/django/db/utils.py", line 91, in __getitem__
>backend = load_backend(db['ENGINE'])
>  File "/Users/project/django/db/utils.py", line 32, in load_backend
>return import_module('.base', backend_name)
>  File "/Users/project/django/utils/importlib.py", line 35, in
> import_module
>__import__(name)
>  File "/Users/project/django/db/backends/mysql/base.py", line 14, in
> 
>raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> module: No module named MySQLdb
>
>
> Any idea? could it have something to do with that I also have python
> 2.5 installed on my computer?
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Set order from admin

2011-08-10 Thread Thomas Orozco
You can use a single foreign key and store last changed in your B model.

You can then use object_a.b_set.order_by('myTimeStamp')
Le 10 août 2011 10:23, "Isaac"  a écrit :

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Keep filtering from change_list in admin in custom page?

2011-08-10 Thread Thomas Weholt
Is it possible to keep the filtering done in an admin change_list in a
custom page? For instance, I got a app showing photos where you can
filter on camera, width, height, exif-date, iso speed, exposure etc
and the admin makes filtering my data very easy using a custom
AdminModel. My filter shows up on the right side of the page. But I
want to have a custom page for displaying the actual photos using the
same filter set in the change_list page. Is this possible?

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Keep filtering from change_list in admin in custom page?

2011-08-10 Thread Subhranath Chunder
Yes, you can do that. You would have to override the default
change_view_template. And if required, then probably the changelist_view()
too.

On Wed, Aug 10, 2011 at 2:28 PM, Thomas Weholt wrote:

> Is it possible to keep the filtering done in an admin change_list in a
> custom page? For instance, I got a app showing photos where you can
> filter on camera, width, height, exif-date, iso speed, exposure etc
> and the admin makes filtering my data very easy using a custom
> AdminModel. My filter shows up on the right side of the page. But I
> want to have a custom page for displaying the actual photos using the
> same filter set in the change_list page. Is this possible?
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making history

2011-08-10 Thread Subhranath Chunder
You could probably consider using post_save signals and make things a bit
little more generic.


On Wed, Aug 10, 2011 at 1:38 PM, Mike Dewhirst wrote:

> I want to update a history record whenever a particular record changes.
>
> Is it reasonable to call a method from within the save method of a model to
> go off and do the work?
>
> def updatehistory(recordx):
>""" if HistoryX doesn't exist, insert it so the RecordX
>author can add commentary. Also, add to the story with
>changed values from recordx every time RecordX.save() """
>pass
>
> class RecordX(models.Model):
>... various fields including 'ancestor' ...
>def save(self, **kwargs):
>super(RecordX, self).save(**kwargs)
>updatehistory(self)
>
> class HistoryX(models.Model):
>relation = models.OneToOneField(RecordX, to_field='ancestor')
>story = models.TextField()
>
>
> Is there a better way?
>
> Thanks
>
> Mike
>
> --
> 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+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Keep filtering from change_list in admin in custom page?

2011-08-10 Thread Thomas Weholt
Hmmm ... Not sure how to do that. You could say I want an alternative
change_list page, but not by overriding or extending the existing
default one.

Do you know of any example or documentation on how to achive this?

Anyway, thanks for your input :-)

Regards,
Thomas

On Wed, Aug 10, 2011 at 11:07 AM, Subhranath Chunder
 wrote:
> Yes, you can do that. You would have to override the default
> change_view_template. And if required, then probably the changelist_view()
> too.
>
> On Wed, Aug 10, 2011 at 2:28 PM, Thomas Weholt 
> wrote:
>>
>> Is it possible to keep the filtering done in an admin change_list in a
>> custom page? For instance, I got a app showing photos where you can
>> filter on camera, width, height, exif-date, iso speed, exposure etc
>> and the admin makes filtering my data very easy using a custom
>> AdminModel. My filter shows up on the right side of the page. But I
>> want to have a custom page for displaying the actual photos using the
>> same filter set in the change_list page. Is this possible?
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.org
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making history

2011-08-10 Thread Mike Dewhirst

On 10/08/2011 7:08pm, Subhranath Chunder wrote:
You could probably consider using post_save signals and make things a 
bit little more generic.


Thanks - I'll read up on that ...

Cheers

Mike




On Wed, Aug 10, 2011 at 1:38 PM, Mike Dewhirst > wrote:


I want to update a history record whenever a particular record
changes.

Is it reasonable to call a method from within the save method of a
model to go off and do the work?

def updatehistory(recordx):
   """ if HistoryX doesn't exist, insert it so the RecordX
   author can add commentary. Also, add to the story with
   changed values from recordx every time RecordX.save() """
   pass

class RecordX(models.Model):
   ... various fields including 'ancestor' ...
   def save(self, **kwargs):
   super(RecordX, self).save(**kwargs)
   updatehistory(self)

class HistoryX(models.Model):
   relation = models.OneToOneField(RecordX, to_field='ancestor')
   story = models.TextField()


Is there a better way?

Thanks

Mike

-- 
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+unsubscribe@ googlegroups.com
.
For more options, visit this group at http://groups.google.com/
group/django-users?hl=en
.


--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Generating urls for a search-engine-like application

2011-08-10 Thread samuele.mattiuzzo
Hi all, i'm developing a search-engine-like application using django
1.3 and apache-solr as "database"

I'm now stuck with urls handling. Basically, i need to compose urls
with the parameters used to query solr. Fair enough, but i faced a
problem.

Basically, you can filter your results by choosing a country, a city,
or both (example)

My urls may look like this

url(//, search_view),
url(//, search_view),
url(///, search_view)

as you can see, case 1 and case 2 are a trouble: country and city are
both strings, how's the url supposed to know if a link pointed to one
url or another? Should i use named views in templating? What's the
best way i can use them in my case?

my boss told me to use get requests instead of post, so i could
explicit the parameters, but SEO experts said "NO WAY!". i don't like
get method either, but the reason is different :P
i cannot use get_absolute_url from an object because i have no model
objects (because, since now, there were no need... just an user object
used to store some infos, nothing else)

Any hint on how i can do this? Thanks all in advance!

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



[Sharing] django-custom-auths

2011-08-10 Thread Subhranath Chunder
I was working on these django applications which simplifies the use of
third-party logins for a django project without breaking any existing code.

My concerns were:
- No existing code breakage.
- Easy integration with django's own authenication system API.

This is a work in progress with perhaps no documentation as of now. So, I've
included an entire django project itself for now, to check on it's working.
Currently, the Facebook authentication system is fully functional (using the
current OAuth2 based Graph API implementation).

If anyone is interested to try it out, you can check
https://github.com/subhranath/django-custom-auths

Any suggestions for improvements are very welcome.

Thanks,
Subhranath Chunder.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread Subhranath Chunder
If you are planning for reverse URL in your templates, then named URL
pattern is the thing for you.
https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-patterns

Else to simply, you might also consider changing the url patterns to
something like:
/country//
/city//
If you have the opportunity to do so.



On Wed, Aug 10, 2011 at 2:50 PM, samuele.mattiuzzo wrote:

> Hi all, i'm developing a search-engine-like application using django
> 1.3 and apache-solr as "database"
>
> I'm now stuck with urls handling. Basically, i need to compose urls
> with the parameters used to query solr. Fair enough, but i faced a
> problem.
>
> Basically, you can filter your results by choosing a country, a city,
> or both (example)
>
> My urls may look like this
>
> url(//, search_view),
> url(//, search_view),
> url(///, search_view)
>
> as you can see, case 1 and case 2 are a trouble: country and city are
> both strings, how's the url supposed to know if a link pointed to one
> url or another? Should i use named views in templating? What's the
> best way i can use them in my case?
>
> my boss told me to use get requests instead of post, so i could
> explicit the parameters, but SEO experts said "NO WAY!". i don't like
> get method either, but the reason is different :P
> i cannot use get_absolute_url from an object because i have no model
> objects (because, since now, there were no need... just an user object
> used to store some infos, nothing else)
>
> Any hint on how i can do this? Thanks all in advance!
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread samuele.mattiuzzo
i wanted to keep urls as clean as possible, but i was studying
something like mysite.com/country.italy/city.milan/job.king/

i do not like it so much, but it's the cleanest thing i can think
of...

On Aug 10, 11:47 am, Subhranath Chunder  wrote:
> If you are planning for reverse URL in your templates, then named URL
> pattern is the thing for 
> you.https://docs.djangoproject.com/en/dev/topics/http/urls/#naming-url-pa...
>
> Else to simply, you might also consider changing the url patterns to
> something like:
> /country//
> /city//
> If you have the opportunity to do so.
>
> On Wed, Aug 10, 2011 at 2:50 PM, samuele.mattiuzzo wrote:
>
>
>
>
>
>
>
> > Hi all, i'm developing a search-engine-like application using django
> > 1.3 and apache-solr as "database"
>
> > I'm now stuck with urls handling. Basically, i need to compose urls
> > with the parameters used to query solr. Fair enough, but i faced a
> > problem.
>
> > Basically, you can filter your results by choosing a country, a city,
> > or both (example)
>
> > My urls may look like this
>
> > url(//, search_view),
> > url(//, search_view),
> > url(///, search_view)
>
> > as you can see, case 1 and case 2 are a trouble: country and city are
> > both strings, how's the url supposed to know if a link pointed to one
> > url or another? Should i use named views in templating? What's the
> > best way i can use them in my case?
>
> > my boss told me to use get requests instead of post, so i could
> > explicit the parameters, but SEO experts said "NO WAY!". i don't like
> > get method either, but the reason is different :P
> > i cannot use get_absolute_url from an object because i have no model
> > objects (because, since now, there were no need... just an user object
> > used to store some infos, nothing else)
>
> > Any hint on how i can do this? Thanks all in advance!
>
> > --
> > 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+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Keep filtering from change_list in admin in custom page?

2011-08-10 Thread Subhranath Chunder
You can either override a particular, or give a completely alternative
change_list page.

For your case, overriding seems to be a better option to me
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates

If you are going for new change_list template
https://docs.djangoproject.com/en/dev/ref/contrib/admin/#custom-template-options


On Wed, Aug 10, 2011 at 2:49 PM, Thomas Weholt wrote:

> Hmmm ... Not sure how to do that. You could say I want an alternative
> change_list page, but not by overriding or extending the existing
> default one.
>
> Do you know of any example or documentation on how to achive this?
>
> Anyway, thanks for your input :-)
>
> Regards,
> Thomas
>
> On Wed, Aug 10, 2011 at 11:07 AM, Subhranath Chunder
>  wrote:
> > Yes, you can do that. You would have to override the default
> > change_view_template. And if required, then probably the
> changelist_view()
> > too.
> >
> > On Wed, Aug 10, 2011 at 2:28 PM, Thomas Weholt 
> > wrote:
> >>
> >> Is it possible to keep the filtering done in an admin change_list in a
> >> custom page? For instance, I got a app showing photos where you can
> >> filter on camera, width, height, exif-date, iso speed, exposure etc
> >> and the admin makes filtering my data very easy using a custom
> >> AdminModel. My filter shows up on the right side of the page. But I
> >> want to have a custom page for displaying the actual photos using the
> >> same filter set in the change_list page. Is this possible?
> >>
> >> --
> >> Mvh/Best regards,
> >> Thomas Weholt
> >> http://www.weholt.org
> >>
> >> --
> >> 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+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >>
> >
> > --
> > 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+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
>
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: {django-tables} Caught NameError while rendering: global name 'name' is not defined.

2011-08-10 Thread Kayode Odeyemi
Please I'm still stuck on this.

I have posted it to SO at
http://stackoverflow.com/questions/6993387/django-tables-caught-nameerror-while-rendering-global-name-name-is-not-defin.
But it's still not getting resolved.

I'll appreciate some pointers to the root cause of this.

Thanks

On Mon, Aug 8, 2011 at 12:34 PM, Kayode Odeyemi  wrote:

> Hello,
>
> Please why am I get the following error:
>
> Caught NameError while rendering: global name 'name' is not defined.
>
> Initially I did not receive this sort of error, it just surfaced all
> off a sudden. I restored my app to the state where everything worked
> and I'm still getting the same error.
>
> Full stack trace:
>
> Caught NameError while rendering: global name 'name' is not defined
> Request Method: GET
> Request URL:http://site/reports
> Django Version: 1.3
> Exception Type: TemplateSyntaxError
> Exception Value:
> Caught NameError while rendering: global name 'name' is not defined
> Exception Location: build\bdist.win32\egg\django_tables\models.py in
> _default_render, line 73
> Python Executable:  C:\path\apache\apache2.2.10\bin\httpd.exe
> Python Version: 2.7.1
>
> In my template file:
>
> {% load humanize %}
> {% load tables %}
> {% load pagination_tags %}
> {% autopaginate rows 2 %}
>
>{% for row in table.rows %}
>  
>  {% for value in row %}
>{{ value }}
>  {% endfor %}
>  
>{% endfor %}
>
> When i remove the above code from my template the error goes away but
> table rows are not displayed.
>
> Any suggestions please.
>
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Tutorial: New class based generic views

2011-08-10 Thread Reinout van Rees

On 09-08-11 23:25, Gelonida N wrote:

This is the first part of a series of blog posts I'm writing about
class based generic views:


What I'm wondering about those class based *generic* views is whether 
that name is good:


- Pre-django-1.3 generic views aren't used that much. Most views are 
custom made.


- So class based *generic* views also sound like they're for generic 
views, not for your own custom views.


The djangoproject.com pages about class based views also only talk about 
generic views, even though they're perfectly usable for your own custom 
views.



Am I wrong in thinking that the word "generic" is just bad PR (or 
unclear documentation)?




Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-10 Thread Reinout van Rees

On 09-08-11 17:41, raj wrote:

I keep getting this error:
'str' object has no attribute 'resolve'

 # Uncomment the admin/doc line below and add
'django.contrib.admindocs'

 # to INSTALLED_APPS to enable admin documentation:

  (r'^admin/doc/', include('django.contrib.admindocs.urls')),


Did you add 'django.contrib.admindocs' to your INSTALLED_APPS list? Just 
to make sure.


And if that doesn't fix it, could you post the traceback? It might 
contain hints where it goes wrong.



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread Reinout van Rees

On 10-08-11 11:20, samuele.mattiuzzo wrote:


url(//, search_view),
url(//, search_view),
url(///, search_view)

as you can see, case 1 and case 2 are a trouble: country and city are
both strings, how's the url supposed to know if a link pointed to one
url or another? Should i use named views in templating? What's the
best way i can use them in my case?


You could make it more explicit:

url(/country//, search_view),
url(/city//, search_view),
url(/country///, search_view)

So prefix all country urls with 'country/' and cities likewise.


You could, if you like the "/italy/rome" style of urls more, also make 
an exception just for cities (but *do* place that exception at the top):


url(/city//, search_view),
url(//, search_view),
url(///, search_view)

So only cities are prefixed with "city/" to distinguish them.


And you'd better use named variables, so

/(?P.*)/

instead of

//

(unless you meant that already in your shorthand form, of course).

The view function then can have keyword arguments:

def search_view(request, country=None, city=None)



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: {django-tables} Caught NameError while rendering: global name 'name' is not defined.

2011-08-10 Thread Subhranath Chunder
On Mon, Aug 8, 2011 at 5:04 PM, Kayode Odeyemi  wrote:

> Hello,
>
> Please why am I get the following error:
>
> Caught NameError while rendering: global name 'name' is not defined.
>
> Initially I did not receive this sort of error, it just surfaced all
> off a sudden. I restored my app to the state where everything worked
> and I'm still getting the same error.
>
> Full stack trace:
>
> Caught NameError while rendering: global name 'name' is not defined
> Request Method: GET
> Request URL:http://site/reports
> Django Version: 1.3
> Exception Type: TemplateSyntaxError
> Exception Value:
> Caught NameError while rendering: global name 'name' is not defined
> Exception Location: build\bdist.win32\egg\django_tables\models.py in
> _default_render, line 73
> Python Executable:  C:\path\apache\apache2.2.10\bin\httpd.exe
> Python Version: 2.7.1
>
> In my template file:
>
> {% load humanize %}
> {% load tables %}
> {% load pagination_tags %}
> {% autopaginate rows 2 %}
>
What is data type of this variable named 'rows' in here?


>
>{% for row in table.rows %}
>  
>  {% for value in row %}
>{{ value }}
>  {% endfor %}
>  
>{% endfor %}
>
> When i remove the above code from my template the error goes away but
> table rows are not displayed.
>
> Any suggestions please.
>
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: {django-tables} Caught NameError while rendering: global name 'name' is not defined.

2011-08-10 Thread Kayode Odeyemi
Thanks.

Here's the views.py

class TransactionReport(tables.ModelTable):
identifier = tables.Column(sortable=False, visible=False)
created = tables.Column(sortable=True, visible=True)

@classmethod
def get_reports_paid(self, object, req):
return TransactionReport(object, order_by=req)

class Meta:
model = Transaction


@login_required
def display_reports(request):
logger = logging.getLogger(__name__)
dataqs = Transaction.objects.filter(paid="TRUE")
req = request.GET.get('sort', 'created')
tx = TransactionReport().get_reports_paid(dataqs, req)

return render_to_response('webapp/reports.html', {'table': tx,
'rows' : tx.rows})


rows is of type TransactionReport.


On Wed, Aug 10, 2011 at 11:46 AM, Subhranath Chunder
wrote:

>
>
> On Mon, Aug 8, 2011 at 5:04 PM, Kayode Odeyemi  wrote:
>
>> Hello,
>>
>> Please why am I get the following error:
>>
>> Caught NameError while rendering: global name 'name' is not defined.
>>
>> Initially I did not receive this sort of error, it just surfaced all
>> off a sudden. I restored my app to the state where everything worked
>> and I'm still getting the same error.
>>
>> Full stack trace:
>>
>> Caught NameError while rendering: global name 'name' is not defined
>> Request Method: GET
>> Request URL:http://site/reports
>> Django Version: 1.3
>> Exception Type: TemplateSyntaxError
>> Exception Value:
>> Caught NameError while rendering: global name 'name' is not defined
>> Exception Location: build\bdist.win32\egg\django_tables\models.py in
>> _default_render, line 73
>> Python Executable:  C:\path\apache\apache2.2.10\bin\httpd.exe
>> Python Version: 2.7.1
>>
>> In my template file:
>>
>> {% load humanize %}
>> {% load tables %}
>> {% load pagination_tags %}
>> {% autopaginate rows 2 %}
>>
> What is data type of this variable named 'rows' in here?
>
>
>>
>>{% for row in table.rows %}
>>  
>>  {% for value in row %}
>>{{ value }}
>>  {% endfor %}
>>  
>>{% endfor %}
>>
>> When i remove the above code from my template the error goes away but
>> table rows are not displayed.
>>
>> Any suggestions please.
>>
>> 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
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQLdb module not found even though it's installed.

2011-08-10 Thread babak
Did that and it didn't fail.
But when I run:
python2.6 manage.py syncdb

everything works fine, so problem solved.

On 10 Aug, 10:48, Subhranath Chunder  wrote:
> You can check with the following:
>
> python manage.py shell
>
> then do the,
> import MySQLdb
>
> If this fails then you are probably running on different python
> environments.
>
>
>
> On Wed, Aug 10, 2011 at 2:02 PM, babak  wrote:
> > Hi I've installed MySQLdb om my mac and can import it:
>
> > Python 2.6.7 (r267:88850, Jul 20 2011, 12:30:08)
> > [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> import MySQLdb
>
> > But when I try to create database I get the following error
>
> > $./manage.py syncdb
>
> > Traceback (most recent call last):
> >  File "./manage.py", line 14, in 
> >    execute_manager(settings)
> >  File "/Users/project/django/core/management/__init__.py", line 438,
> > in execute_manager
> >    utility.execute()
> >  File "/Users/project/django/core/management/__init__.py", line 379,
> > in execute
> >    self.fetch_command(subcommand).run_from_argv(self.argv)
> >  File "/Users/project/django/core/management/__init__.py", line 261,
> > in fetch_command
> >    klass = load_command_class(app_name, subcommand)
> >  File "/Users/project/django/core/management/__init__.py", line 67,
> > in load_command_class
> >    module = import_module('%s.management.commands.%s' % (app_name,
> > name))
> >  File "/Users/project/django/utils/importlib.py", line 35, in
> > import_module
> >    __import__(name)
> >  File "/Users/project/django/core/management/commands/syncdb.py",
> > line 7, in 
> >    from django.core.management.sql import custom_sql_for_model,
> > emit_post_sync_signal
> >  File "/Users/project/django/core/management/sql.py", line 5, in
> > 
> >    from django.contrib.contenttypes import generic
> >  File "/Users/project/django/contrib/contenttypes/generic.py", line
> > 6, in 
> >    from django.db import connection
> >  File "/Users/project/django/db/__init__.py", line 77, in 
> >    connection = connections[DEFAULT_DB_ALIAS]
> >  File "/Users/project/django/db/utils.py", line 91, in __getitem__
> >    backend = load_backend(db['ENGINE'])
> >  File "/Users/project/django/db/utils.py", line 32, in load_backend
> >    return import_module('.base', backend_name)
> >  File "/Users/project/django/utils/importlib.py", line 35, in
> > import_module
> >    __import__(name)
> >  File "/Users/project/django/db/backends/mysql/base.py", line 14, in
> > 
> >    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> > module: No module named MySQLdb
>
> > Any idea? could it have something to do with that I also have python
> > 2.5 installed on my computer?
>
> > --
> > 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+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: {django-tables} Caught NameError while rendering: global name 'name' is not defined.

2011-08-10 Thread Subhranath Chunder
You seem to have heavily used external django apps like django-pagination
and django-tables.
I haven't used either of them myself, so it'll be difficult for me to follow
your code like this. Maybe, some else with experience on those might be able
to help you better.

On Wed, Aug 10, 2011 at 4:22 PM, Kayode Odeyemi  wrote:

> Thanks.
>
> Here's the views.py
>
> class TransactionReport(tables.ModelTable):
> identifier = tables.Column(sortable=False, visible=False)
> created = tables.Column(sortable=True, visible=True)
>
> @classmethod
> def get_reports_paid(self, object, req):
> return TransactionReport(object, order_by=req)
>
> class Meta:
> model = Transaction
>
>
> @login_required
> def display_reports(request):
> logger = logging.getLogger(__name__)
> dataqs = Transaction.objects.filter(paid="TRUE")
> req = request.GET.get('sort', 'created')
> tx = TransactionReport().get_reports_paid(dataqs, req)
>
> return render_to_response('webapp/reports.html', {'table': tx,
> 'rows' : tx.rows})
>
>
> rows is of type TransactionReport.
>
>
> On Wed, Aug 10, 2011 at 11:46 AM, Subhranath Chunder  > wrote:
>
>>
>>
>> On Mon, Aug 8, 2011 at 5:04 PM, Kayode Odeyemi  wrote:
>>
>>> Hello,
>>>
>>> Please why am I get the following error:
>>>
>>> Caught NameError while rendering: global name 'name' is not defined.
>>>
>>> Initially I did not receive this sort of error, it just surfaced all
>>> off a sudden. I restored my app to the state where everything worked
>>> and I'm still getting the same error.
>>>
>>> Full stack trace:
>>>
>>> Caught NameError while rendering: global name 'name' is not defined
>>> Request Method: GET
>>> Request URL:http://site/reports
>>> Django Version: 1.3
>>> Exception Type: TemplateSyntaxError
>>> Exception Value:
>>> Caught NameError while rendering: global name 'name' is not defined
>>> Exception Location: build\bdist.win32\egg\django_tables\models.py in
>>> _default_render, line 73
>>> Python Executable:  C:\path\apache\apache2.2.10\bin\httpd.exe
>>> Python Version: 2.7.1
>>>
>>> In my template file:
>>>
>>> {% load humanize %}
>>> {% load tables %}
>>> {% load pagination_tags %}
>>> {% autopaginate rows 2 %}
>>>
>> What is data type of this variable named 'rows' in here?
>>
>>
>>>
>>>{% for row in table.rows %}
>>>  
>>>  {% for value in row %}
>>>{{ value }}
>>>  {% endfor %}
>>>  
>>>{% endfor %}
>>>
>>> When i remove the above code from my template the error goes away but
>>> table rows are not displayed.
>>>
>>> Any suggestions please.
>>>
>>> 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
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>  --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
> Odeyemi 'Kayode O.
> http://www.sinati.com. t: @charyorde
>
>  --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: {django-tables} Caught NameError while rendering: global name 'name' is not defined.

2011-08-10 Thread Tom Evans
On Wed, Aug 10, 2011 at 12:16 PM, Subhranath Chunder
 wrote:
> You seem to have heavily used external django apps like django-pagination
> and django-tables.
> I haven't used either of them myself, so it'll be difficult for me to follow
> your code like this. Maybe, some else with experience on those might be able
> to help you better.

I was about to reply with exactly this - if you are using 3rd party
libraries - firstly, you need to tell people you are using them before
asking for help, and secondly, they often won't play that well with
each other.

In this case, looking at the code for django-pagination (as there
appears to be no documentation), the autopaginate tag is expecting to
be passed a queryset, not whatever a django-tables instance is.

Cheers

Tom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: MySQLdb module not found even though it's installed.

2011-08-10 Thread Subhranath Chunder
On Wed, Aug 10, 2011 at 2:20 PM, babak  wrote:

> Did that and it didn't fail.
> But when I run:
> python2.6 manage.py syncdb
>
> everything works fine, so problem solved.
>
Your python mysql library binder is currently installed with the python2.6
instance only, and not with python2.5

You might consider changing the default python link to the python2.6
instance.


>
> On 10 Aug, 10:48, Subhranath Chunder  wrote:
> > You can check with the following:
> >
> > python manage.py shell
> >
> > then do the,
> > import MySQLdb
> >
> > If this fails then you are probably running on different python
> > environments.
> >
> >
> >
> > On Wed, Aug 10, 2011 at 2:02 PM, babak  wrote:
> > > Hi I've installed MySQLdb om my mac and can import it:
> >
> > > Python 2.6.7 (r267:88850, Jul 20 2011, 12:30:08)
> > > [GCC 4.2.1 (Apple Inc. build 5664)] on darwin
> > > Type "help", "copyright", "credits" or "license" for more information.
> > > >>> import MySQLdb
> >
> > > But when I try to create database I get the following error
> >
> > > $./manage.py syncdb
> >
> > > Traceback (most recent call last):
> > >  File "./manage.py", line 14, in 
> > >execute_manager(settings)
> > >  File "/Users/project/django/core/management/__init__.py", line 438,
> > > in execute_manager
> > >utility.execute()
> > >  File "/Users/project/django/core/management/__init__.py", line 379,
> > > in execute
> > >self.fetch_command(subcommand).run_from_argv(self.argv)
> > >  File "/Users/project/django/core/management/__init__.py", line 261,
> > > in fetch_command
> > >klass = load_command_class(app_name, subcommand)
> > >  File "/Users/project/django/core/management/__init__.py", line 67,
> > > in load_command_class
> > >module = import_module('%s.management.commands.%s' % (app_name,
> > > name))
> > >  File "/Users/project/django/utils/importlib.py", line 35, in
> > > import_module
> > >__import__(name)
> > >  File "/Users/project/django/core/management/commands/syncdb.py",
> > > line 7, in 
> > >from django.core.management.sql import custom_sql_for_model,
> > > emit_post_sync_signal
> > >  File "/Users/project/django/core/management/sql.py", line 5, in
> > > 
> > >from django.contrib.contenttypes import generic
> > >  File "/Users/project/django/contrib/contenttypes/generic.py", line
> > > 6, in 
> > >from django.db import connection
> > >  File "/Users/project/django/db/__init__.py", line 77, in 
> > >connection = connections[DEFAULT_DB_ALIAS]
> > >  File "/Users/project/django/db/utils.py", line 91, in __getitem__
> > >backend = load_backend(db['ENGINE'])
> > >  File "/Users/project/django/db/utils.py", line 32, in load_backend
> > >return import_module('.base', backend_name)
> > >  File "/Users/project/django/utils/importlib.py", line 35, in
> > > import_module
> > >__import__(name)
> > >  File "/Users/project/django/db/backends/mysql/base.py", line 14, in
> > > 
> > >raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
> > > django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb
> > > module: No module named MySQLdb
> >
> > > Any idea? could it have something to do with that I also have python
> > > 2.5 installed on my computer?
> >
> > > --
> > > 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+unsubscr...@googlegroups.com.
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Peter Kovgan
Gelonida N:

"Very probably an error in settings.py"

ok..

"
STATIC_ROOT has to be an absolut path name using '/' and not '\'
characters pointing to a directory, that is empty (collectstatic will
store files there)
"

ok...


"STATICFILES_DIRS should point to the directory, where you put your
static files."

My static files?

I had no static files.

It's django admin stuff Where they keep their default static files?

What exactly I write here? STATICFILES_DIRS

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



RE: Is there a way to use a tree control in my template

2011-08-10 Thread Hayyan Rafiq


Which form element giveds the tree control ??

> Date: Tue, 9 Aug 2011 22:57:36 -0700
> Subject: Re: Is there a way to use a tree control in my template
> From: francescor...@gmail.com
> To: django-users@googlegroups.com
> 
> What part are you missing? How to write the django template, how to
> access the data or the what is the related HTML?
> 
> On Aug 8, 9:43 pm, Hayyan Rafiq  wrote:
> > Hi i wanted to know is there a way through which i could use a tree control 
> > in my template
> > I wanted to add something like
> >
> >Student
> >   |_Name
> >|_Address
> >|_Contact No
> >
> > I think you guys get the picture...How can i add something like that in my 
> > template...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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 
  

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making history

2011-08-10 Thread Shawn Milochik
I do essentially that, using a post_save signal and dumping the
serialized model instance to MongoDB with datestamp, etc.

The relevant part is this (after importing Django's serializers):

 serialized_object = serializers.serialize(
"json",
sender.objects.filter(pk = instance.pk),
ensure_ascii = False,
)

I store them outside of the primary database because it doesn't makes
sense to store audit history where, if your data is corrupted or
tampered with, you audit data could be also.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Keep filtering from change_list in admin in custom page?

2011-08-10 Thread Thomas Weholt
On Wed, Aug 10, 2011 at 11:56 AM, Subhranath Chunder
 wrote:
> You can either override a particular, or give a completely alternative
> change_list page.
> For your case, overriding seems to be a better option to me
> https://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates

E ... I do not want to override. To be precise I want a
button/link beside the "Add " in the change_list which,
when clicked, opens a new page, extending the base-admin template,
taking the current filters used in the change_list and displays the
same data in a different layout, using a different template. Perhaps
I'm not understanding what you're saying, but I need the standard
change_list as well as the alternative one.

But thanks for your help. I see you're very active on the list today.
Very good :-)

Thomas


> If you are going for new change_list template
> https://docs.djangoproject.com/en/dev/ref/contrib/admin/#custom-template-options
>
> On Wed, Aug 10, 2011 at 2:49 PM, Thomas Weholt 
> wrote:
>>
>> Hmmm ... Not sure how to do that. You could say I want an alternative
>> change_list page, but not by overriding or extending the existing
>> default one.
>>
>> Do you know of any example or documentation on how to achive this?
>>
>> Anyway, thanks for your input :-)
>>
>> Regards,
>> Thomas
>>
>> On Wed, Aug 10, 2011 at 11:07 AM, Subhranath Chunder
>>  wrote:
>> > Yes, you can do that. You would have to override the default
>> > change_view_template. And if required, then probably the
>> > changelist_view()
>> > too.
>> >
>> > On Wed, Aug 10, 2011 at 2:28 PM, Thomas Weholt 
>> > wrote:
>> >>
>> >> Is it possible to keep the filtering done in an admin change_list in a
>> >> custom page? For instance, I got a app showing photos where you can
>> >> filter on camera, width, height, exif-date, iso speed, exposure etc
>> >> and the admin makes filtering my data very easy using a custom
>> >> AdminModel. My filter shows up on the right side of the page. But I
>> >> want to have a custom page for displaying the actual photos using the
>> >> same filter set in the change_list page. Is this possible?
>> >>
>> >> --
>> >> Mvh/Best regards,
>> >> Thomas Weholt
>> >> http://www.weholt.org
>> >>
>> >> --
>> >> 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+unsubscr...@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/django-users?hl=en.
>> >>
>> >
>> > --
>> > 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+unsubscr...@googlegroups.com.
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>> >
>>
>>
>>
>> --
>> Mvh/Best regards,
>> Thomas Weholt
>> http://www.weholt.org
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Newbie: Help with validation

2011-08-10 Thread Shawn Milochik
In [1]: x = '1234'

In [2]: x.isdigit()
Out[2]: True

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: {django-tables} Caught NameError while rendering: global name 'name' is not defined.

2011-08-10 Thread Kayode Odeyemi
Thanks.

I just simply result to core Django to get done what I need.

On Wed, Aug 10, 2011 at 12:22 PM, Tom Evans wrote:

> On Wed, Aug 10, 2011 at 12:16 PM, Subhranath Chunder
>  wrote:
> > You seem to have heavily used external django apps like django-pagination
> > and django-tables.
> > I haven't used either of them myself, so it'll be difficult for me to
> follow
> > your code like this. Maybe, some else with experience on those might be
> able
> > to help you better.
>
> I was about to reply with exactly this - if you are using 3rd party
> libraries - firstly, you need to tell people you are using them before
> asking for help, and secondly, they often won't play that well with
> each other.
>
> In this case, looking at the code for django-pagination (as there
> appears to be no documentation), the autopaginate tag is expecting to
> be passed a queryset, not whatever a django-tables instance is.
>
> Cheers
>
> Tom
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Is there a way to use a tree control in my template

2011-08-10 Thread Tiago Almeida
As far as I know, Django does not ship with that by defaut. Try
searching for an app or a snippet on http://djangosnippets.org
It shouldn't be too hard to do.

Best regards

On Aug 10, 1:31 pm, Hayyan Rafiq  wrote:
> Which form element giveds the tree control ??
>
>
>
>
>
>
>
> > Date: Tue, 9 Aug 2011 22:57:36 -0700
> > Subject: Re: Is there a way to use a tree control in my template
> > From: francescor...@gmail.com
> > To: django-users@googlegroups.com
>
> > What part are you missing? How to write the django template, how to
> > access the data or the what is the related HTML?
>
> > On Aug 8, 9:43 pm, Hayyan Rafiq  wrote:
> > > Hi i wanted to know is there a way through which i could use a tree 
> > > control in my template
> > > I wanted to add something like
>
> > >    Student
> > >       |_Name
> > >            |_Address
> > >            |_Contact No
>
> > > I think you guys get the picture...How can i add something like that in 
> > > my template...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 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Tom Evans
On Wed, Aug 10, 2011 at 3:53 AM, Peter Kovgan  wrote:
> Thank you guys.
>
> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py",
> line 23, in __init__
>     raise ImproperlyConfigured("You're using the staticfiles app "
> django.core.exceptions.ImproperlyConfigured: You're using the staticfiles
> app without having set the STATIC_ROOT setting.
>
> I tried to resolve it myself, but nothing has worked.
>

Seriously? Is there something unclear about the instructions in that
error message?

Did you try setting STATIC_ROOT and reading the fine documentation
about STATIC_ROOT?

Cheers

Tom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread samuele.mattiuzzo
Yeah, it was just a shorthand to let you understand my problem, it
wasn't my actual url definition :)

I was considering the option /country/italy/city/milan/job/engineer/,
it wasn't that bat, but i'm risking very long urls if 4-5 parameters
are set...



On Aug 10, 12:18 pm, Reinout van Rees  wrote:
> On 10-08-11 11:20, samuele.mattiuzzo wrote:
>
>
>
> > url(//, search_view),
> > url(//, search_view),
> > url(///, search_view)
>
> > as you can see, case 1 and case 2 are a trouble: country and city are
> > both strings, how's the url supposed to know if a link pointed to one
> > url or another? Should i use named views in templating? What's the
> > best way i can use them in my case?
>
> You could make it more explicit:
>
> url(/country//, search_view),
> url(/city//, search_view),
> url(/country///, search_view)
>
> So prefix all country urls with 'country/' and cities likewise.
>
> You could, if you like the "/italy/rome" style of urls more, also make
> an exception just for cities (but *do* place that exception at the top):
>
> url(/city//, search_view),
> url(//, search_view),
> url(///, search_view)
>
> So only cities are prefixed with "city/" to distinguish them.
>
> And you'd better use named variables, so
>
> /(?P.*)/
>
> instead of
>
> //
>
> (unless you meant that already in your shorthand form, of course).
>
> The view function then can have keyword arguments:
>
> def search_view(request, country=None, city=None)
>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread Venkatraman S
On Wed, Aug 10, 2011 at 2:50 PM, samuele.mattiuzzo wrote:

> my boss told me to use get requests instead of post, so i could
> explicit the parameters, but SEO experts said "NO WAY!". i don't like
> get method either, but the reason is different :P
>

I dont understand SEO reason, can you explain.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread samuele.mattiuzzo
Well, i don't understand it plenty, since i never spoke with them
directly. Btw, our "seo consultants" said that /london/designer/ is
SEO-OK while ?city=london&job=designer is SEO-BAD. I really don't
think there's much difference between the two, but i cannot discuss
too much with them :)

On Aug 10, 4:09 pm, Venkatraman S  wrote:
> On Wed, Aug 10, 2011 at 2:50 PM, samuele.mattiuzzo wrote:
>
> > my boss told me to use get requests instead of post, so i could
> > explicit the parameters, but SEO experts said "NO WAY!". i don't like
> > get method either, but the reason is different :P
>
> I dont understand SEO reason, can you explain.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



How to pass url parameters to template url tag

2011-08-10 Thread Kayode Odeyemi
Hello friends,

I need some help on how to pass url parameters to template url tag.

Something like this:

my page

page is the url parameter I want to get

Thank you

-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread Reinout van Rees

On 10-08-11 15:50, samuele.mattiuzzo wrote:

I was considering the option/country/italy/city/milan/job/engineer/,
it wasn't that bat, but i'm risking very long urls if 4-5 parameters
are set...


If /italy/milan/barber is the normal url, by all means use that.

The other scenarios can then get a longer url, like

/city/milan

This makes the city-only scenario distinguishable from something that's 
a county+city combination. That way your regular urls stay nice and 
short. Best of both ways?



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to pass url parameters to template url tag

2011-08-10 Thread Tom Evans
On Wed, Aug 10, 2011 at 3:17 PM, Kayode Odeyemi  wrote:
> Hello friends,
> I need some help on how to pass url parameters to template url tag.
> Something like this:
> my page
> page is the url parameter I want to get
> Thank you

You have two options:

you can extract the value in the view, and put it into the context
that is used to render the template.

you can access it using dot notation [1], which is used in templates
(templates are not python, you cannot write python in templates). Eg:
{% url url-name request.GET.page %}

Cheers

Tom

[1] https://docs.djangoproject.com/en/1.3/topics/templates/#variables

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to pass url parameters to template url tag

2011-08-10 Thread Reinout van Rees

On 10-08-11 16:17, Kayode Odeyemi wrote:

I need some help on how to pass url parameters to template url tag.

Something like this:

my page

page is the url parameter I want to get


Best solution: calculate that url in your python view code and just pass 
it along in the context.


The generic rule is that most processing should happen in python code, 
not in your template.




Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Generating urls for a search-engine-like application

2011-08-10 Thread samuele.mattiuzzo
Yeah, i'll be taking the best out of every hint!
The big problem is that the user has a lot of freedom. If he just
wants to search for "barber" he can and urls will be /barber/
/... Every parameter is optional, they're just bound to an
order, if they're all present... So i don't have a "special" case (as
the city-only) i can deal with easily :(

On Aug 10, 4:29 pm, Reinout van Rees  wrote:
> On 10-08-11 15:50, samuele.mattiuzzo wrote:
>
> > I was considering the option/country/italy/city/milan/job/engineer/,
> > it wasn't that bat, but i'm risking very long urls if 4-5 parameters
> > are set...
>
> If /italy/milan/barber is the normal url, by all means use that.
>
> The other scenarios can then get a longer url, like
>
> /city/milan
>
> This makes the city-only scenario distinguishable from something that's
> a county+city combination. That way your regular urls stay nice and
> short. Best of both ways?
>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



GeoDjango and pyspatialite

2011-08-10 Thread Sean
GeoDjango normally looks for libspatialite for Spatialite
functionality.

I want to use, instead, pyspatialite which has the spatialite
functions built into the sqlite3 library.  I changed the reference in
the standard sqlite3 backend base.py to use pyspatialite instead of
pysqlite2/sqlite3.

I tried changing the base.py for the spatialite base.py in contrib.gis
to look for the sqlite3 library but that didn't work. I'm sure it's a
bad idea anyway to have it load the sqlite3 lib again.

Has anyone found a way to get GeoDjango to pyspatialite?

Thanks,

  Sean

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django and extjs: works well together?

2011-08-10 Thread Reinout van Rees

Hi,

Several people in my workplace are looking at extjs now.
http://www.sencha.com/products/extjs/examples/
Basically, a big javascript UI construction kit. To me it feels like a 
desktop app in a browser window.


Question: does anyone have experience (positive or negative) with extjs 
in combination with django? Django can spew out json just fine of 
course, but it'll have to relinquish a lot of control to the browser. 
And it'll be more "spitting out json" than "using templates".



Reinout

--
Reinout van Reeshttp://reinout.vanrees.org/
rein...@vanrees.org http://www.nelen-schuurmans.nl/
"If you're not sure what to do, make something. -- Paul Graham"

--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django and extjs: works well together?

2011-08-10 Thread william ratcliff
We've used it--it's really domain specific, but you can look at
tripleaxis.smallangles.net (please don't crash us :>).   We do the front end
with extjs and the back-end with django.   We have a number of ajax calls
made by extjs and then handled by django.   We're also finishing up a
dataflow project (where we let users create filters through which their data
flows--imagine labview for data...).  That project also involves creating
users, redis, etc. and takes a bit more advantage of django...

One thing to be aware of is that several tutorials on the web for extjs are
a bit dated--the library has been improved to be more modular in version 4,
but as a result, some changes need to be made to existing code--we've also
had a few issues making it play nice with YUI (long story...).

William

On Wed, Aug 10, 2011 at 11:22 AM, Reinout van Rees wrote:

> Hi,
>
> Several people in my workplace are looking at extjs now.
> http://www.sencha.com/**products/extjs/examples/
> Basically, a big javascript UI construction kit. To me it feels like a
> desktop app in a browser window.
>
> Question: does anyone have experience (positive or negative) with extjs in
> combination with django? Django can spew out json just fine of course, but
> it'll have to relinquish a lot of control to the browser. And it'll be more
> "spitting out json" than "using templates".
>
>
> Reinout
>
> --
> Reinout van Reeshttp://reinout.vanrees.org/
> rein...@vanrees.org 
> http://www.nelen-schuurmans.**nl/
> "If you're not sure what to do, make something. -- Paul Graham"
>
> --
> 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+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en
> .
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django and extjs: works well together?

2011-08-10 Thread william ratcliff
Incidentally, the example website was coded by a high school student over
the course of a 6 week summer internship with us (who had to learn
javascript, django, and python during that time), so I think the learning
curve shouldn't be too steep

William

On Wed, Aug 10, 2011 at 11:32 AM, william ratcliff <
william.ratcl...@gmail.com> wrote:

> We've used it--it's really domain specific, but you can look at
> tripleaxis.smallangles.net (please don't crash us :>).   We do the front
> end with extjs and the back-end with django.   We have a number of ajax
> calls made by extjs and then handled by django.   We're also finishing up a
> dataflow project (where we let users create filters through which their data
> flows--imagine labview for data...).  That project also involves creating
> users, redis, etc. and takes a bit more advantage of django...
>
> One thing to be aware of is that several tutorials on the web for extjs are
> a bit dated--the library has been improved to be more modular in version 4,
> but as a result, some changes need to be made to existing code--we've also
> had a few issues making it play nice with YUI (long story...).
>
> William
>
>
> On Wed, Aug 10, 2011 at 11:22 AM, Reinout van Rees wrote:
>
>> Hi,
>>
>> Several people in my workplace are looking at extjs now.
>> http://www.sencha.com/**products/extjs/examples/
>> Basically, a big javascript UI construction kit. To me it feels like a
>> desktop app in a browser window.
>>
>> Question: does anyone have experience (positive or negative) with extjs in
>> combination with django? Django can spew out json just fine of course, but
>> it'll have to relinquish a lot of control to the browser. And it'll be more
>> "spitting out json" than "using templates".
>>
>>
>> Reinout
>>
>> --
>> Reinout van Reeshttp://reinout.vanrees.org/
>> rein...@vanrees.org 
>> http://www.nelen-schuurmans.**nl/
>> "If you're not sure what to do, make something. -- Paul Graham"
>>
>> --
>> 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+unsubscribe@**
>> googlegroups.com .
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to order "links" in the Admin?

2011-08-10 Thread creecode
Hello Andre,

Try a Google search for "django admin drag drop reorder admin".  Several 
results there that might point you in the right direction.

I have used a variation on this Django Snippet < 
http://djangosnippets.org/snippets/1053/ > to do reordering in some of my 
projects.

Toodle-l...
creecode

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/SSBCKCjJ3y8J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django and extjs: works well together?

2011-08-10 Thread Andre Terra
You've now successfully whetted my appetite

http://dev.sencha.com/deploy/ext-4.0.2a/examples/grid/group-summary-grid.html

I'll try to use that some time in the future.


Cheers,
AT

On Wed, Aug 10, 2011 at 12:32 PM, william ratcliff <
william.ratcl...@gmail.com> wrote:

> We've used it--it's really domain specific, but you can look at
> tripleaxis.smallangles.net (please don't crash us :>).   We do the front
> end with extjs and the back-end with django.   We have a number of ajax
> calls made by extjs and then handled by django.   We're also finishing up a
> dataflow project (where we let users create filters through which their data
> flows--imagine labview for data...).  That project also involves creating
> users, redis, etc. and takes a bit more advantage of django...
>
> One thing to be aware of is that several tutorials on the web for extjs are
> a bit dated--the library has been improved to be more modular in version 4,
> but as a result, some changes need to be made to existing code--we've also
> had a few issues making it play nice with YUI (long story...).
>
> William
>
>
> On Wed, Aug 10, 2011 at 11:22 AM, Reinout van Rees wrote:
>
>> Hi,
>>
>> Several people in my workplace are looking at extjs now.
>> http://www.sencha.com/**products/extjs/examples/
>> Basically, a big javascript UI construction kit. To me it feels like a
>> desktop app in a browser window.
>>
>> Question: does anyone have experience (positive or negative) with extjs in
>> combination with django? Django can spew out json just fine of course, but
>> it'll have to relinquish a lot of control to the browser. And it'll be more
>> "spitting out json" than "using templates".
>>
>>
>> Reinout
>>
>> --
>> Reinout van Reeshttp://reinout.vanrees.org/
>> rein...@vanrees.org 
>> http://www.nelen-schuurmans.**nl/
>> "If you're not sure what to do, make something. -- Paul Graham"
>>
>> --
>> 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+unsubscribe@**
>> googlegroups.com .
>> For more options, visit this group at http://groups.google.com/**
>> group/django-users?hl=en
>> .
>>
>>
>  --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to order "links" in the Admin?

2011-08-10 Thread Eric Hutchinson
This is a meta option.


from django.db import models
import datetime
class Directory(models.Model):
  website_name = models.CharField(max_length=200)
  website_url = models.CharField(max_length=200)
  website_position = models.IntegerField()
  pub_date = models.DateTimeField('date published')

class Meta:
ordering=['website_position']


see: https://docs.djangoproject.com/en/1.3/ref/models/options/#ordering

On Aug 10, 4:25 am, Andre Lopes  wrote:
> Hi,
>
> Thanks for the reply.
>
> I use the field "website_position" to control the position of the url,
> this is an Integer field.
>
> The model I use is this:
> 
> from django.db import models
> import datetime
>
> class Directory(models.Model):
>   website_name = models.CharField(max_length=200)
>   website_url = models.CharField(max_length=200)
>   website_position = models.IntegerField()
>   pub_date = models.DateTimeField('date published')
> 
>
> Now I will populate the database with data:
>
> 
> website_name | website_url                    | website_position | pub_date
> Google           |http://www.google.com   | 1                      |
> 10-08-2011
> Yahoo            |http://www.yahoo.com    | 2                      |
> 10-08-2011
> Altavista         |http://www.altavista.com | 3
> | 10-08-2011
> 
>
> The output of this will be: Google, Yahoo, Altavista
>
> Another example: (Here I will reorder the links positions)
>
> 
> website_name | website_url                    | website_position | pub_date
> Google           |http://www.google.com   | 3                      |
> 10-08-2011
> Yahoo            |http://www.yahoo.com    | 2                      |
> 10-08-2011
> Altavista         |http://www.altavista.com | 1
> | 10-08-2011
> 
>
> Ant the output will be: Altavista, Yahoo, Google
>
> The thing here is that I control the positions of the links in Django
> Admin with integers in the field "website_position". I'd like to know
> if Django Admin have a better way to deal with this. There is possible
> to control this with arrows to change the position of links, I click
> in the up arrow and the link go up... I click in a down arrow and the
> link goes down... This is possible in the Django Admin?
>
> Best Regards,
>
>
>
>
>
>
>
> On Tue, Aug 9, 2011 at 6:43 PM, Jian Chang  wrote:
> > you should figure out what it is based on to order these urls.
>
> > i use time stamp to order them.
>
> > 2011/8/10 Andre Lopes 
>
> >> Hi,
>
> >> I'm testing Django for my first project using it.
>
> >> I have a model like this:
> >> 
> >> from django.db import models
> >> import datetime
>
> >> class Directory(models.Model):
> >>   website_name = models.CharField(max_length=200)
> >>   website_url = models.CharField(max_length=200)
> >>   website_position = models.IntegerField()
> >>   pub_date = models.DateTimeField('date published')
> >> 
>
> >> Basicaly this model is for storing URL's, but I need to order them,
> >> and for that I use "website_position" to control if the link will be
> >> at the top or at the end or in the middles...
>
> >> My question is, there is a better way to control the positions of the
> >> links? Django Admin have any feature that could help to deal with this
> >> specific case?
>
> >> Please let me know.
>
> >> Best Regards,
>
> >> --
> >> 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+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >>http://groups.google.com/group/django-users?hl=en.
>
> > --
> > 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+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



spam in response to posting to this list

2011-08-10 Thread Eric Hutchinson
I responded to the thread about ordering tables, and got this as a
response

(warning, raw source)


Delivered-To: eric.hutchin...@burgopakusa.com
Received: by 10.220.167.200 with SMTP id r8cs290642vcy;
Wed, 10 Aug 2011 09:02:33 -0700 (PDT)
Received: from mr.google.com ([10.91.50.12])
by 10.91.50.12 with SMTP id c12mr10651761agk.124.1312992153699
(num_hops = 1);
Wed, 10 Aug 2011 09:02:33 -0700 (PDT)
Received: by 10.91.50.12 with SMTP id c12mr7477236agk.
124.1312992153404;
Wed, 10 Aug 2011 09:02:33 -0700 (PDT)
Return-Path: 
Received: from www27.interneet.com ([64.124.221.249])
by mx.google.com with ESMTP id f6si1287554anf.
4.2011.08.10.09.02.33;
Wed, 10 Aug 2011 09:02:33 -0700 (PDT)
Received-SPF: neutral (google.com: 64.124.221.249 is neither permitted
nor denied by domain of django-users@googlegroups.com) client-
ip=64.124.221.249;
Authentication-Results: mx.google.com; spf=neutral (google.com:
64.124.221.249 is neither permitted nor denied by domain of django-
us...@googlegroups.com) smtp.mail=django-users@googlegroups.com
Date: Wed, 10 Aug 2011 09:02:33 -0700 (PDT)
Message-Id: <4e42ab99.0620640a.
3fb4.cc5fsmtpin_ad...@mx.google.com>
Received: from localhost (dev.mapocity.com [192.168.30.184])
by www27.interneet.com (Postfix) with ESMTP id D23E7A40031
for ; Wed, 10 Aug 2011 09:02:32
-0700 (PDT)
From: django-users@googlegroups.com
To: Eric Hutchinson 
Subject: Re: Re: How to order "links" in the Admin?
MIME-Version: 1.0
Content-Type: text/html; charset=UTF-8

I am out of office right now and will get back to you when
I return. If you don't hear from me, my assistant should contact you
shortly. In the meantime, you should take a look at this product I
have been using..Click
HereEnable images or click
hereLet me know what you think after you have a
chance to review.Cheers!If
 you no longer wish to receive emails, please unsubscribe866-288-18805150 yarmouth
ave, Encino, CA 91316On Wed, 10 Aug 2011 09:01:51 -0700 (PDT),
Eric Hutchinson  wrote:

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: spam in response to posting to this list

2011-08-10 Thread Tom Evans
On Wed, Aug 10, 2011 at 5:06 PM, Eric Hutchinson
 wrote:
> I responded to the thread about ordering tables, and got this as a
> response
>

I reported the same thing a couple of days ago. Russell Keith-Magee is
aware of the issue (he gets them too), but it seems almost impossible
to track down a specific subscriber from the info in that email.

Cheers

Tom

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: spam in response to posting to this list

2011-08-10 Thread Kayode Odeyemi
I have been getting this too.

On Wed, Aug 10, 2011 at 5:15 PM, Tom Evans  wrote:

> On Wed, Aug 10, 2011 at 5:06 PM, Eric Hutchinson
>  wrote:
> > I responded to the thread about ordering tables, and got this as a
> > response
> >
>
> I reported the same thing a couple of days ago. Russell Keith-Magee is
> aware of the issue (he gets them too), but it seems almost impossible
> to track down a specific subscriber from the info in that email.
>
> Cheers
>
> Tom
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Worshkop

2011-08-10 Thread pankaj sharma
hello friends there is a workshop to be conducted in india (kolkata)
by ednect services, it will also include information about django
if we want that everybody use django so everybody will try to conduct
same kind of workshop in their cities.
and also like this link

   http://www.facebook.com/pages/Ednect-Services/252079971482683

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Installation Problem cant extract tar.gz file

2011-08-10 Thread danielvanvane
Hello,

 I want to start with Django, but i got serval problem during the
installation:
First I installed Python 2.7 and MySQL
then i downloaded django1.3 (and django 1.25)
Now i clicked on the django1.3 .tar.gz and i got this problem(also on
other versions):

Archivmanager says:
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Exiting with failure status due to previous errors


so I cant install it otherwise extract


I use Ubuntu 11.4 on a virtual machine under windows7 via virtual box
"oracle VM"
Note: I'am a truely win7 user, but i need to learn django on ubuntu (:

I hope that u can help me

-sorry for bad english (:

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Missing POST request with WSGI

2011-08-10 Thread RoyWilliams
My problem is that POST data is not being copied into the request
object that my Django code is getting, but the problem only happens
with WSGI.

When I fill in the web form with a browser, the POST data comes
through correctly: request.method is POST and the QueryDict has my
parameters. But when I use code (python urllib) to POST the data, it
does not come through: request.method is set to GET and there are no
parameters (QueryDict). I have checked that this client is really
sending a POST request.

I have done this with CSRF switched on and off, and it makes no
difference.

I have found this to be a WSGI problem, because there is another
installation of the same application that uses mod_python, and that
works perfectly.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installation Problem cant extract tar.gz file

2011-08-10 Thread Andre Terra
Possible solutions:


1) Try downloading the file again
2) Checkout from the svn repository.
3) Use a different archive manager.


I'd go with options #2, personally.

Cheers,
AT

On Wed, Aug 10, 2011 at 1:08 PM, danielvanvane  wrote:

> Hello,
>
>  I want to start with Django, but i got serval problem during the
> installation:
> First I installed Python 2.7 and MySQL
> then i downloaded django1.3 (and django 1.25)
> Now i clicked on the django1.3 .tar.gz and i got this problem(also on
> other versions):
>
> Archivmanager says:
> tar: This does not look like a tar archive
> tar: Skipping to next header
> tar: Exiting with failure status due to previous errors
>
>
> so I cant install it otherwise extract
>
>
> I use Ubuntu 11.4 on a virtual machine under windows7 via virtual box
> "oracle VM"
> Note: I'am a truely win7 user, but i need to learn django on ubuntu (:
>
> I hope that u can help me
>
> -sorry for bad english (:
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to pass url parameters to template url tag

2011-08-10 Thread bruno desthuilliers
On 10 août, 16:30, Tom Evans  wrote:
>
> You have two options:

Actually, three.

> you can extract the value in the view, and put it into the context
> that is used to render the template.

Simple but totally unpractical for most projects, as it requires
making ALL views duplicating this behavior.

> you can access it using dot notation [1], which is used in templates
> (templates are not python, you cannot write python in templates). Eg:
> {% url url-name request.GET.page %}

Probably the most cost-effective solution - until you have to parse
all your templates when there's any change. As a side note:
1/ you can use the "default" template filter to handle the case when
there's no 'page' key in request.GET
2/ you can use request.REQUEST if you want to work as well with GET
and POST.


Now for the third solution: write your own template tag. Not
necessarily required, but that's often the best solution wrt/
decoupling / flexibility / maintainability / reusability.



> Cheers
>
> Tom
>
> [1]https://docs.djangoproject.com/en/1.3/topics/templates/#variables

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: same form model with separate admins and data

2011-08-10 Thread brian
Hi Michal,

Can you provide details about the QuerySets part?  I'm new to Django.

One of the ideas I had was using inheritance.  For example:
---
myBaseModel(models.Model)
   …

class form1( myBaseModel ):
pass
---

The problem I'm seeing is that when I use form1 the data gets put in
form1 and myBaseModel.

Thank you for your help

Brian

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to pass url parameters to template url tag

2011-08-10 Thread bruno desthuilliers
On 10 août, 16:35, Reinout van Rees  wrote:
>
> Best solution: calculate that url in your python view code and just pass
> it along in the context.

Definitly not the best solution if this has to work for more than
exactly ONE view.

> The generic rule is that most processing should happen in python code,
> not in your template.

Indeed. But in Django, Python code is not restricted to views, and
another generic rule is that a view should NOT have to deal with
orthogonal concerns - IOW, it should do the very minimal possible
thing and nothing else.  Template code is where the integration
between different (preferably well decoupled) apps happens - it's
really the "glue" layer of your project - so whatever is part of your
project but none of the concern of a specific view should happen. NB :
when I say "template code", this includes template tags and filters,
context processors and eventually middlewares...

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: same form model with separate admins and data

2011-08-10 Thread bruno desthuilliers
On 10 août, 19:57, brian  wrote:
> Hi Michal,
>
> Can you provide details about the QuerySets part?  I'm new to Django.
>
> One of the ideas I had was using inheritance.  For example:
> ---
> myBaseModel(models.Model)
>    …
>
> class form1( myBaseModel ):
>     pass

Sorry but your question is not quite clear to me. What do you call a
"form" exactly here ??? A Form subclass or a Model subclass ?

(as a side not: the convention in Python is to use StudlyCaps for
class names, and conventions are a *very* important part of Python).

> The problem I'm seeing is that when I use form1 the data gets put in
> form1 and myBaseModel.

If what you want is to have two or more models inheriting from a same
base model BUT each with a distinct table, you have to make the base
model abstract (cf the model doc).

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Installation Problem cant extract tar.gz file

2011-08-10 Thread Shawn Milochik
What's the output when you try this at the command line?

tar -xzf django1.3.tar.gz

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Peter Kovgan
I seriously tried.
you did not get, that I do not see statics of the ADMIN directory,
not of my own creations.
EVEN ADMIN does not work.
So basically, python does not see admin's preinstalled static files.
To be sure: I'm a beginner, I go through my first tutorial.

I ran the same application on windows installation and it worked.
Now on linux it refuses to work.
crossplatform is not a hot django goal, as far as I see.
I edited path to templates - that was all difference that I've done after I
moved to linux.

I'm thinking, that may be my django installation went wrong...
Now I'm going to reinstall everything from scratch.
Thank you for help.




On 10 August 2011 16:24, Tom Evans  wrote:

> On Wed, Aug 10, 2011 at 3:53 AM, Peter Kovgan 
> wrote:
> > Thank you guys.
> >
> >
> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py",
> > line 23, in __init__
> > raise ImproperlyConfigured("You're using the staticfiles app "
> > django.core.exceptions.ImproperlyConfigured: You're using the staticfiles
> > app without having set the STATIC_ROOT setting.
> >
> > I tried to resolve it myself, but nothing has worked.
> >
>
> Seriously? Is there something unclear about the instructions in that
> error message?
>
> Did you try setting STATIC_ROOT and reading the fine documentation
> about STATIC_ROOT?
>
> Cheers
>
> Tom
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Peter Kovgan
I resolved it, setting DEBUG = True, it was False for some reason, and it
worked so on windows.

I have some doubts, that static files should become unavailable when you set
debug=false.

What do you think?


On 10 August 2011 21:46, Peter Kovgan  wrote:

> I seriously tried.
> you did not get, that I do not see statics of the ADMIN directory,
> not of my own creations.
> EVEN ADMIN does not work.
> So basically, python does not see admin's preinstalled static files.
> To be sure: I'm a beginner, I go through my first tutorial.
>
> I ran the same application on windows installation and it worked.
> Now on linux it refuses to work.
> crossplatform is not a hot django goal, as far as I see.
> I edited path to templates - that was all difference that I've done after I
> moved to linux.
>
> I'm thinking, that may be my django installation went wrong...
> Now I'm going to reinstall everything from scratch.
> Thank you for help.
>
>
>
>
> On 10 August 2011 16:24, Tom Evans  wrote:
>
>> On Wed, Aug 10, 2011 at 3:53 AM, Peter Kovgan 
>> wrote:
>> > Thank you guys.
>> >
>> >
>> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py",
>> > line 23, in __init__
>> > raise ImproperlyConfigured("You're using the staticfiles app "
>> > django.core.exceptions.ImproperlyConfigured: You're using the
>> staticfiles
>> > app without having set the STATIC_ROOT setting.
>> >
>> > I tried to resolve it myself, but nothing has worked.
>> >
>>
>> Seriously? Is there something unclear about the instructions in that
>> error message?
>>
>> Did you try setting STATIC_ROOT and reading the fine documentation
>> about STATIC_ROOT?
>>
>> Cheers
>>
>> Tom
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Peter Kovgan
Ok, Ok, I've got it, read docs.

"
The static files tools are mostly designed to help with getting static files
successfully deployed into production. This usually means a separate,
dedicated static file server, which is a lot of overhead to mess with when
developing locally. Thus, the staticfiles app ships with a *quick and dirty
helper view* that you can use to serve files locally in development.

"

But why It must be so complex?
Why default admin statics become unavailable, if you use another server and
not that of development: "runner"?

Should it mean, that I must find elsewhere my admin statics, copy-paste them
to some place and poin to this place from settings.py?

OK
I do not like this burden.






On 10 August 2011 21:52, Peter Kovgan  wrote:

> I resolved it, setting DEBUG = True, it was False for some reason, and it
> worked so on windows.
>
> I have some doubts, that static files should become unavailable when you
> set debug=false.
>
> What do you think?
>
>
>
> On 10 August 2011 21:46, Peter Kovgan  wrote:
>
>> I seriously tried.
>> you did not get, that I do not see statics of the ADMIN directory,
>> not of my own creations.
>> EVEN ADMIN does not work.
>> So basically, python does not see admin's preinstalled static files.
>> To be sure: I'm a beginner, I go through my first tutorial.
>>
>> I ran the same application on windows installation and it worked.
>> Now on linux it refuses to work.
>> crossplatform is not a hot django goal, as far as I see.
>> I edited path to templates - that was all difference that I've done after
>> I moved to linux.
>>
>> I'm thinking, that may be my django installation went wrong...
>> Now I'm going to reinstall everything from scratch.
>> Thank you for help.
>>
>>
>>
>>
>> On 10 August 2011 16:24, Tom Evans  wrote:
>>
>>> On Wed, Aug 10, 2011 at 3:53 AM, Peter Kovgan 
>>> wrote:
>>> > Thank you guys.
>>> >
>>> >
>>> "/usr/local/lib/python2.7/dist-packages/django/contrib/staticfiles/storage.py",
>>> > line 23, in __init__
>>> > raise ImproperlyConfigured("You're using the staticfiles app "
>>> > django.core.exceptions.ImproperlyConfigured: You're using the
>>> staticfiles
>>> > app without having set the STATIC_ROOT setting.
>>> >
>>> > I tried to resolve it myself, but nothing has worked.
>>> >
>>>
>>> Seriously? Is there something unclear about the instructions in that
>>> error message?
>>>
>>> Did you try setting STATIC_ROOT and reading the fine documentation
>>> about STATIC_ROOT?
>>>
>>> Cheers
>>>
>>> Tom
>>>
>>> --
>>> 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+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: 'str' object has no attribute 'resolve' when access admin site

2011-08-10 Thread raj
And yea, admin docs is in my installed list. Much appreciated.
Still can't get it to work.
This was my traceback:
'str' object has no attribute 'resolve'

Request Method: GET
Django Version: 1.3
Exception Type: AttributeError
Exception Value:

'str' object has no attribute 'resolve'

Exception Location: /home/dockedin/webapps/peebletalk/lib/python2.7/
django/core/urlresolvers.py in resolve, line 252
Python Executable:  /usr/local/bin/python
Python Version: 2.7.1
Python Path:

['/home/dockedin/webapps/peebletalk',
 '/home/dockedin/webapps/peebletalk/lib/python2.7',
 '/home/dockedin/lib/python2.7',
 '/usr/local/lib/python27.zip',
 '/usr/local/lib/python2.7',
 '/usr/local/lib/python2.7/plat-linux2',
 '/usr/local/lib/python2.7/lib-tk',
 '/usr/local/lib/python2.7/lib-old',
 '/usr/local/lib/python2.7/lib-dynload',
 '/usr/local/lib/python2.7/site-packages',
 '/usr/local/lib/python2.7/site-packages/PIL']

Server time:Wed, 10 Aug 2011 15:24:55 -0400
Traceback Switch to copy-and-paste view

/home/dockedin/webapps/peebletalk/lib/python2.7/django/core/
handlers/base.py in get_response

response = middleware_method(request)

...
▶ Local vars
/home/dockedin/webapps/peebletalk/lib/python2.7/django/middleware/
common.py in process_request

if (not _is_valid_path(request.path_info, urlconf)
and

...
▶ Local vars
/home/dockedin/webapps/peebletalk/lib/python2.7/django/middleware/
common.py in _is_valid_path

urlresolvers.resolve(path, urlconf)

...
▶ Local vars
/home/dockedin/webapps/peebletalk/lib/python2.7/django/core/
urlresolvers.py in resolve

return get_resolver(urlconf).resolve(path)

...
▶ Local vars
/home/dockedin/webapps/peebletalk/lib/python2.7/django/core/
urlresolvers.py in resolve

def resolve(self, path):

tried = []

match = self.regex.search(path)

if match:

new_path = path[match.end():]

for pattern in self.url_patterns:

try:

sub_match = pattern.resolve(new_path)

...
except Resolver404, e:
sub_tried = e.args[0].get('tried')
if sub_tried is not None:
tried.extend([[pattern] + t for t in
sub_tried])
else:
tried.append([pattern])

▶ Local vars

On Aug 10, 6:09 am, Reinout van Rees  wrote:
> On 09-08-11 17:41, raj wrote:
>
> > I keep getting this error:
> > 'str' object has no attribute 'resolve'
>
> >      # Uncomment the admin/doc line below and add
> > 'django.contrib.admindocs'
>
> >      # to INSTALLED_APPS to enable admin documentation:
>
> >       (r'^admin/doc/', include('django.contrib.admindocs.urls')),
>
> Did you add 'django.contrib.admindocs' to your INSTALLED_APPS list? Just
> to make sure.
>
> And if that doesn't fix it, could you post the traceback? It might
> contain hints where it goes wrong.
>
> Reinout
>
> --
> Reinout van Rees                    http://reinout.vanrees.org/
> rein...@vanrees.org            http://www.nelen-schuurmans.nl/
> "If you're not sure what to do, make something. -- Paul Graham"

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Gelonida N
On 08/10/2011 09:01 PM, Peter Kovgan wrote:
> Ok, Ok, I've got it, read docs.
> 
> But why It must be so complex?
> Why default admin statics become unavailable, if you use another server
> and not that of development: "runner"?
> 
> Should it mean, that I must find elsewhere my admin statics, copy-paste
> them to some place and poin to this place from settings.py?
> 
> OK
> I do not like this burden.
> 
The burden is not really a big burden.

Set STATIC_ROOT in config.py  to a directory, which is empty and where
you have write permissions to.


run afterwards ./manage.py  collectstatic


This should collect all static files (also the ones from standard django
modules) into the STATIC_ROOT directory.

If your STATIC_ROOT directory does NOT contain the files that aren't
served, then this is strange.



Just one more question:

Did you also use Django 1.3 on your windows host or was it a different
version???



-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to pass url parameters to template url tag

2011-08-10 Thread Kayode Odeyemi
On Wed, Aug 10, 2011 at 6:57 PM, bruno desthuilliers <
bruno.desthuilli...@gmail.com> wrote:

> On 10 août, 16:30, Tom Evans  wrote:
>
>
> Now for the third solution: write your own template tag. Not
> necessarily required, but that's often the best solution wrt/
> decoupling / flexibility / maintainability / reusability.


I've been considering using custom template tag. Yeah, it is standard and
pretty. I guess
this might take me a while to implement.

However, can this concept also be used to pass page objects (e.g model data
passed to a template from a view) from one view to another.

For instance, I have a request model dynamic data saved in a session. I'm
passing this
data to another view and I want it to change based on the value of a url
parameter?




-- 
Odeyemi 'Kayode O.
http://www.sinati.com. t: @charyorde

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: same form model with separate admins and data

2011-08-10 Thread brian
I'm using the Model->ModelForm flow.  I was starting with the model
and working my way up.  Once I get the model I was going to switch to
the form and then the view.

Brian

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread Adam Zedan
Hi i wanted to know what do most people here do when they need to show
results in a template which just needs to be displayed in Table.
For example displaying data from a db etc in a template. I did try an app
called django_tables2 but it just seems really simple with respect to
presentation.
I tried loading the CSS version 'paleblue' of that app but it doesnt work ?
if someone has already tried that please do let me know ?? What do people do
in case they need to display data,allow rearrangement of data etc.Are there
any other apps...looking forward to hearing from you folks

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Peter Kovgan
on windows it also was 1.3

I collected statics as you said, but it brought also many not static files
Actually all my sources went there.




On 10 August 2011 22:49, Gelonida N  wrote:

> On 08/10/2011 09:01 PM, Peter Kovgan wrote:
> > Ok, Ok, I've got it, read docs.
> >
> > But why It must be so complex?
> > Why default admin statics become unavailable, if you use another server
> > and not that of development: "runner"?
> >
> > Should it mean, that I must find elsewhere my admin statics, copy-paste
> > them to some place and poin to this place from settings.py?
> >
> > OK
> > I do not like this burden.
> >
> The burden is not really a big burden.
>
> Set STATIC_ROOT in config.py  to a directory, which is empty and where
> you have write permissions to.
>
>
> run afterwards ./manage.py  collectstatic
>
>
> This should collect all static files (also the ones from standard django
> modules) into the STATIC_ROOT directory.
>
> If your STATIC_ROOT directory does NOT contain the files that aren't
> served, then this is strange.
>
>
>
> Just one more question:
>
> Did you also use Django 1.3 on your windows host or was it a different
> version???
>
>
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: spam in response to posting to this list

2011-08-10 Thread Praveen Krishna R
*+1
*
On Wed, Aug 10, 2011 at 7:32 PM, Kayode Odeyemi  wrote:

> I have been getting this too.
>
>
> On Wed, Aug 10, 2011 at 5:15 PM, Tom Evans wrote:
>
>> On Wed, Aug 10, 2011 at 5:06 PM, Eric Hutchinson
>>  wrote:
>> > I responded to the thread about ordering tables, and got this as a
>> > response
>> >
>>
>> I reported the same thing a couple of days ago. Russell Keith-Magee is
>> aware of the issue (he gets them too), but it seems almost impossible
>> to track down a specific subscriber from the info in that email.
>>
>> Cheers
>>
>> Tom
>>
>> --
>> 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+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Odeyemi 'Kayode O.
> http://www.sinati.com. t: @charyorde
>
>
>  --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Thanks and Regards,
*Praveen Krishna R*

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread Adam Zedan
Or in other words  a good datagrid to use with Djano...What do u
people suggest or use??

On Aug 11, 1:52 am, Adam Zedan  wrote:
> Hi i wanted to know what do most people here do when they need to show
> results in a template which just needs to be displayed in Table.
> For example displaying data from a db etc in a template. I did try an app
> called django_tables2 but it just seems really simple with respect to
> presentation.
> I tried loading the CSS version 'paleblue' of that app but it doesnt work ?
> if someone has already tried that please do let me know ?? What do people do
> in case they need to display data,allow rearrangement of data etc.Are there
> any other apps...looking forward to hearing from you folks

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: How to pass url parameters to template url tag

2011-08-10 Thread bruno desthuilliers
On 10 août, 21:52, Kayode Odeyemi  wrote:
> On Wed, Aug 10, 2011 at 6:57 PM, bruno desthuilliers <
>
> bruno.desthuilli...@gmail.com> wrote:
> > On 10 août, 16:30, Tom Evans  wrote:
>
> > Now for the third solution: write your own template tag. Not
> > necessarily required, but that's often the best solution wrt/
> > decoupling / flexibility / maintainability / reusability.
>
> I've been considering using custom template tag. Yeah, it is standard and
> pretty. I guess
> this might take me a while to implement.

Well, the first time, yes, possibly. But that's not rocket science
neither, and that's something anyone whishing to make proper use of
Django should learn.

> However, can this concept also be used to pass page objects (e.g model data
> passed to a template from a view) from one view to another.

You don't pass anything from "one view to another". You eventually
pass data from a request to another, using either request params
(querystring, post...), cookies, or sessions (and of course the parts
of your urls that become view args).

> For instance, I have a request model dynamic data

Sorry, but I don't know what a "request model dynamic data" is
supposed to be. Care to explain more clearly ?

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: spam in response to posting to this list

2011-08-10 Thread Michal Petrucha
On Thu, Aug 11, 2011 at 12:14:37AM +0300, Praveen Krishna R wrote:
> *+1
> *
> On Wed, Aug 10, 2011 at 7:32 PM, Kayode Odeyemi  wrote:
> 
> > I have been getting this too.

Please, people, be at least a little bit reasonable. Let's not make
this another completely pointless "+1, me too" thread with no
information at all. I bet most of the people posting to this mailing
list are getting that spam and it really does not help at all if we
all just start posting "+1" mails.

Michal


signature.asc
Description: Digital signature


Re: same form model with separate admins and data

2011-08-10 Thread Landy Chapman
If I understand you correctly, your situation is:

FORM 1  --> [table 1]
FORM 2  --> [table 2]

where FORM1 and FORM2 are *identical*,
and TABLE1 and TABLE2 are *identical*  (same structure)

*identical* meaning definition is the same but names are different for
obvious reasons...


If I understand you correctly I can help you with this.  In other
words Bruno's suggestion above fits perfectly, and you just override
the table_name parameters in the child classes.

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: spam in response to posting to this list

2011-08-10 Thread Brian Bouterse
+1 to your suggestion of folks not overusing +1

On Wed, Aug 10, 2011 at 5:51 PM, Michal Petrucha wrote:

> On Thu, Aug 11, 2011 at 12:14:37AM +0300, Praveen Krishna R wrote:
> > *+1
> > *
> > On Wed, Aug 10, 2011 at 7:32 PM, Kayode Odeyemi 
> wrote:
> >
> > > I have been getting this too.
>
> Please, people, be at least a little bit reasonable. Let's not make
> this another completely pointless "+1, me too" thread with no
> information at all. I bet most of the people posting to this mailing
> list are getting that spam and it really does not help at all if we
> all just start posting "+1" mails.
>
> Michal
>



-- 
Brian Bouterse
ITng Services

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread Brian Bouterse
I know it's not Django specific, but when I need a table for my Django
projects, I use jQuery Datatable .  It rocks!

Brian

On Wed, Aug 10, 2011 at 5:26 PM, Adam Zedan  wrote:

> Or in other words  a good datagrid to use with Djano...What do u
> people suggest or use??
>
> On Aug 11, 1:52 am, Adam Zedan  wrote:
> > Hi i wanted to know what do most people here do when they need to show
> > results in a template which just needs to be displayed in Table.
> > For example displaying data from a db etc in a template. I did try an app
> > called django_tables2 but it just seems really simple with respect to
> > presentation.
> > I tried loading the CSS version 'paleblue' of that app but it doesnt work
> ?
> > if someone has already tried that please do let me know ?? What do people
> do
> > in case they need to display data,allow rearrangement of data etc.Are
> there
> > any other apps...looking forward to hearing from you folks
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Brian Bouterse
ITng Services

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-10 Thread David
I'm a fan of django_tables2. You have to write the CSS yourself if you
want anything special, but I'm ok with that. It does a good job of
handling server side pagination and sorting as well as custom column
renderers. It also ties in pretty well with Django models if you need
that kind of thing.

On Aug 10, 1:52 pm, Adam Zedan  wrote:
> Hi i wanted to know what do most people here do when they need to show
> results in a template which just needs to be displayed in Table.
> For example displaying data from a db etc in a template. I did try an app
> called django_tables2 but it just seems really simple with respect to
> presentation.
> I tried loading the CSS version 'paleblue' of that app but it doesnt work ?
> if someone has already tried that please do let me know ?? What do people do
> in case they need to display data,allow rearrangement of data etc.Are there
> any other apps...looking forward to hearing from you folks

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making history

2011-08-10 Thread Mike Dewhirst

On 10/08/2011 10:37pm, Shawn Milochik wrote:

I do essentially that, using a post_save signal and dumping the
serialized model instance to MongoDB with datestamp, etc.

The relevant part is this (after importing Django's serializers):

  serialized_object = serializers.serialize(
 "json",
 sender.objects.filter(pk = instance.pk),
 ensure_ascii = False,
 )

I store them outside of the primary database because it doesn't makes
sense to store audit history where, if your data is corrupted or
tampered with, you audit data could be also.


I really like that approach for audit. Depending on where you sent the 
output it would be perfect for defeating the uglies. I have read about 
MongoDB and it looks very interesting.


Although what I'm looking for is audit history in a sense, the history 
is part of the workflow. That means it needs to be inside the database.


If I want to include details of record changes when a document record is 
saved it seems I should look more closely at post_save signals - at 
least to reduce complexity in the models.


Thanks Shawn

Cheers

Mike





--
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making history

2011-08-10 Thread Shawn Milochik
Mike,

I'm doing something similar in another project. I created a sublass of
models.Model and am using that throughout the project, which makes it
much easier.

On the post-save of any subclass of my custom model, I serialize the
model's fields as a JSON object and store it in a text field of my
application's database in a special audit model. That audit object
stores the timestamp, instance's primary key, and optionally the User
instance that changed it.

There's also a 'description' field in my audit model. For every entry
in the audit table for the same primary key you can grab the JSON and
compare them and write plain text to the description field like 'last
name changed from Smith to Smithe by someguy at 2011-08-10 13:42.'

The beauty of the 'description' field is that if I ever want to change
the format of that, I can change my code and then re-generate the
description from the JSON, so there won't be a cutoff between
"old-style audit history" and "new-style audit history."

Incidentally, my custom model (and therefore all subclasses of it) are
using a UUID as a primary key to avoid the horror that is generic
foreign keys. Just in case you were wondering how my audit scheme
works across various models.

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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Releasing my Fabfile for Django projects

2011-08-10 Thread Andrew Badr
Hi, I'm posting here to announce the release of the Fabfile that I use
for Django projects. Using it, you can make your Django project live
with a single command. It also comes with a default project layout
that I like to start from.

Get the code at https://github.com/reverie/django-fabfile, and read my
perspective on the project at http://andrewbadr.com/log/9/django-fabfile/.

-Andrew

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: making history

2011-08-10 Thread Mike Dewhirst

On 11/08/2011 9:51am, Shawn Milochik wrote:

Mike,

I'm doing something similar in another project. I created a sublass of
models.Model and am using that throughout the project, which makes it
much easier.


I'm sub-classing models.Model to include created, updated and updated_by 
fields which is pretty ordinary but nice. I'm also borrowing Marty 
Alchin's (Pro Django pp257 - 260) CurrentUserField to automatically 
insert the current user into updated_by.


I used the same technique to subclass models.ForeignKey('Document', 
to_field='ancestor' ..) so I can just add AncestorKey() to any model 
which needs to link to the "line" of documents rather than a single 
document. The project isn't anywhere near finished - I'm still writing 
the models - so I don't know how well all this will work - but my thanks 
to Marty anyway!


Also - I just googled and found - 
https://bitbucket.org/q/django-simple-history/overview which builds on 
Marty Alchin's approach to history. I haven't fully understood his 
approach yet so the content of that link is probably a bit beyond me at 
the moment.




On the post-save of any subclass of my custom model, I serialize the
model's fields as a JSON object and store it in a text field of my
application's database in a special audit model. That audit object
stores the timestamp, instance's primary key, and optionally the User
instance that changed it.

There's also a 'description' field in my audit model. For every entry
in the audit table for the same primary key you can grab the JSON and
compare them and write plain text to the description field like 'last
name changed from Smith to Smithe by someguy at 2011-08-10 13:42.'

The beauty of the 'description' field is that if I ever want to change
the format of that, I can change my code and then re-generate the
description from the JSON, so there won't be a cutoff between
"old-style audit history" and "new-style audit history."


Beauty indeed :)

I'm definitely going to rethink my design. You are making me think a 
generic solution is worthwhile.




Incidentally, my custom model (and therefore all subclasses of it) are
using a UUID as a primary key to avoid the horror that is generic
foreign keys. Just in case you were wondering how my audit scheme
works across various models.


That's something I haven't investigated. I haven't experienced too many 
horrors yet.


Thanks again

Mike



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 group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: dull look after install on ubuntu

2011-08-10 Thread Peter Kovgan
Why , for example, collectstatic copied not static content?


example, /home/peter/work/django/projects/src/mysite/polls/ - it's all new
project file, there were no statics yet


See there:


Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/gis/move_vertex_off.png'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/gis/move_vertex_on.png'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/inline-delete-8bit.png'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tooltag-arrowright.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/selector_stacked-add.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/default-bg-reverse.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/nav-bg.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/arrow-down.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/selector-add.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/nav-bg-reverse.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/selector-search.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon-unknown.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/default-bg.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_addlink.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_deletelink.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/chooser_stacked-bg.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/changelist-bg_rtl.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tooltag-add.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/changelist-bg.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon-yes.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tool-left_over.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/inline-restore-8bit.png'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_searchbox.png'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon-no.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_clock.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/selector_stacked-remove.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/nav-bg-grabber.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/selector-remove.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/inline-delete.png'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_calendar.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tool-right.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tool-right_over.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/inline-restore.png'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/deleted-overlay.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/inline-splitter-bg.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_error.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_success.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_alert.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/selector-removeall.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tooltag-arrowright_over.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/arrow-up.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/icon_changelink.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tool-left.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/tooltag-add_over.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/chooser-bg.gif'
Copying
'/usr/local/lib/python2.7/dist-packages/django/contrib/admin/media/img/admin/selector-a