Re: Maintaining foreign key reference when foreign object gets deleted

2006-06-28 Thread mohan

> the object with that ID still has to actually
> exist in the database, or else you'll end up getting errors from your
> code.

When an object is deleted can we not update its foreignkey reference to
point to it's corresponding Log object..


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Almost there: A little help in how template dirs under Linux

2006-06-28 Thread Jeremy Dunck

On 6/28/06, mamcxyz <[EMAIL PROTECTED]> wrote:
>
> I forgot to add this details:
>
> django is installed in /root/django_src
>
> The project is in
>
> /root/vulcano/jhonWeb/

Surface-level: have you ensured that the user lighty/fcgi is running
under has access to the template dir?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: mailing list management

2006-06-28 Thread Bryan Chow

Kinda. We have been using a developed-from-scratch mailing list system
using Django. Web management interface plus support for email commands
using procmail into Python scripts. Still a work in progress but it's
in production. Pretty simple stuff.

Bryan


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Almost there: A little help in how template dirs under Linux

2006-06-28 Thread mamcxyz

I forgot to add this details:

django is installed in /root/django_src

The project is in

/root/vulcano/jhonWeb/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: prepopulate_from

2006-06-28 Thread Adrian Holovaty

On 6/28/06, Chase <[EMAIL PROTECTED]> wrote:
> I'd like to set up an admin form that will use something like a
> SlugField's prepopulate_from to fill several text fields with
> information from foreignkey, float, and other fields. It doesn't seem
> Django's current function will meet my needs, but I'm trying to figure
> out the best way to proceed before I start hacking around with
> Javascript. Here's a bit of pseudocode:
>
> class Player(models.Model):
> team = models.ForeignKey(Team)
> team_text = models.CharField(maxlength=100,
> prepopulate_from=('team',))
>

If Django's current function doesn't handle this, I would consider
that a bug. What does it currently do -- include the raw ID value of
the team rather than the display name?

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Almost there: A little help in how template dirs under Linux

2006-06-28 Thread mamcxyz

After 2 weeks I was able to setup django under CentOS 3 ;)

Now, I'm so close... I can see the login screen of admin but the admin
media files and my media and the templates are not loading :(

This is under lighttpd with the lastest svn code with the new fastcgi:

lighttp:

server.document-root= "/root/vulcano/jhonWeb/data/files/"

 fastcgi module

fastcgi.server = (
"/main.fcgi" => (
"main" => (
"host" => "127.0.0.1",
"port" => 3033,
"check-local" => "disable"
)
),
"/admin.fcgi" => (
"admin" => (
"socket" => "/tmp/admin.socket",
"check-local" => "disable"
)
)
)

alias.url = (
"/media/" => "/root/django_src/django/contrib/admin/media/",
)

url.rewrite-once = (
"^(/media.*)$" => "$1",
"^/favicon\.ico$" => "/media/favicon.ico",
"^(/.*)$" => "/main.fcgi$1",
"^(/admin.*)$" => "/admin.fcgi$1",
)


* Settings file:

#Determinar si esta en el servidor de desarrollo o de produccion...
if os.name=='nt':
BASE_DIR = 'E:\\Proyectos\\Python\\jhonWeb\\'
else:
BASE_DIR = '/root/vulcano/jhonWeb/'

SITE_ID = 1

# Absolute path to the directory that holds media.
# Example: "/home/media/media.lawrence.com/"
if os.name=='nt':
MEDIA_ROOT = BASE_DIR + 'data\\files\\'
else:
MEDIA_ROOT = BASE_DIR + 'data/files/'

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

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates".
# Always use forward slashes, even on Windows.
'plantillas',
'/root/vulcano/jhonWeb/plantillas',
)


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: MS SqlServer in Django

2006-06-28 Thread Adrian Holovaty

On 6/28/06, Filipe <[EMAIL PROTECTED]> wrote:
> Can someone please confirm if Django running on a linux machine does
> not currently support MS SqlServer?

Django doesn't support SQL Server fully -- the support is still under
development. Search the django-users and django-developers
mailing-list archives to see some discussion on the matter.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread Adrian Holovaty

On 6/28/06, Geert Vanderkelen <[EMAIL PROTECTED]> wrote:
> ALTER TABLE appname_modelname ENGINE=MyISAM;
>
> and you're done. That's something you'll have to do afterward doing a
> 'syncdb' or sqlreset indeed.

You can put that ALTER TABLE statement in the "sql" directory within
your app, named in an appropriate way, and it'll get executed
automatically for "syncdb" and "sqlreset", etc.

See here:

http://www.djangoproject.com/documentation/model_api/#providing-initial-sql-data

Also, I've written this up as a FAQ -- thanks for asking the question.

http://www.djangoproject.com/documentation/faq/#how-do-i-add-database-specific-options-to-my-create-table-statements-such-as-specifying-myisam-as-the-table-type

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



mailing list management

2006-06-28 Thread Ian Holsman

anyone in django land integrated mailing lists with django ?

regards
Ian

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django Boot Camp

2006-06-28 Thread Adrian Holovaty

On 6/28/06, keukaman <[EMAIL PROTECTED]> wrote:
> Does anyone have any thoughts on a "boot camp" for prospective Django
> users where completion would result in a solid foundation for building
> commercial Django powered sites?

Hey keukaman,

Are you suggesting a "real-world" boot camp, or an online one? I would
love to do any/all of the above...

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: else tag for ifchanged

2006-06-28 Thread Adrian Holovaty

On 6/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> i am currently looking at building a kinda daily posts blog thing and
> basically i need this functionality.  if the date changes, i need a
> "date" header.  if the date hasn't changed but i'm on a new blog post i
> just need a simple separator.  Now, at first i would imagine this be
> the code:
>
> {% ifchanged %}
> {{
> post.created|date:"Y.m.d" }}
> {%else %}
> 
> {% endifchanged %}
>
> but else is not a valid block tag.  any insight from devs or other
> users.
> i am using the django.views.generic.date_based.archive_index generic
> view

Ah, we should add an {% else %} clause to the {% ifchanged %} tag --
that'd be a nice addition.

For this solution, you could use {% regroup %}. The {% regroup %} tag
is pretty complex and kind of hard to understand, but it's powerful
for times like these.

{% regroup post_list by created as date_list %}

(Now post_list is a list of objects grouped by distinct "created" values.
Each one has a "grouper" and a "list" attribute.)

{% for date in date_list %}

{{ date.grouper|date:"Y.m.d" }}

  {% for entry in date.list %}
  {{ entry.headline }} ...whatever
  {% endfor %}

{% endfor %}

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django admin errors

2006-06-28 Thread Norbert

> As noted in another message in this thread; this looks like your user
> object hasn't been saved before being added to the m2m object.

This was indeed the issue.

> This looks like it could be a manifestation of Ticket #1839. I'm in the
> process of looking at this one at the moment.

Please let me know if you need to know anything more, or need me for testing.

Thanks for the response!

Norbert

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Exclusion by a many-to-many field to self

2006-06-28 Thread Russell Keith-Magee
On 6/28/06, Mikko Nylén <[EMAIL PROTECTED]
> wrote: 
I've tried this:Color.objects.exclude(similar_colors__the_color__startswith="..."), and italmost works. However, the problem is, it doesn't give the Colors whichdon't have any Colors in similar_colors. I need to get these as well.
Interesting... this could be interpreted as a bug in exclude(). It might be worth checking to see if this has been identified before, and if not, raising this as a bug. Sounds like it could be a problem with a join that should be OUTER, but is LEFT INNER (or some such).
 
In other words, what I want is (if this syntax would be possible):Color.objects.all() -Color.objects.filter(similar_colors__the_color__startswith="..."), as thefilter() gives all those objects I don't want to get included.
exclude() would have been my suggestion. You could try hand writing the SQL, or using where/tables clauses in a filter to build a search that does what you want; or, depending on how large you are expecting your result set to be, actually do the subtraction you mention (all - filter).
Russ Magee %-)


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Django Boot Camp

2006-06-28 Thread keukaman

Does anyone have any thoughts on a "boot camp" for prospective Django
users where completion would result in a solid foundation for building
commercial Django powered sites?

I found the tutorial for the poll to be very good, but I still have a
lot of questions. As a newcomer to this type of web design, I still
need to learn the basics: everything from Apache settings to items such
as how to serve media, exactly where the directories for media should
be, css, etc. Best practices with regard to database design, template
design, etc., also come to mind.

Your thoughts would be appreciated.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django admin errors

2006-06-28 Thread Russell Keith-Magee
On 6/29/06, Norbert Wojtowicz <[EMAIL PROTECTED]> wrote:
   112. if follow.get(f.name, False):   AttributeError at /admin/auth/user/1/   'bool' object has no attribute 'get'This looks like it could be a manifestation of Ticket #1839. I'm in the process of looking at this one at the moment.
 Second Problem (I'm not sure, but I think it may be related to the previous):
   ValueError at /iit/2006/summer/ipro338/email/send/    instance needs to have a primarykey value before a many-to-many relationship can be used.Any and all suggestions welcome, even if only for the second problem (I can
live without admin, but I can't live without saving users). =)As noted in another message in this thread; this looks like your user object hasn't been saved before being added to the m2m object.   
Russ Magee %-)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Re: model validation and foreign keys

2006-06-28 Thread Russell Keith-Magee
On 6/29/06, Michael Radziej <[EMAIL PROTECTED]> wrote:
Hey russellm,thanks a lot for the extended model validation--it rocks! Youprobably saved me endless hours of debugging twisted things!No problems Michael - glad I could help you out.
Yours,Russ Magee %-)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]  For more options, visit this group at http://groups.google.com/group/django-users  -~--~~~~--~~--~--~---


Banks hacked

2006-06-28 Thread Judge

Hackers gain access to server hosting bank Web sites: A hosting
provider for smaller community banks was recently compromised by
hackers, placing at risk more than 100 different banks across the U.S.
www.theonlinebanks.com


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Customizing form.x widgets - how?

2006-06-28 Thread [EMAIL PROTECTED]

Thanks for the tip.

It may still be useful if we could get at the form field value by
itself, perhaps with a syntax like "form.description.value" or
form.variable.value.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: django admin errors

2006-06-28 Thread [EMAIL PROTECTED]

Answering my own mail here...

> Second Problem (I'm not sure, but I think it may be related to the previous):
...
> for n in data['recipients']:
> e.recipients.add(User.objects.get(pk=n))

This is no longer a problem. Malcolm Tredinnick answered this issue
yesterday (I have simply not been able to keep up with the mailing-list
lately).

The solution is to save the object, before you add M2M to it. The error
message was misleading, because it complained of a missing id for the
User, not for the actual model you were saving to.

So this works:

e.save()
for n in data['recipients']:
  e.recipients.add(User.objects.get(pk=n))


Still have not resolved the first issue; it's not critical for me, but
still would like to figure out what the problem is.

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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread James Bennett

On 6/28/06, Geert Vanderkelen <[EMAIL PROTECTED]> wrote:
> I'm also not sure how you going to use the full text
> searching unless there is a patch now too..

For just querying against the DB, having fulltext indexes set up
should be sufficient; the DB's query optimizer will recognize that
there's an index for the table/column you're querying on and use that.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread James Bennett

On 6/28/06, Geert Vanderkelen <[EMAIL PROTECTED]> wrote:
> Think you made a typo there or so..
>
> MyISAM -> none transactional
> InnoDB and NDBCluster (and BDB) -> transactional

Yeah. Too much traveling, too much coding, too little sleep :(

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Wanted: Screencast showing how to setup a real-world Django site at WebFaction

2006-06-28 Thread gabor

Vladimir Pouzanov wrote:
> On 6/28/06, Remi <[EMAIL PROTECTED]> wrote:
>> A few days ago we released the screencast of our control panel
>> (http://blog.webfaction.com/control-panel-demo) which showed, amongst
>> other things, how to setup a default Django site in a few clicks.
> I hope the new screencast will be in some format playable in linux ;)
> 
> 

the mov-version can be played fine using mplayer.

gabor

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread Geert Vanderkelen

Hi Andrew,

[EMAIL PROTECTED] wrote:
> Hi,
> 
> A total newbie question here, but is there a way to specify the engine
> I would prefer when defining models for applications. Would really
> prefer MyISAM, but MySQL keeps creating InnoDB when the tables are
> automatically created. (Reason: MyISAM supports full-text searching
> whereas InnoDB doesn't).

I think this already came up somewhere in a bug report/feature request.

> Please don't tell me I'll have to create tables manually to achieve
> this!

Unless I missed something, yup you have. But not really in the end.

ALTER TABLE appname_modelname ENGINE=MyISAM;

and you're done. That's something you'll have to do afterward doing a 
'syncdb' or sqlreset indeed.

InnoDB tables are needed to take advantage of transactions. With MyISAM you 
don't have that. I'm also not sure how you going to use the full text 
searching unless there is a patch now too..

Cheers,

Geert

-- 
Geert Vanderkelen, Support Engineer, MySQL AB

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread Geert Vanderkelen

Hi James,

James Bennett wrote:
> On 6/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> A total newbie question here, but is there a way to specify the engine
>> I would prefer when defining models for applications. Would really
>> prefer MyISAM, but MySQL keeps creating InnoDB when the tables are
>> automatically created. (Reason: MyISAM supports full-text searching
>> whereas InnoDB doesn't).
> 
> You won't have to create tables manually, in one sense. However,
> you'll end up doing a bit of indirection; Django will happily output
> to a terminal the SQL it's going to execute to create the tables[1],
> so you can use that, edit it to specify the table type you want, and
> then source the file from inside MySQL.
> 
> Also, keep in mind that not using MyISAM means losing transactions.

Think you made a typo there or so..

MyISAM -> none transactional
InnoDB and NDBCluster (and BDB) -> transactional

Using InnoDB you can do transaction, using MyISAM not.

Cheers,

Geert

-- 
Geert Vanderkelen, Support Engineer
MySQL GmbH, Germany, www.mysql.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: SuspiciousOperation: User tampered with session cookie

2006-06-28 Thread Patrick J. Anderson

On Tue, 27 Jun 2006 23:30:56 -0500, Patrick .J. Anderson wrote:

> Malcolm Tredinnick wrote:
>> [quoted text muted]
> 
> Hi, Malcolm
> 
> Yes, I noticed that too. Perhaps it would be good if I tested this
> behaviour on another distro, but I don't want to resetup my development
> machine again. Maybe someone with a distro other than Ubuntu Dapper
> could compare the session_keys in django_sessions table with mod_python
> as well as builtin server, and see if this is also happening.
> 
> Patrick
> 
> 
> 
Well, I reinstalled Fedora Core 5 and setup django-trunk. There is no
problem with FC5, so I suspect that there's something wrong with Ubuntu
Dapper here.

Here's my session_key after logging into admin using mod_python:

21d78b3bd4da4a79bd7f02c038c0707d


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



django_website from svn on Mac OSX problems.

2006-06-28 Thread Zach

Hi, I'm running Mac OSX 10.4.7 on a Mac Mini Intel Core Duo (1.66 ghz
512mb of RAM) Python 2.4.3 (Universal Build). I have the latest Django
build from the trunk in the SVN. I got django_website straight from the
SVN, aswell. I installed memcached from darwinports and py-memcached
from the source. After only configuring my database settings
(Postgresql running locally connecting with psycopg2) and running
python manage.py syncdb I did python manage.py runserver and could not
access localhost:8000 from my web browser (I tried Camino and Safari).
Any ideas? 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: else tag for ifchanged

2006-06-28 Thread Waylan Limberg

On 6/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> i am currently looking at building a kinda daily posts blog thing and
> basically i need this functionality.  if the date changes, i need a
> "date" header.  if the date hasn't changed but i'm on a new blog post i
> just need a simple separator.  Now, at first i would imagine this be
> the code:
>
try something like this:

{% ifchanged %}
{{
post.created|date:"Y.m.d" }}
{% endifchanged %}
{% ifnotchanged %}

{% endifnotchanged %}
>
> but else is not a valid block tag.  any insight from devs or other
> users.
> i am using the django.views.generic.date_based.archive_index generic
> view
>
>
> >
>


-- 

Waylan Limberg
[EMAIL PROTECTED]

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Wanted: Screencast showing how to setup a real-world Django site at WebFaction

2006-06-28 Thread Vladimir Pouzanov

On 6/28/06, Remi <[EMAIL PROTECTED]> wrote:
> A few days ago we released the screencast of our control panel
> (http://blog.webfaction.com/control-panel-demo) which showed, amongst
> other things, how to setup a default Django site in a few clicks.
I hope the new screencast will be in some format playable in linux ;)


-- 
Sincerely,
Vladimir "Farcaller" Pouzanov
http://www.hackndev.com

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



prepopulate_from

2006-06-28 Thread Chase

Hi all

I'd like to set up an admin form that will use something like a
SlugField's prepopulate_from to fill several text fields with
information from foreignkey, float, and other fields. It doesn't seem
Django's current function will meet my needs, but I'm trying to figure
out the best way to proceed before I start hacking around with
Javascript. Here's a bit of pseudocode:

class Player(models.Model):
team = models.ForeignKey(Team)
team_text = models.CharField(maxlength=100,
prepopulate_from=('team',))

This example makes the text field seem redundant, but it's really not.
It's also just as likely that I'm completely missing the obvious
solution. Got any suggestions? 

Thanks,
Chase


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



django admin errors

2006-06-28 Thread Norbert

Hello,

I have not been able to resolve this issue with people's help on irc, so I'm 
hoping to reach a larger audience.

Dependencies:
- reset all my databases
- running mod_python + apache
  (restarted more than once :)
- svn trunk (a day old at the time of writing)

Problem:
domain/admin/auth/user/1/

(this is the built-in admin, with the built-in user class)

Error:
Traceback (most recent call last):
 File "/usr/local/lib/python2.4/site-packages/django/core/handlers/base.py" in 
get_response
   74. response = callback(request, *callback_args, **callback_kwargs) 
File 
"/usr/local/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py"
 
in _checklogin
   54. return view_func(request, *args, **kwargs) 
File "/usr/local/lib/python2.4/site-packages/django/views/decorators/cache.py" 
in _wrapped_view_func
   40. response = view_func(request, *args, **kwargs) 
File "usr/local/lib/python2.4/site-packages/django/contrib/admin/views/main.py" 
in change_stage
   316. manipulator = model.ChangeManipulator(object_id) 
File "/usr/local/lib/python2.4/site-packages/django/db/models/manipulators.py" 
in __init__
   272. super(AutomaticChangeManipulator, self).__init__(follow=follow) 
File "/usr/local/lib/python2.4/site-packages/django/db/models/manipulators.py" 
in __init__
   75. self.fields.extend(f.get_manipulator_fields(self.opts, self, 
self.change, fol))
 File "/usr/local/lib/python2.4/site-packages/django/db/models/related.py" in 
get_manipulator_fields
   112. if follow.get(f.name, False):
 
   AttributeError at /admin/auth/user/1/
   'bool' object has no attribute 'get'

Second Problem (I'm not sure, but I think it may be related to the previous):

In a custom manipulator, I'm saving a M2M.

model:
recipients = models.ManyToManyField(User, related_name="recipients")

manipulator - in .save()
for n in data['recipients']:
e.recipients.add(User.objects.get(pk=n))

part of view, which passes data to manipulator - which I simplified for 
debugging:
data['recipients'] = [User.objects.get(username='igroupsadmin').id]

'igroupsadmin' is a valid user, with an ID (I checked the database entry)

Error during manipulator.save():
 
 Traceback (most recent call last):
 File "/usr/local/lib/python2.4/site-packages/django/core/handlers/base.py" in 
get_response
   74. response = callback(request, *callback_args, **callback_kwargs) 
File "/usr/local/lib/python2.4/site-packages/django/contrib/auth/decorators.py" 
in _checklogin
   14. return view_func(request, *args, **kwargs)
 File "/srv/igroups30/igroups/igroups/emails/views.py" in send_group_email
   84. email = manipulator.save(data)
 File "/srv/igroups30/igroups/igroups/emails/views.py" in save
   46. e.recipients.add(User.objects.get(pk=n)) 
File 
"/usr/local/lib/python2.4/site-packages/django/db/models/fields/related.py" 
in __get__
   413. target_col_name=qn(self.field.m2m_reverse_name()) 
File 
"/usr/local/lib/python2.4/site-packages/django/db/models/fields/related.py" 
in __init__
   252. raise ValueError("%r instance needs to have a primary key value before 
a many-to-many relationship can be used." % model)

   ValueError at /iit/2006/summer/ipro338/email/send/
instance needs to have a primary 
key value before a many-to-many relationship can be used.

Any and all suggestions welcome, even if only for the second problem (I can 
live without admin, but I can't live without saving users). =)

Thanks in advance,
Norbert

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django t-shirts: your ideas wanted!

2006-06-28 Thread arthur debert

"A Django Model"
...


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



model validation and foreign keys

2006-06-28 Thread Michael Radziej

Hey russellm,

thanks a lot for the extended model validation--it rocks! You
probably saved me endless hours of debugging twisted things!

8-)

Michael

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



django admin errors

2006-06-28 Thread Norbert Wojtowicz

Hello,

I have not been able to resolve this issue with people's help on irc, so I'm 
hoping to reach a broader audience.

Dependencies:
- reset all my databases
- running mod_python + apache
  (restarted more than once :)
- svn trunk (a day old at the time of writing)

Problem:
domain/admin/auth/user/1/

(this is the built-in admin, with the built-in user class)

Error:
Traceback (most recent call last):
 File "/usr/local/lib/python2.4/site-packages/django/core/handlers/base.py" in 
get_response
   74. response = callback(request, *callback_args, **callback_kwargs) 
File 
"/usr/local/lib/python2.4/site-packages/django/contrib/admin/views/decorators.py"
 
in _checklogin
   54. return view_func(request, *args, **kwargs) 
File "/usr/local/lib/python2.4/site-packages/django/views/decorators/cache.py" 
in _wrapped_view_func
   40. response = view_func(request, *args, **kwargs) 
File "usr/local/lib/python2.4/site-packages/django/contrib/admin/views/main.py" 
in change_stage
   316. manipulator = model.ChangeManipulator(object_id) 
File "/usr/local/lib/python2.4/site-packages/django/db/models/manipulators.py" 
in __init__
   272. super(AutomaticChangeManipulator, self).__init__(follow=follow) 
File "/usr/local/lib/python2.4/site-packages/django/db/models/manipulators.py" 
in __init__
   75. self.fields.extend(f.get_manipulator_fields(self.opts, self, 
self.change, fol))
 File "/usr/local/lib/python2.4/site-packages/django/db/models/related.py" in 
get_manipulator_fields
   112. if follow.get(f.name, False):
 
   AttributeError at /admin/auth/user/1/
   'bool' object has no attribute 'get'

Second Problem (I'm not sure, but I think it may be related to the previous):

In a custom manipulator, I'm saving a M2M.

model:
recipients = models.ManyToManyField(User, related_name="recipients")

manipulator - in .save()
for n in data['recipients']:
e.recipients.add(User.objects.get(pk=n))

part of view, which passes data to manipulator - which I simplified for 
debugging:
data['recipients'] = [User.objects.get(username='igroupsadmin').id]

'igroupsadmin' is a valid user, with an ID (I checked the database entry)

Error during manipulator.save():
 
 Traceback (most recent call last):
 File "/usr/local/lib/python2.4/site-packages/django/core/handlers/base.py" in 
get_response
   74. response = callback(request, *callback_args, **callback_kwargs) 
File "/usr/local/lib/python2.4/site-packages/django/contrib/auth/decorators.py" 
in _checklogin
   14. return view_func(request, *args, **kwargs)
 File "/srv/igroups30/igroups/igroups/emails/views.py" in send_group_email
   84. email = manipulator.save(data)
 File "/srv/igroups30/igroups/igroups/emails/views.py" in save
   46. e.recipients.add(User.objects.get(pk=n)) 
File 
"/usr/local/lib/python2.4/site-packages/django/db/models/fields/related.py" 
in __get__
   413. target_col_name=qn(self.field.m2m_reverse_name()) 
File 
"/usr/local/lib/python2.4/site-packages/django/db/models/fields/related.py" 
in __init__
   252. raise ValueError("%r instance needs to have a primary key value before 
a many-to-many relationship can be used." % model)

   ValueError at /iit/2006/summer/ipro338/email/send/
instance needs to have a primary 
key value before a many-to-many relationship can be used.

Any and all suggestions welcome, even if only for the second problem (I can 
live without admin, but I can't live without saving users). =)

Thanks in advance,
Norbert

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



else tag for ifchanged

2006-06-28 Thread [EMAIL PROTECTED]

i am currently looking at building a kinda daily posts blog thing and
basically i need this functionality.  if the date changes, i need a
"date" header.  if the date hasn't changed but i'm on a new blog post i
just need a simple separator.  Now, at first i would imagine this be
the code:

{% ifchanged %}
{{
post.created|date:"Y.m.d" }}
{%else %}

{% endifchanged %}

but else is not a valid block tag.  any insight from devs or other
users.
i am using the django.views.generic.date_based.archive_index generic
view


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



MS SqlServer in Django

2006-06-28 Thread Filipe

Hi,

Can someone please confirm if Django running on a linux machine does
not currently support MS SqlServer?

regards,
Filipe


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: inheriting from models.Model

2006-06-28 Thread James Bennett

On 6/28/06, spako <[EMAIL PROTECTED]> wrote:
> is there a way to achieve this? or should i not bother and just do have
> a Comment Model and just have VideoComment and UserComment have a
> OneToOneField to Comment?

Generally when you want to do something like this you define only one
model, and accomplish the relation to multiple classes by giving it
two fields: one a foreign key to a content-type, the other an object
id. The combination of content-type and object id specifies the exact
object it's tied to, and is generic enough to allow you to tie to any
model in your system (this is exactly how Django's built-in comments
system works).

This has recently been formalized as a "generic foreign key field",
which is being fleshed out.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



inheriting from models.Model

2006-06-28 Thread spako

hi

i'm trying to create a class that contains fields that can be inherited
by Model classes like this (User and Video also inherit from Model):

class Comment:
author = models.ForeignKey(User)
comment = models.TextField()
date_commented = models.DateTimeField(auto_now_add=True)

class VideoComment(models.Model, Comment):
video = models.ForeignKey(Video)

class UserComment(models.Model, Comment):
user = models.ForeignKey(User)


i've also tried a variation, by declarinthe classes like this (the
contents of the classes are the same as above):

class Comment(models.Model):
class VideoComment(Comment):
class UserComment(Comment):

this does not seem right and does not work anyway.

is there a way to achieve this? or should i not bother and just do have
a Comment Model and just have VideoComment and UserComment have a
OneToOneField to Comment?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Selecting MySQL engine (InnoDB/MyISAM) when creating models

2006-06-28 Thread James Bennett

On 6/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> A total newbie question here, but is there a way to specify the engine
> I would prefer when defining models for applications. Would really
> prefer MyISAM, but MySQL keeps creating InnoDB when the tables are
> automatically created. (Reason: MyISAM supports full-text searching
> whereas InnoDB doesn't).

You won't have to create tables manually, in one sense. However,
you'll end up doing a bit of indirection; Django will happily output
to a terminal the SQL it's going to execute to create the tables[1],
so you can use that, edit it to specify the table type you want, and
then source the file from inside MySQL.

Also, keep in mind that not using MyISAM means losing transactions.

[1] http://www.djangoproject.com/documentation/django_admin/#sql-appname-appname

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Exclusion by a many-to-many field to self

2006-06-28 Thread Mikko Nylén

Hi!,

I'm trying to exclude objects by a many-to-many field to self, but I haven't
had any success so far.

The model I use (just an example one, not the one I'm going to use this
for):

---
class Color(models.Model):
  the_color = models.CharField(maxlength=6)
  similar_colors = models.ManyToManyField("self")
---

So, I want to get all Color objects with similar_colors NOT containing a
Color with the_color starting with something.

I've tried this:
Color.objects.exclude(similar_colors__the_color__startswith="..."), and it
almost works. However, the problem is, it doesn't give the Colors which
don't have any Colors in similar_colors. I need to get these as well.

In other words, what I want is (if this syntax would be possible):
Color.objects.all() -
Color.objects.filter(similar_colors__the_color__startswith="..."), as the
filter() gives all those objects I don't want to get included.

How I can do this?

Thanks,

- Mikko Nylén


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: ImportError: No module named django

2006-06-28 Thread Craig Marshall

> It sounds like you might have two versions of Python installed. You
> should confirm that the shebang line in ./manage.py is for the right
> version. Alternatively, running 'python manage.py syncdb' should work.

The shebang says "#!/usr/bin/env python", which returns 2.4.3 when
asked. (So does "`which python` -V" and "python -V", in case that
sheds any light?)

Running "python manage.py syncdb" gives me exactly the same error as
"./manage.py syncdb".

Typing "pyt" only gives my "python" and "python2.4", the former
being a symlink to the latter, so I don't think I have a different
version installed anywhere. There's probably a better way to check
this though.

I'm really not sure what to try next. I guess the last resort is to go
back to debian, but I quite like the easy interface of ubuntu, so ..
hum.

Craig

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



ImportError: No module named django

2006-06-28 Thread Craig Marshall

Hi,

I downloaded the svn version of django a couple of weeks ago, and had
it working fine within Debian. I installed Ubuntu 6.06 today, and my
django install has stopped working.

I can run python interactively and type "import django" and get no
errors, but when I go into our project directory and run "./manage.py
syncdb",  I get this error:

ImportError: No module named django

I'm running Python 2.4.3 in case that matters - any ideas?

Thanks,
Craig

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Time field issues

2006-06-28 Thread tomass

Turns out it's because I had "default='09:00' in my model. I guess it
needs a time entry, not a string entry.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: admin and GenericRelation field

2006-06-28 Thread Guillermo Fernandez Castellanos

Oh... ok.

So I can keep the changes in my code, I simply need to be a bit patient :-)

That's good news. Thanks for the effort!

G

On 6/28/06, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
> On Jun 28, 2006, at 7:08 AM, Guillermo Fernandez Castellanos wrote:
> > I'm trying to modify my blogging application using the new
> > GenericRelation and GenericForeignKey, keeping the tagging concept as
> > easy as posible.
> >
> > The problem is, once the modifications made, I can not find a tag
> > field in the Admin interface. It says "Could not find Formfield or
> > InlineObjectCollection named 'tags'". The doc is yet a bit light on
> > this, so I can not find any info.
> >
> > Is it normal? Is there a way of circunventing this?
>
> Right now the Generic* fields don't appear in the admin.
>
> I'm working on it :)
>
> Jacob
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Overriding template blocks in code

2006-06-28 Thread Poromenos

Is there a way for me to specify template blocks in code? I want,
instead of overriding the "content" template from a file, to do it in
code. Is this possible?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: admin and GenericRelation field

2006-06-28 Thread Jacob Kaplan-Moss

On Jun 28, 2006, at 7:08 AM, Guillermo Fernandez Castellanos wrote:
> I'm trying to modify my blogging application using the new
> GenericRelation and GenericForeignKey, keeping the tagging concept as
> easy as posible.
>
> The problem is, once the modifications made, I can not find a tag
> field in the Admin interface. It says "Could not find Formfield or
> InlineObjectCollection named 'tags'". The doc is yet a bit light on
> this, so I can not find any info.
>
> Is it normal? Is there a way of circunventing this?

Right now the Generic* fields don't appear in the admin.

I'm working on it :)

Jacob

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Global template tags

2006-06-28 Thread Poromenos

Ah, that's what I needed, thanks a lot :)


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



admin and GenericRelation field

2006-06-28 Thread Guillermo Fernandez Castellanos

Hi,

I'm trying to modify my blogging application using the new
GenericRelation and GenericForeignKey, keeping the tagging concept as
easy as posible.

The problem is, once the modifications made, I can not find a tag
field in the Admin interface. It says "Could not find Formfield or
InlineObjectCollection named 'tags'". The doc is yet a bit light on
this, so I can not find any info.

Is it normal? Is there a way of circunventing this?

Thanks,

G

The code:

class Tag(models.Model):
slug=models.SlugField(prepopulate_from=('title',),
  help_text='Automatically built from the title',
  primary_key=True)
title = models.CharField(maxlength=30)
description=models.CharField(maxlength=200,help_text='Short
summary of this tag')
tagged_obj=models.GenericForeignKey()

def get_absolute_url(self):
return '/tags/%s/' % self.slug

def get_list(self):
return self.post_tagged.all()

def __str__(self):
return self.title

def __repr__(self):
return self.title

class Admin:
list_display = ('title','description')
search_fields = ('title','description')
fields = ((None, {'fields':('title','description','slug'),}),)



class Post(models.Model):
slug = models.SlugField(prepopulate_from=('title',),
  help_text='Automatically built from the title',
  primary_key=True)
title = models.CharField(maxlength=79)
creation_date = models.DateTimeField(auto_now=True)
body = models.TextField('Body Text')
summary = models.TextField(maxlength=300,
   blank=True,
   help_text='Will be displayed on article indexes'+
   'if it exists, otherwise full body will be used')
tags = models.GenericRelation(Tag)
image = models.ImageField('Attach Image',
   upload_to='sysvortex/blog',
   blank=True)
author = models.ForeignKey(User)
to_publish = models.BooleanField(default=False,
   help_text='Draft entries are visible only'+
   'to the authors and admins',
   radio_admin=True)
enable_comments = models.BooleanField(default=True)

def get_absolute_url(self):
return '/blog/%s/%s/' %
(self.creation_date.strftime('%Y/%m/%d').lower(),
 self.slug)
def get_tag_list(self):
return self.tags.all()

def __str__(self):
return self.title

def __repr__(self):
return self.title

class Admin:
list_display =
('title','creation_date','author','to_publish','enable_comments')
list_filter = ['creation_date','enable_comments']
date_hierarchy = 'creation_date'
list_select_related = 'True'
search_fields = ['title','summary','body']
ordering = ('-creation_date','to_publish')
js = ('tiny_mce/tiny_mce.js',
  'js/admin/textareas.js',)
fields = (
(None, {'fields':('title','to_publish','enable_comments'),}),
('Other information', {'fields':('slug','author','creation_date'),
   'classes': 'collapse'}),
('Post', {'fields':('summary','image','body',),
  'classes':'wide', }),
)

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Global template tags

2006-06-28 Thread Ian Holsman

Hi Poromenos.

you can set up a context processor to do this.
check out
http://svn.zyons.python-hosting.com/trunk/zilbo/common/utils/ 
context_processors.py
for 2 simple ones and
http://svn.zyons.python-hosting.com/trunk/zilbo/settings.py.tmpl
(the very bottom)
on how to configure it

regards
Ian

On 28/06/2006, at 9:36 PM, Poromenos wrote:

>
> Is there a way for me to pass a variable in every template context
> without writing custom template tags? I just want to pass the app name
> because I'm not comfortable with hardcoding it, but template tags seem
> too much work for something as simple as this.
>
> Isn't there something like a globals section, which get passed in  
> every
> template, where I could declare my variable and just do  
> {{ company_name
> }} and have it returned?
>
>
> >


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Global template tags

2006-06-28 Thread Poromenos

Is there a way for me to pass a variable in every template context
without writing custom template tags? I just want to pass the app name
because I'm not comfortable with hardcoding it, but template tags seem
too much work for something as simple as this.

Isn't there something like a globals section, which get passed in every
template, where I could declare my variable and just do {{ company_name
}} and have it returned?


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Maintaining foreign key reference when foreign object gets deleted

2006-06-28 Thread James Bennett

On 6/28/06, mohan <[EMAIL PROTECTED]> wrote:
> I understand that. But what about Generic Foreign Keys.. Can anyone
> give a simple example illustrating this case..

Generic foreign keys don't help either; they take a content-type ID
and an object ID, and the object with that ID still has to actually
exist in the database, or else you'll end up getting errors from your
code.

-- 
"May the forces of evil become confused on the way to your house."
  -- George Carlin

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Wanted: Screencast showing how to setup a real-world Django site at WebFaction

2006-06-28 Thread Remi

Hi everyone,

A few days ago we released the screencast of our control panel
(http://blog.webfaction.com/control-panel-demo) which showed, amongst
other things, how to setup a default Django site in a few clicks.
Now we'd like to make another screencast showing how to setup a
real-world Django application on our servers.

So we're looking for a Django guru to make that screencast for us.

The screencast should show:

- How to setup a default Django site using our control panel
- How to upgrade the Django code to the latest trunk.
- How to setup your database
- How to setup your site (you should use a real-world application)
- How to make upgrades to your site/database
- How to enable HTTPS for the admin pages

Reward: $200 + one year of free hosting on our "Shared 2" plan.

If you're interested get in touch with me at "remi at webfaction dot
com"

Remi.
http://www.webfaction.com  - Hosting for an agile web


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django t-shirts: your ideas wanted!

2006-06-28 Thread Derek Hoy

On 6/28/06, Julio Nobrega <[EMAIL PROTECTED]> wrote:

>   Django | Python: We indented jazz (some people say jazz' magic is
> the space between the notes, a definition that I love)

that's great  :)

I had 'the Djoy of Django' in my head as a title for The Book.

-- 
Derek

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Maintaining foreign key reference when foreign object gets deleted

2006-06-28 Thread mohan

> The boolean "is_deleted" flag on the Centre class may be your best
> bet, since it lets you filter "deleted" Centres out of most results

How to filter rows from default admin views.. I tried a couple of
things but it did not work.


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Maintaining foreign key reference when foreign object gets deleted

2006-06-28 Thread mohan

> A database can only maintain relationships between two objects if both
> objects actually exist in their respective tables.

I understand that. But what about Generic Foreign Keys.. Can anyone
give a simple example illustrating this case..


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Time field issues

2006-06-28 Thread tomass

Hi Folks,

I've just tried to add a time field to one of my models, and then I
ran:

ALTER TABLE blah ADD COLUMN blah_blah TIME;
UPDATE blah SET blah_blah='09:00:00'

I restarted apache, and I can see my current entries are showing 9am
correctly in the new "blah_blah" field, but when I try to add a new
entry into the "blah" table I get the following error:

AttributeError at /admin/runsheets/item/add/
'str' object has no attribute 'strftime'
Request Method: GET
Request URL:http://example.com/admin/runsheets/item/add/
Exception Type: AttributeError
Exception Value:'str' object has no attribute 'strftime'
Exception Location:

/usr/lib/python2.4/site-packages/Django-0.91-py2.4.egg/django/db/models/fields/__init__.py
in flatten_data, line 750

Any ideas what's happening here?

Thanks, 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Problem with admin pages

2006-06-28 Thread knobi

After my last svn update to django, calling an admin page produces the
following
error: tried urls in module django.contrib.admin. Error was: 'module'
object has no attribute 'urls'

debugging position django\core\urlresolvers.py in get_callback line 123

the debugger shows me that django.contrib.admin is loaded dynamically
but not the
urls submodule.

Any ideas what went wrong? TIA


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---



Re: Django t-shirts: your ideas wanted!

2006-06-28 Thread Kilian CAVALOTTI

On Wednesday 28 June 2006 05:11, Jacob Kaplan-Moss wrote:
> On Jun 27, 2006, at 10:04 PM, Julio Nobrega wrote:
> >   Django | Python: We indented jazz (some people say jazz' magic is
> > the space between the notes, a definition that I love)
>
> Ha -- that one makes me laugh... :)

+1, 'we indented jazz' is really great. :)

To add some to the list:
"django: jazz your web"
"django: because style matters"
"ror is a grunt. jazz is music" (fairplay, what's that? :))
"django plays music of the web"

My $0.02

-- 
Kilian CAVALOTTI  Administrateur réseaux et systèmes
UPMC / CNRS - LIP6 (C870)
8, rue du Capitaine Scott  Tel. : 01 44 27 88 54
75015 Paris - France   Fax. : 01 44 27 70 00

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---