Visit www.healthcaremagic.com for Live Chat with Doctors For FREE !!

2008-05-25 Thread Dr. Rashmi

LIVE CHAT with a Qualified Doctor Regarding Any Medical Problem for
FREE atwww.healthcaremagic.com  9AM-9PM "IST(GMT + 5:30)".
Fully Confidential.

OR

You can call at  +91-80-41743045  and "Speak with a Doctor for FREE"
12 Noon to 6 PM  "IST(GMT + 5:30)", Monday to Friday.

Visit www.healthcaremagic.com

Regards,
Dr. Shruti Sharma
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



It May Be Useful For You & Yor Dear Ones !!

2008-05-25 Thread Dr. Rashmi

LIVE CHAT with a Qualified Doctor Regarding Any Medical Problem for
FREE atwww.healthcaremagic.com  9AM-9PM "IST(GMT + 5:30)".
Fully Confidential.

OR

You can call at  +91-80-41743045  and "Speak with a Doctor for FREE"
12 Noon to 6 PM  "IST(GMT + 5:30)", Monday to Friday.

Visit www.healthcaremagic.com

Regards,
Dr. Shruti Sharma
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Adding various user permission to Forms having no models

2008-05-25 Thread Harish

hi friends.

I am doing a project using djangoI created certain forms using
view...
now i want to add user permission to access those forms how i can
do this?

Regards
Harish Bhat


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to Implement "Most Viewed"?

2008-05-25 Thread James Bennett

On Sun, May 25, 2008 at 9:08 PM, jonknee <[EMAIL PROTECTED]> wrote:
> Unless you cache the view. Just update it once an hour/day.

You still have to record the raw number of hits somewhere. Doing this
in the database, in real time, is often not possible because it does
lead to one write per page view.

Periodically crunching server logs is often a better alternative.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Avoiding code duplication with many similar models

2008-05-25 Thread James Bennett

On Sun, May 25, 2008 at 10:13 PM, Trevor Caira <[EMAIL PROTECTED]> wrote:
> So while it is possible to do this with model inheritence, at least
> the most obvious solution involves a lot of code duplication.

A situation like this is often an indicator that you haven't
sufficiently abstracted what the code is doing. Step back a bit and
consider whether that's the case.


-- 
"Bureaucrat Conrad, you are technically correct -- the best kind of correct."

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Avoiding code duplication with many similar models

2008-05-25 Thread Trevor Caira

Thanks for the pointer, Alex. Yes, I have seen that part of the
documentation. Even using model inheritance, however, I still have to
list at a minimum 8 * 12 = 96 different models (8 different versions
of 12 different models). Then, I still must manually specify each
related field, since Django doesn't know that two particular model
subclasses are associated, and can't infer the correct relationship.
There are in total 23 such fields, which means I now must list at
least 96 models (each with a manually specified Meta class listing its
db_table), and 8 * 23 = 184 different related fields.

So while it is possible to do this with model inheritence, at least
the most obvious solution involves a lot of code duplication.

Best,

Trevor Caira

On May 25, 1:12 pm, "Alex Ezell" <[EMAIL PROTECTED]> wrote:
> On Sun, May 25, 2008 at 12:30 AM, Trevor Caira <[EMAIL PROTECTED]> wrote:
> > How can I model this situation most simply, and with the least code
> > duplication, in django?
>
> Hi Trevor,
> Have you looked at the Model Inheritance part of the documentation?
>
> http://www.djangoproject.com/documentation/model-api/#model-inheritance
>
> You could abstract all the common elements into one model (the
> abstract base class) and have the other models subclass that parent.
> They would then contain only the parts of the model that differ from
> model to model.
>
> /alex
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Does anyone use Eric to edit templates

2008-05-25 Thread Alex Ezell

On Sun, May 25, 2008 at 3:04 PM, Gene Campbell <[EMAIL PROTECTED]> wrote:
>
> Do either of these work smartly with Django i.e. Offer command
> completion for the Django tempalte lang or offer look ups in the bound
> dictionaries available in the template -  er, eh, at design time, the
> dictionaries aren't available, so that wouldn't be trivial.  I suppose
> if an IDE managed the whole Django project, it might be
> smart enough.

The Textmate Django templates bundle offers completion for template
tags and some filters. Of course, it's also easily modifiable, so you
could tailor it to your needs. You'll need to be on Mac and buy the
Textmate software (there is a free trial).

I seriously doubt any editor or IDE would be able to tell you what's
in a given object, list, or dictionary when editing a template, given
that most of those values would be coming from a database. If they
were static objects, it might be possible, but it seems a little like
overkill for most developers.

/alex

> On Sun, May 25, 2008 at 10:19 PM, Andre Meyer <[EMAIL PROTECTED]> wrote:
>> On Sun, May 25, 2008 at 12:13 PM, Kenneth Gonsalves <[EMAIL PROTECTED]>
>> wrote:
>>>
>>>
>>> On 25-May-08, at 10:37 AM, Gene Campbell wrote:
>>>
>>> >  If there's something better than
>>> > Eric for templates, can you recommend?
>>
>> Komodo Edit (or IDE)
>> http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml
>>
>>
>> >
>>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Admin panel question

2008-05-25 Thread jonknee

On May 25, 4:46 pm, peter <[EMAIL PROTECTED]> wrote:
> Hello everyone. I've just begin my adventure with Django, and I have
> some problems. I want to add some custom functions to admin site. For
> example, I want to add method from not model class, which sends email
> to specify users, or something similar. Is it possible? Where I can
> find information about it?

The Django Book has a chapter on this:

http://www.djangobook.com/en/1.0/chapter17/

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to Implement "Most Viewed"?

2008-05-25 Thread jonknee

On May 25, 7:54 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote:
> Unless your site is very low traffic the thing you don't want to do is
> write to the database every view.  That is anti-scalable.
>

Unless you cache the view. Just update it once an hour/day.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Problems setting up test Django server

2008-05-25 Thread Graham Dumpleton

Or do what I suggested you do in the first place and use mod_wsgi.

Run your main site in embedded mode and your test site in daemon mode.
This will give you the added advantage that to reload test instance,
just touch WSGI script file, no need to restart whole of Apache.

As well as stuff like SESSION_COOKIE_NAME, ensure you create two
isolated Python virtual environments so each instance is using
completely isolated environments. For Python virtual environments in
mod_wsgi to work properly, you must however not be loading mod_python
into Apache at the same time.

For details see:

  http://code.google.com/p/modwsgi/wiki/ConfigurationGuidelines
  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
  http://code.google.com/p/modwsgi/wiki/VirtualEnvironments
  http://code.google.com/p/modwsgi/wiki/ReloadingSourceCode

Graham

On May 26, 11:36 am, Jason <[EMAIL PROTECTED]> wrote:
> Hi Graham--
>
> Thanks again for trying to talk me through this stuff.  Adding a
> different SESSION_COOKIE_NAME to my test site fixed the problem of
> having to re-login when switching between my active admin site & my
> test admin site.  However, the larger problem remains:  changes made
> to my test site's models are still not propagating to my test site's
> admin pages.  Bear in mind I'm still doing all this w/mod_python, &
> that I have two separate VirtualHosts for my main & test sites.
> Changes made to the main site's models are still regularly & reliably
> showing up in my main site's admin pages.
>
> So I'm flummoxed.  Guess it's a separate test box for me for the time
> being.  Thanks for trying though!
>
> On May 25, 2:34 am, Graham Dumpleton <[EMAIL PROTECTED]>
> wrote:
>
> > On May 25, 9:15 am, Jason <[EMAIL PROTECTED]> wrote:
>
> > > Well, actually things are not so bueno.  Everything's still working
> > > fine w/my my main instance, but any changes I make to models on my
> > > test instance (port 8080, different VirtualHost) are not propagating
> > > reliably-- or at all-- to the test site admin screen.  Have tried
> > > server restarts, syncdb, etc.  Sometimes I can get a minor change to
> > > turn up on the test site's admin, most often not.  Main server admin
> > > screen is not behaving erratically, for whatever reason.
>
> > > Also, the two admin (main & test) screens seem to interfere w/each
> > > other, inasmuch as if I'm logged in to one, I have to re-login to the
> > > other one.
>
> > > Barring someone having any insight here, I guess I should either
> > > investigatemod_wsgifor the test suite, or give up on the idea of
> > > having a test suite on the same box/apache instance-- which would be a
> > > major bummer.
>
> > Ensure you have set SESSION_COOKIE_NAME differently for each Django
> > instance in the settings.py files.
>
> > This is needed because each instance runs under same VirtualHost name.
> > Cookies are not distinguished based on port.
>
> > Look for some comments about this in:
>
> >  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>
> > It was talking about multiple instances mapped at different URL in
> > same virtual host/port number, but same applies if different port
> > number.
>
> > Graham
>
> > > On May 21, 6:14 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > And indeed, throwing in a "PythonInterpreter site" in my port 80
> > > > VirtualHost, & a PythonInterpreter testsite in my port 8080
> > > > VirtualHost solved all my problems.  You guys are the best!
>
> > > > On May 21, 5:54 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > > Awesome!  Thanks for all the advice, guys.  Will try the
> > > > > PythonInterpreter trick & get back to you.
>
> > > > > Just FYI, I'd deliberately ignored that part of the documentation
> > > > > since it specifies:
>
> > > > > "If you need to put two Django installations within the same
> > > > > VirtualHost, you’ll need to take a special precaution to ensure
> > > > > mod_python’s cache doesn’t mess things up. Use the PythonInterpreter
> > > > > directive to give different  directives separate
> > > > > interpreters"
>
> > > > > ...and my two Django installations are very much in different
> > > > > VirtualHosts.  So maybe the docs could use a bit of revision there...?
>
> > > > > Also, I'd very much like to try themod_wsgistuff, so if anyone has a
> > > > > good pointer to docs/tutorials regarding that, I'd appreciate.  Though
> > > > > I suspect I'll have *something* googled w/in minutes of pressing
> > > > > "send" here, so no worries...
>
> > > > > Thanks again!
>
> > > > > On May 21, 4:52 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > > wrote:
>
> > > > > > On May 22, 9:41 am, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > > > > On May 21, 4:17 pm, Jashugan <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > On May 21, 4:10 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > Hey folks--
>
> > > > > > > > > I'm trying to set up a mirror instance of Django on our 
> > > > > > > > > webserver,
> > > > > > > > > having grown tired of br

Re: Problems setting up test Django server

2008-05-25 Thread Jason

Hi Graham--

Thanks again for trying to talk me through this stuff.  Adding a
different SESSION_COOKIE_NAME to my test site fixed the problem of
having to re-login when switching between my active admin site & my
test admin site.  However, the larger problem remains:  changes made
to my test site's models are still not propagating to my test site's
admin pages.  Bear in mind I'm still doing all this w/mod_python, &
that I have two separate VirtualHosts for my main & test sites.
Changes made to the main site's models are still regularly & reliably
showing up in my main site's admin pages.

So I'm flummoxed.  Guess it's a separate test box for me for the time
being.  Thanks for trying though!


On May 25, 2:34 am, Graham Dumpleton <[EMAIL PROTECTED]>
wrote:
> On May 25, 9:15 am, Jason <[EMAIL PROTECTED]> wrote:
>
>
>
> > Well, actually things are not so bueno.  Everything's still working
> > fine w/my my main instance, but any changes I make to models on my
> > test instance (port 8080, different VirtualHost) are not propagating
> > reliably-- or at all-- to the test site admin screen.  Have tried
> > server restarts, syncdb, etc.  Sometimes I can get a minor change to
> > turn up on the test site's admin, most often not.  Main server admin
> > screen is not behaving erratically, for whatever reason.
>
> > Also, the two admin (main & test) screens seem to interfere w/each
> > other, inasmuch as if I'm logged in to one, I have to re-login to the
> > other one.
>
> > Barring someone having any insight here, I guess I should either
> > investigatemod_wsgifor the test suite, or give up on the idea of
> > having a test suite on the same box/apache instance-- which would be a
> > major bummer.
>
> Ensure you have set SESSION_COOKIE_NAME differently for each Django
> instance in the settings.py files.
>
> This is needed because each instance runs under same VirtualHost name.
> Cookies are not distinguished based on port.
>
> Look for some comments about this in:
>
>  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango
>
> It was talking about multiple instances mapped at different URL in
> same virtual host/port number, but same applies if different port
> number.
>
> Graham
>
> > On May 21, 6:14 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > And indeed, throwing in a "PythonInterpreter site" in my port 80
> > > VirtualHost, & a PythonInterpreter testsite in my port 8080
> > > VirtualHost solved all my problems.  You guys are the best!
>
> > > On May 21, 5:54 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > Awesome!  Thanks for all the advice, guys.  Will try the
> > > > PythonInterpreter trick & get back to you.
>
> > > > Just FYI, I'd deliberately ignored that part of the documentation
> > > > since it specifies:
>
> > > > "If you need to put two Django installations within the same
> > > > VirtualHost, you’ll need to take a special precaution to ensure
> > > > mod_python’s cache doesn’t mess things up. Use the PythonInterpreter
> > > > directive to give different  directives separate
> > > > interpreters"
>
> > > > ...and my two Django installations are very much in different
> > > > VirtualHosts.  So maybe the docs could use a bit of revision there...?
>
> > > > Also, I'd very much like to try themod_wsgistuff, so if anyone has a
> > > > good pointer to docs/tutorials regarding that, I'd appreciate.  Though
> > > > I suspect I'll have *something* googled w/in minutes of pressing
> > > > "send" here, so no worries...
>
> > > > Thanks again!
>
> > > > On May 21, 4:52 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > > wrote:
>
> > > > > On May 22, 9:41 am, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > > > On May 21, 4:17 pm, Jashugan <[EMAIL PROTECTED]> wrote:
>
> > > > > > > On May 21, 4:10 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > Hey folks--
>
> > > > > > > > I'm trying to set up a mirror instance of Django on our 
> > > > > > > > webserver,
> > > > > > > > having grown tired of bringing our whole site down every time 
> > > > > > > > I'm
> > > > > > > > debugging new code.
>
> > > > > > > Why aren't you debugging on your local machine?
>
> > > > > > a) thought it would be safer, environment-wise, to actually test on
> > > > > > the same machine, if possible, & b) don't really have a local 
> > > > > > machine
> > > > > > to test on.  Could set up something on my Mac, but that would be
> > > > > > pretty radically different.  Have an Ubuntu-converted PC, but it's
> > > > > > also pretty janky, & setting it up to exactly mirror our remote 
> > > > > > server
> > > > > > would be a daunting proposition.  And basically, I'd just rather do 
> > > > > > it
> > > > > > this way if I could.
>
> > > > > > > > I've got an Apache VirtualHost set up on port 8080 that more or 
> > > > > > > > less
> > > > > > > > mirrors our website.   And I've installed a separate instance of
> > > > > > > > Django to work with it.
>
> > > > > > > Are you listening on both ports? Check httpd.conf and make sure 
> > > > > > > 

Re: 'RegistrationForm' object has no attribute 'cleaned_data'

2008-05-25 Thread Russell Keith-Magee

On Mon, May 26, 2008 at 7:56 AM, cyrial <[EMAIL PROTECTED]> wrote:
>
> Hey,
>
> when testing my RegistrationForm on localhost, the following error is
> raised:
>
>AttributeError at /accounts/register/
>'RegistrationForm' object has no attribute 'cleaned_data'

It's difficult to tell what's going on without a full stack trace, but
I'm guessing it's one of two things:

1) You're using an old version of Django (0.96, or a very old SVN
checkout). In older releases, cleaned_data was called clean_data.

2) Your form hasn't validated. cleaned_data is only available if no
validation errors are found during form processing. If a validation
error is found in a specific field, that field will be removed from
the clean data dictionary; if a form-level validation error is found,
the full cleaned_data dictionary will be deleted.

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?hl=en
-~--~~~~--~~--~--~---



'RegistrationForm' object has no attribute 'cleaned_data'

2008-05-25 Thread cyrial

Hey,

when testing my RegistrationForm on localhost, the following error is
raised:

AttributeError at /accounts/register/
'RegistrationForm' object has no attribute 'cleaned_data'

See code @ http://dpaste.com/52693/

Could someone please give me a hint what's wrong in this code?

Thanks in advance,
cyrial
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to Implement "Most Viewed"?

2008-05-25 Thread Norman Harman

blis102 wrote:
> Hello All,
> 
> Im wondering how I could go about implementing a "Most Viewed" feature
> on my site. Lets say I have events, articles, and businesses, how
> could I implement a "Most Viewed Businesses", "Most Viewed Articles",
> "Most Viewed Events", "Most Viewed Content", "Most Viewed Articles
> This Week", etc...? Should I build a model for views and make it a
> foreign key to each model I want to record views for? Should I make a
> middleware? What else could I do?
> 
> Im not really sure what would be best practice in this regard. Im sure
> there are a few different ways to implement this, but what is the
> simplest and most scalable? Any other ideas or suggestions?

Simplest and scalable aren't often achievable in the same sentence.

Unless your site is very low traffic the thing you don't want to do is 
write to the database every view.  That is anti-scalable.

For one project in the past a coworker came up with this:
write log files to a ramdisk, one line per view(fast + simple). A cron 
job slurped the files, did unique views logic, other stuff and updated a 
times_viewed field in the models.

Scaling that to more than one machine adds complexity.  I'd probably 
pursue a different solution when/if traffic warranted it.


-- 
Norman J. Harman Jr.  512 912-5939
Technology Solutions Group, Austin American-Statesman
___
You've got fun!  Check out Austin360.com for all the entertainment
info you need to live it up in the big city!

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



blankiing an ImageField

2008-05-25 Thread Carl Karsten

In the admin UI, is there any way to blank out a  foo = model.ImageField(...) ?

Carl K

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Yet another "social network" help needed

2008-05-25 Thread Pavel Rebrov

Hello everyone,

I want to build sort of a multi-user blog system with some "community-
building" features. Right now I see it as a set of applications as
such:
- News. RSS-aggregated, manually translated and republished on the
site "Industry News" section
- Blog. Each user will have a blog of one's own and there will be one
"main" blog built of users' "featured" posts.
- Profile. The perfect thing to do is provide each user is a subdomain
profile page, which should also be used as squidoo-kind of lense or a
mashup of some user's details, one's own blog posts and some external
feeds.
- Forum. Just a basic forum application, but I'm thinking of a feature
of creating a forum topic related to a certain news article or blog
post.
- Job board. Pretty straight forward here.
- Event management. A site-wide calendar of events which every user
should be able to "attend" (tick an "I'll be there" button) and, of
course, add events to. This, indeed, must also provide an iCal feed.
- Rating. Ideally I need a rating system so only authoritative and
respectful authors get their "featured" posts on the main page. Thus
posts and comments need to be rated.

I'm a Django noob and, basically, haven't been developing for years
now, but do have a general understanding of the way things work inside
the Web :)

What are the applications available I might use to ease up the task? I
see django-registration, django-profile and django-tagging as the
required ones. What about subdomains? django-accounts seems to handle
that, but how does that live together with django-profile?

Speaking of other applications, is it worth building a blog and forum
from scratch or would be just easier to get coltrane to handle multi-
user blog and django-forum to start with the forum development? I
realise that job board and event subsystem aren't available out-of-the-
box to start with, but they aren't a top priority at the moment and by
the time I get to them I hope do learn enough to stop asking stupid
questions :)

Rating is something I don't yet understand how to achieve.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: setup issues with Django

2008-05-25 Thread James Matthews
It looks nice. I am going to try it out

On Sun, May 25, 2008 at 7:01 PM, Joseph <[EMAIL PROTECTED]> wrote:

>
> There is instant Django: http://www.instantdjango.com/download.html
> No install. Just unzip and it works well. then you can update your
> copy of Django as well. Works well for me.
>
> Joseph
> http://www.jjude.com
>
> On May 25, 6:35 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> > On Sun, May 25, 2008 at 8:43 AM, wheresdave <[EMAIL PROTECTED]>
> wrote:
> >
> > > I have been trying to setup django on a windows XP machine for almost
> > > 4 hours now. Each step of the way I run into a new error that I have
> > > to find a workaround for, which is very unfortunate.
> >
> > > I have django 0.96.2 in my site-packages directory, and python is on
> > > the root of C. I have also added python to my path per instructions i
> > > found on another site, and python shell is now working fine.
> >
> > > Now, when I try to run django-admin.py startproject mysite i get the
> > > following error
> >
> > > ImportError: No module named django.core
> >
> > That would mean Django is not properly installed in your Python's
> > site-packages directory.  If it were there, the import of django.core
> would
> > work.  What, exactly, do you have under
> c:\Python\Lib\site-packages\django?
> > You should have subdirectories named bin, conf, contrib, core, etc -- a
> > total of 19 subdirectories and an __init__.py file.
> >
> > I ran many google searches on this error and none of the docs came
> >
> > > back with anything useful to solve my challenge.
> >
> > > I went to the IRC forums and they told me that Django is not on my
> > > path. Well, i had already tried adding to my path per the same
> > > instructions provided for adding python to your path, and the same
> > > error persisted.
> >
> > An alternative way to run things is to not put Django in your
> site-packages
> > directory, but rather include it on you PYTHONPATH (not PATH) environment
> > variable.  It sounds like this is what people were suggesting.  But, if
> > you've put it in site-packages then this is not necessary, better to
> figure
> > out what is wrong with your site-packages installation.
> >
> > I was then told to install SVN and pull from the trunk. I do not feel
> >
> > > that is a valid workaround, because honestly i do not feel it will
> > > solve the problem.
> >
> > Well, the SVN version has over a years worth of improvements and bug
> fixes
> > compared tot he 0.96 release, which has only a couple of security fixes
> that
> > have been applied since its release.  Some of those fixes were to the
> > setup.py install script, and for Windows specifically, but if you really
> > want to stick with 0.96.2 it can be made to work.  Personally, though, I
> too
> > would recommend SVN over the old release, just in general.
> >
> > Karen
> >
>


-- 
http://search.goldwatches.com/?Search=Movado+Watches
http://www.jewelerslounge.com
http://www.goldwatches.com/mens/

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Admin panel question

2008-05-25 Thread peter

Hello everyone. I've just begin my adventure with Django, and I have
some problems. I want to add some custom functions to admin site. For
example, I want to add method from not model class, which sends email
to specify users, or something similar. Is it possible? Where I can
find information about it?
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Fwd: Does anyone use Eric to edit templates

2008-05-25 Thread Gene Campbell

Do either of these work smartly with Django i.e. Offer command
completion for the Django tempalte lang or offer look ups in the bound
dictionaries available in the template -  er, eh, at design time, the
dictionaries aren't available, so that wouldn't be trivial.  I suppose
if an IDE managed the whole Django project, it might be
smart enough.



On Sun, May 25, 2008 at 10:19 PM, Andre Meyer <[EMAIL PROTECTED]> wrote:
> On Sun, May 25, 2008 at 12:13 PM, Kenneth Gonsalves <[EMAIL PROTECTED]>
> wrote:
>>
>>
>> On 25-May-08, at 10:37 AM, Gene Campbell wrote:
>>
>> >  If there's something better than
>> > Eric for templates, can you recommend?
>
> Komodo Edit (or IDE)
> http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml
>
>
> >
>

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: How to Implement "Most Viewed"?

2008-05-25 Thread Justin Lilly
I know several people who have implemented this feature tend to do so by
interfacing with their traffic reporting API. Perhaps you can tap into
google analytics (or whatever you use) to achieve the same?
 -justin

On Sun, May 25, 2008 at 3:20 PM, blis102 <[EMAIL PROTECTED]> wrote:

>
> Hello All,
>
> Im wondering how I could go about implementing a "Most Viewed" feature
> on my site. Lets say I have events, articles, and businesses, how
> could I implement a "Most Viewed Businesses", "Most Viewed Articles",
> "Most Viewed Events", "Most Viewed Content", "Most Viewed Articles
> This Week", etc...? Should I build a model for views and make it a
> foreign key to each model I want to record views for? Should I make a
> middleware? What else could I do?
>
> Im not really sure what would be best practice in this regard. Im sure
> there are a few different ways to implement this, but what is the
> simplest and most scalable? Any other ideas or suggestions?
>
> Thanks Alot,
> Dana
> >
>


-- 
Justin Lilly
Web Developer/Designer
http://justinlilly.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?hl=en
-~--~~~~--~~--~--~---



How to Implement "Most Viewed"?

2008-05-25 Thread blis102

Hello All,

Im wondering how I could go about implementing a "Most Viewed" feature
on my site. Lets say I have events, articles, and businesses, how
could I implement a "Most Viewed Businesses", "Most Viewed Articles",
"Most Viewed Events", "Most Viewed Content", "Most Viewed Articles
This Week", etc...? Should I build a model for views and make it a
foreign key to each model I want to record views for? Should I make a
middleware? What else could I do?

Im not really sure what would be best practice in this regard. Im sure
there are a few different ways to implement this, but what is the
simplest and most scalable? Any other ideas or suggestions?

Thanks Alot,
Dana
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Having a instance of a model object instantiate another

2008-05-25 Thread Diego Ucha

John,

If you don't have to fill any of Checkbox's fields (attended,
was_drunk, silly_walk, naughty or been_seen), then i don't think you
have to create an instance of it bounded with an Event. Create it when
you have one of these fields. This way if you want to get a real
statistic of how many Checkboxes exist, for example, it will be much
more easier.
What do you think?

[]s
Diego Ucha

On Apr 25, 7:27 pm, jrmorrisnc <[EMAIL PROTECTED]> wrote:
> So, I have it doing what I want now:
>
> 
>  class Event(models.Model):
> date = models.DateTimeField()
> description = models.TextField()
>
> def __init__(self, *args, **kwargs):
> models.Model.__init__(self, *args, **kwargs)
> self.checklist = CheckList(self.id)
> self.checklist.save()
>
> def __str__(self):
> return self.date
>
> class Admin:pass
>
> class CheckList(models.Model):
>event = models.OneToOneField(Event)
>attended = models.BooleanField()
>was_drunk = models.BooleanField()
>silly_walk = models.BooleanField()
>naughty = models.BooleanField()
>been_seen = models.BooleanField()
>
>def __str__(self):
> return 'Event checklist for ' + self.event.name
>
> 
>
> When I create an Event, it creates related instance of CheckList and
> should share the same pk, which is currently how one-to-ones are
> handled in Django.
> If/when that changes I will have to either shift to managing one set
> of pk's myself, or both, or adapt (potentially) to the new way, I
> think.
>
> Anyone have any thoughts or suggestions? Is this likely to blow up, or
> a generally bad way of doing things? I was trying to assert that for
> each instance of Event there must be a corresponding instance of
> CheckList at the lowest level possible, make it part of the init of
> the object in question.
>
> Thanks!
>
> On Apr 24, 8:02 pm, jrmorrisnc <[EMAIL PROTECTED]> wrote:
>
> > So, after re-reading the related_name / related_objects documentation
> > I've dealt with my lack of understand on properly getting __str__
> > method to return what I want, I thnk.
>
> > And the other part, creating an instance of CheckList whenever an
> > Event is created should be easy, too.
>
> > Just wasn't looking at the first part in the right way.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: auto_add or default or save?

2008-05-25 Thread Alex Ezell

On Sun, May 25, 2008 at 3:15 AM, Rob Hudson <[EMAIL PROTECTED]> wrote:
>
> I don't recall where, but I thought I had heard once that the auto_add
> and auto_add_now options to date fields in models was going away.
>
> I've seen 2 main options in the wild and I'm not sure which is
> preferred... I suppose each has its own use case:
>
> 1) Add default=datetime.now to the field.  This seems to provide a
> pre-save setting of a date that shows up in the admin and can be
> changed prior to saving.  Looks like it's good for a created date
> field if you're ok with the idea that you can change it in the admin.
>
> 2) Override save and set the field prior to saving.  This seems like
> it's good for an 'updated' date field that automatically updates every
> time it's saved.
>
> Are those breakdowns accurate?  Is the auto_now_* stuff really going
> away?  And if so, could the docs be updated to reflect that?  Are
> there other ways to get 'created' and 'updated' functionality?

Rob,
I've done my models exactly as you have described and it's worked
flawlessly so far. FWIW.

/alex

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Avoiding code duplication with many similar models

2008-05-25 Thread Alex Ezell

On Sun, May 25, 2008 at 12:30 AM, Trevor Caira <[EMAIL PROTECTED]> wrote:
> How can I model this situation most simply, and with the least code
> duplication, in django?

Hi Trevor,
Have you looked at the Model Inheritance part of the documentation?

http://www.djangoproject.com/documentation/model-api/#model-inheritance

You could abstract all the common elements into one model (the
abstract base class) and have the other models subclass that parent.
They would then contain only the parts of the model that differ from
model to model.

/alex

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: ForeignKey, but not...

2008-05-25 Thread Peter Rowell

Thoughts, in no particular order:

1. What about your app is dependent on the uid/User? I.e., At what
points in the app's use does the uid come into play?
2. Since there is a uid, where is it coming from? UNIX uid? Some other
forum id?
3. Are there events in the life of a uid/User (creation, modification,
destruction) that you have to respond to (or which are already being
responded to on your behalf by the django User model)?

Since you don't want to change your app, maybe you can create your own
User model that supplies enough of the same functionality that your
app can't tell the difference. This might require creating another
model/table, but I think you can create a custom manager that will
fake enough stuff to make things work. If you go this route, all
you'll need to change is the import of User into your models.py file.

Just some thoughts.

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: setup issues with Django

2008-05-25 Thread Joseph

There is instant Django: http://www.instantdjango.com/download.html
No install. Just unzip and it works well. then you can update your
copy of Django as well. Works well for me.

Joseph
http://www.jjude.com

On May 25, 6:35 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Sun, May 25, 2008 at 8:43 AM, wheresdave <[EMAIL PROTECTED]> wrote:
>
> > I have been trying to setup django on a windows XP machine for almost
> > 4 hours now. Each step of the way I run into a new error that I have
> > to find a workaround for, which is very unfortunate.
>
> > I have django 0.96.2 in my site-packages directory, and python is on
> > the root of C. I have also added python to my path per instructions i
> > found on another site, and python shell is now working fine.
>
> > Now, when I try to run django-admin.py startproject mysite i get the
> > following error
>
> > ImportError: No module named django.core
>
> That would mean Django is not properly installed in your Python's
> site-packages directory.  If it were there, the import of django.core would
> work.  What, exactly, do you have under c:\Python\Lib\site-packages\django?
> You should have subdirectories named bin, conf, contrib, core, etc -- a
> total of 19 subdirectories and an __init__.py file.
>
> I ran many google searches on this error and none of the docs came
>
> > back with anything useful to solve my challenge.
>
> > I went to the IRC forums and they told me that Django is not on my
> > path. Well, i had already tried adding to my path per the same
> > instructions provided for adding python to your path, and the same
> > error persisted.
>
> An alternative way to run things is to not put Django in your site-packages
> directory, but rather include it on you PYTHONPATH (not PATH) environment
> variable.  It sounds like this is what people were suggesting.  But, if
> you've put it in site-packages then this is not necessary, better to figure
> out what is wrong with your site-packages installation.
>
> I was then told to install SVN and pull from the trunk. I do not feel
>
> > that is a valid workaround, because honestly i do not feel it will
> > solve the problem.
>
> Well, the SVN version has over a years worth of improvements and bug fixes
> compared tot he 0.96 release, which has only a couple of security fixes that
> have been applied since its release.  Some of those fixes were to the
> setup.py install script, and for Windows specifically, but if you really
> want to stick with 0.96.2 it can be made to work.  Personally, though, I too
> would recommend SVN over the old release, just in general.
>
> Karen
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



template translation

2008-05-25 Thread Thierry

The current template tag implementation for i18n seems a bit
cumbersome and looks like it makes the template code harder to
maintain.
Would it be possible to code the translation logic in the template
parser?

Automatically extract all strings in the template code which could be
translated (text between html elements, some attributes like title and
alt)
Run it through gettext and store a translated version in cache.


Well there must be some difficulties with this :)
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Generic ManyToMany - any code?

2008-05-25 Thread kbs

Assuming you are using the development version of django (trunk)
For the asset problem that was described, model inherentence can be
used.
Asset would be base class, and all asset types should inheret from it
Process would simply hold a m2m reference to the base Asset model

http://www.djangoproject.com/documentation/model-api/#model-inheritance

I am not sure how much control you have over it in current admin, but
maybe newform admin branch would give you the needed control? I am
sure soeone can elaborate

- kbs

On May 25, 7:01 am, Itai Tavor <[EMAIL PROTECTED]> wrote:
> Thanks, Richard - I thought about doing it this way, but I don't see  
> how it could be integrated nicely into an admin form... you either  
> have to create an Asset object for every new asset object, or you  
> don't get the full list of possible assets in the Process admin form.  
> I also don't like that a different Asset model would be required for  
> every unique set of selectable content types (of which I have at least  
> 3).
>
> I know a GenericM2M can be done... possibly it's not even very hard.  
> It's just that those RelatedObjectsDescriptors and  
> ReverseRelatedObjectsDescriptors give me a headache, and I don't  
> really understand how M2M works anyway (where is the code that creates  
> the m2m table?) so I can't tackle it myself.
>
> Itai
>
> On 25/05/2008, at 2:31 AM, Richard Dahl wrote:
>
>
>
>
>
> > Not sure if there is a better way (suggestions are appreciated), but I
> > just use the GenericForeignKey i.e.:
>
> > class Asset(models.Model):
> >     content_type = models.ForeignKey(AssetType)
> >     object_id = models.PositiveIntegerField()
> >     content_object = generic.GenericForeignKey('content_type',
> > 'object_id')
>
> > class Process(models.Model):
> >    [...] # irrelevant fields stripped
> >            assets = models.ManyToManyField(Asset)
>
> > I also use this to be able to limit what type of model can be related
> > in a generic way.  I have a small subset of my total models that are
> > considered 'assets' (device, location, organization, etc...) The
> > AssetType table allows me to specify which of my models are considered
> > 'assets' . (This could probably be done with 'choices' within the
> > 'Asset' model, but I like the flexibility of another table.)
>
> > class AssetType(models.Model):
> >     type = models.ForeignKey(ContentType, unique=True)
>
> >     def __unicode__(self):
> >         return ('%s' % (self.type.__unicode__().capitalize()))
>
> > HTH,
> > -richard
>
> > On May 24, 2008, at 2:55 AM, Itai Tavor wrote:
>
> >> Hi,
>
> >> There was some talk about creating generic M2M fields around the end
> >> of '07, but I can't find any useful code. Has anyone got this  
> >> working?
>
> >> Thanks, Itai- Hide quoted text -
>
> - Show quoted text -
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



a problem with Django development server

2008-05-25 Thread jinhao

well,first,my english is poor.sorry!!
i find a problem with Django development server,when I use newforms or
modelform to output textarea,if this textarea filled too many
words,and submit to Django development server with POST method.
in firefox, it is always normal,but in IE7,the content in textarea can
insert into database, but in browser i get a response just like the
url visited a non-exist website ,(not django's friendly 404 error when
set debug true).

when use django with apache,it is normal in IE7, so i think ti is a
problem with Django development server.

someone can explain it or solve this problem?
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: setup issues with Django

2008-05-25 Thread Karen Tracey
On Sun, May 25, 2008 at 8:43 AM, wheresdave <[EMAIL PROTECTED]> wrote:

>
> I have been trying to setup django on a windows XP machine for almost
> 4 hours now. Each step of the way I run into a new error that I have
> to find a workaround for, which is very unfortunate.
>
> I have django 0.96.2 in my site-packages directory, and python is on
> the root of C. I have also added python to my path per instructions i
> found on another site, and python shell is now working fine.
>
> Now, when I try to run django-admin.py startproject mysite i get the
> following error
>
> ImportError: No module named django.core
>

That would mean Django is not properly installed in your Python's
site-packages directory.  If it were there, the import of django.core would
work.  What, exactly, do you have under c:\Python\Lib\site-packages\django?
You should have subdirectories named bin, conf, contrib, core, etc -- a
total of 19 subdirectories and an __init__.py file.

I ran many google searches on this error and none of the docs came
> back with anything useful to solve my challenge.
>
> I went to the IRC forums and they told me that Django is not on my
> path. Well, i had already tried adding to my path per the same
> instructions provided for adding python to your path, and the same
> error persisted.
>

An alternative way to run things is to not put Django in your site-packages
directory, but rather include it on you PYTHONPATH (not PATH) environment
variable.  It sounds like this is what people were suggesting.  But, if
you've put it in site-packages then this is not necessary, better to figure
out what is wrong with your site-packages installation.

I was then told to install SVN and pull from the trunk. I do not feel
> that is a valid workaround, because honestly i do not feel it will
> solve the problem.
>

Well, the SVN version has over a years worth of improvements and bug fixes
compared tot he 0.96 release, which has only a couple of security fixes that
have been applied since its release.  Some of those fixes were to the
setup.py install script, and for Windows specifically, but if you really
want to stick with 0.96.2 it can be made to work.  Personally, though, I too
would recommend SVN over the old release, just in general.

Karen

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: setup issues with Django

2008-05-25 Thread Tim Chase

> ImportError: No module named django.core
> 
> I ran many google searches on this error and none of the docs came
> back with anything useful to solve my challenge.
> 
> I went to the IRC forums and they told me that Django is not on my
> path. Well, i had already tried adding to my path per the same
> instructions provided for adding python to your path, and the same
> error persisted.


You're close.  There are two different paths:  there's %PATH% 
which is a system variable that tells Windows where to look for 
executables; and there's %PYTHONPATH% which tells Python where to 
look for modules.  You've correctly set %PATH% to point to Python 
which it seems to successfully be finding, but your PYTHONPATH 
isn't set correctly.  As a test, at the command-line, type

   c:\proj\>set PYTHONPATH=c:\path\to\django
   c:\proj\>python manage.py runserver

and see if that does the trick.  If so, you can use the 
Environment Variables window on your System Properties (where you 
likely changed your PATH variable) to create a new env. variable 
for PYTHONPATH and point it to the Django directory (and possibly 
include your project directory as well).

-tim



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Django with non-SQL databases?

2008-05-25 Thread Phillip B Oldham

Has anyone used django (including its ORM system) with a non-sql db?
I'd be interested in learning how django was modified to get the best
fit.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



setup issues with Django

2008-05-25 Thread wheresdave

I have been trying to setup django on a windows XP machine for almost
4 hours now. Each step of the way I run into a new error that I have
to find a workaround for, which is very unfortunate.

I have django 0.96.2 in my site-packages directory, and python is on
the root of C. I have also added python to my path per instructions i
found on another site, and python shell is now working fine.

Now, when I try to run django-admin.py startproject mysite i get the
following error

ImportError: No module named django.core

I ran many google searches on this error and none of the docs came
back with anything useful to solve my challenge.

I went to the IRC forums and they told me that Django is not on my
path. Well, i had already tried adding to my path per the same
instructions provided for adding python to your path, and the same
error persisted.

I was then told to install SVN and pull from the trunk. I do not feel
that is a valid workaround, because honestly i do not feel it will
solve the problem.

Does anyone have any advice etc on how to resolve this issue? I have
been trying on and off to use Django for over a year and have yet to
get it working completely. I do understand that it is in pre release
stage or whatever, but honestly is it that hard to get an easy to
follow tutorial or something together that actually works for windows
(and instant rails for django would be nice)? I have seen alot of easy
to follow tutorials for windows, but none of them work completely.

Thank you in advance if you have a solution.

Dave
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: FileField ImageField upload questions

2008-05-25 Thread patrickk

did you take a look at the django filebrowser:
http://code.google.com/p/django-filebrowser/

patrick.

On May 24, 7:13 pm, poschs <[EMAIL PROTECTED]> wrote:
> > 1. I cant edit the ImageField by hand - e.g. If it currently contains
> > 'images\fam1.jpg' I cannot manually type in images\fam2.jpg and have
> > it accept it.
> >> I don't follow what you're trying to do here. Does this "fam2.jpg"
> >> exist on your computer?
>
> My goal is to be able to simply choose files that already exist on the
> server. I was thinking I could do that by just editing the string in
> place rather than picking a new file that would be uploaded.
>
> BTW, I solved this a different way by having an 'images' model that
> other models can refer to.
>
> > The documentation is also an excellent place to look for things like this.
>
> I looked everywhere before I posted here :)
>
> Thank you Marty for taking the time to reply. It was very helpful.
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Free Free US Dollars dollaras per month 10.000 $$$$$$$ Free Free

2008-05-25 Thread cshmn02

You Have Finally Found It. Genuine Lifetime Income!! Earn!! =10,000 US
Dollars per month without Investment By working only one hour per day
from the cyber café or PC  Guaranteed Earnings for Lifetime!!

http://seniorfriendfinder.com/go/g970599-pmem

http://moreinfo247.com/9509568/CB
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Many to Many field and the template

2008-05-25 Thread Eric Abrahamsen

Double curly brackets {{ }} are used for variable substitution. These  
brackets: {% %} are used for template tags, of which the for loop is  
one. So you want:
{% for et in entity.entity_type.all %}

Yours,
Eric


On May 25, 2008, at 6:59 PM, M.Ganesh wrote:

>
> Hi All,
>
> Unable to find a relevent info in the mail archives/ documentation.  
> I am
> getting this error :
>
> TemplateSyntaxError at /contacts/entity/8/show/
> Could not parse the remainder: ' et in entity.entity_type.all' from  
> 'for
> et in entity.entity_type.all'
>
> #my model
> class entity(models.Model):
>name = models.CharField(max_length=25, unique=True, db_index=True)
>full_name = models.CharField(max_length=100)
>entity_type = models.ManyToManyField(entity_type, blank=True)
>
>def __unicode__(self):
>return self.name
>
>class Admin:
>list_display = ('name', 'full_name')
>
>class Meta:
>ordering = ["name"]
>app_label = 'contacts'
>
>
> class entity_type(models.Model):
>name = models.CharField(max_length=50)
>
>def __unicode__(self):
>return self.name
>
>class Admin:
>pass
>
>class Meta:
>ordering = ["name"]
>app_label = 'contacts'
>
> #my template_snippet
>{{ entity.name }}
>{{ entity.full_name }}
>{{entity.entity_type.count }}
>{{ for et in entity.entity_type.all }}< {{ for et in
> entity.entity_type_set.all }} also doesn't work
>{{ et.name }}
>{{ endfor}}
>
> How do I get a list of entity_type given a entity instance?
>
> Thanks in advance
>
> Regards Ganesh
>
>
> >


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Generic ManyToMany - any code?

2008-05-25 Thread Itai Tavor

Thanks, Richard - I thought about doing it this way, but I don't see  
how it could be integrated nicely into an admin form... you either  
have to create an Asset object for every new asset object, or you  
don't get the full list of possible assets in the Process admin form.  
I also don't like that a different Asset model would be required for  
every unique set of selectable content types (of which I have at least  
3).

I know a GenericM2M can be done... possibly it's not even very hard.  
It's just that those RelatedObjectsDescriptors and  
ReverseRelatedObjectsDescriptors give me a headache, and I don't  
really understand how M2M works anyway (where is the code that creates  
the m2m table?) so I can't tackle it myself.

Itai


On 25/05/2008, at 2:31 AM, Richard Dahl wrote:

>
> Not sure if there is a better way (suggestions are appreciated), but I
> just use the GenericForeignKey i.e.:
>
> class Asset(models.Model):
> content_type = models.ForeignKey(AssetType)
> object_id = models.PositiveIntegerField()
> content_object = generic.GenericForeignKey('content_type',
> 'object_id')
>
> class Process(models.Model):
>   [...] # irrelevant fields stripped
>   assets = models.ManyToManyField(Asset)
>
> I also use this to be able to limit what type of model can be related
> in a generic way.  I have a small subset of my total models that are
> considered 'assets' (device, location, organization, etc...) The
> AssetType table allows me to specify which of my models are considered
> 'assets' . (This could probably be done with 'choices' within the
> 'Asset' model, but I like the flexibility of another table.)
>
> class AssetType(models.Model):
> type = models.ForeignKey(ContentType, unique=True)
>
> def __unicode__(self):
> return ('%s' % (self.type.__unicode__().capitalize()))
>
> HTH,
> -richard
>
>
>
> On May 24, 2008, at 2:55 AM, Itai Tavor wrote:
>
>>
>> Hi,
>>
>> There was some talk about creating generic M2M fields around the end
>> of '07, but I can't find any useful code. Has anyone got this  
>> working?
>>
>> Thanks, Itai
>>
>>
>>>
>
>
> >


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Many to Many field and the template

2008-05-25 Thread M.Ganesh

Hi All,

Unable to find a relevent info in the mail archives/ documentation. I am 
getting this error :

TemplateSyntaxError at /contacts/entity/8/show/
Could not parse the remainder: ' et in entity.entity_type.all' from 'for 
et in entity.entity_type.all'

#my model
class entity(models.Model):
name = models.CharField(max_length=25, unique=True, db_index=True)
full_name = models.CharField(max_length=100)
entity_type = models.ManyToManyField(entity_type, blank=True)

def __unicode__(self):
return self.name

class Admin:   
list_display = ('name', 'full_name')
   
class Meta:
ordering = ["name"]
app_label = 'contacts'


class entity_type(models.Model):
name = models.CharField(max_length=50)

def __unicode__(self):
return self.name

class Admin:
pass

class Meta:
ordering = ["name"]
app_label = 'contacts'

#my template_snippet
{{ entity.name }}
{{ entity.full_name }}
{{entity.entity_type.count }}
{{ for et in entity.entity_type.all }}< {{ for et in 
entity.entity_type_set.all }} also doesn't work
{{ et.name }}
{{ endfor}}
   
How do I get a list of entity_type given a entity instance?

Thanks in advance

Regards Ganesh


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: a problem with djikiki

2008-05-25 Thread J. Clifford Dyer

That might be a problem with your urls.py file.  An extra comma
somewhere, perhaps.

Also, what version of django are you using?

Cheers,
Cliff


On Sat, 2008-05-24 at 06:53 -0700, Qiang wrote:
> anyone have used the djikiki,a django wiki engine?
> i want to write a wiki engine with django like the djikiki.i installed
> the Djikiki.but i encounter a problem.
> i execute manage.py runserver there is no error.then i check the
> http://127.0.0.1:8000/admin. the django give me a trackback like this
> below. i want konw what wrong with it? how can i fix it? thanks
> 
> 
> TypeError at /admin/
> __init__() takes at most 4 arguments (5 given)
> Request Method:   GET
> Request URL:  http://127.0.0.1:8000/admin/
> Exception Type:   TypeError
> Exception Value:  __init__() takes at most 4 arguments (5 given)
> Exception Location:   D:\Python\Lib\site-packages\django\conf\urls
> \defaults.py in patterns, line 18
> > 


--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Does anyone use Eric to edit templates

2008-05-25 Thread Andre Meyer
On Sun, May 25, 2008 at 12:13 PM, Kenneth Gonsalves <[EMAIL PROTECTED]>
wrote:

>
>
> On 25-May-08, at 10:37 AM, Gene Campbell wrote:
>
> >  If there's something better than
> > Eric for templates, can you recommend?
>

Komodo Edit (or IDE)
http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Does anyone use Eric to edit templates

2008-05-25 Thread Kenneth Gonsalves


On 25-May-08, at 10:37 AM, Gene Campbell wrote:

>  If there's something better than
> Eric for templates, can you recommend?

quanta

-- 

regards
kg
http://lawgon.livejournal.com
http://nrcfosshelpline.in/code/




--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Free hosting!!!!

2008-05-25 Thread Penguin

http://www.ziddu.com/register.php?referralid=(yoRfizI}X
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: Problems setting up test Django server

2008-05-25 Thread Graham Dumpleton

On May 25, 9:15 am, Jason <[EMAIL PROTECTED]> wrote:
> Well, actually things are not so bueno.  Everything's still working
> fine w/my my main instance, but any changes I make to models on my
> test instance (port 8080, different VirtualHost) are not propagating
> reliably-- or at all-- to the test site admin screen.  Have tried
> server restarts, syncdb, etc.  Sometimes I can get a minor change to
> turn up on the test site's admin, most often not.  Main server admin
> screen is not behaving erratically, for whatever reason.
>
> Also, the two admin (main & test) screens seem to interfere w/each
> other, inasmuch as if I'm logged in to one, I have to re-login to the
> other one.
>
> Barring someone having any insight here, I guess I should either
> investigatemod_wsgifor the test suite, or give up on the idea of
> having a test suite on the same box/apache instance-- which would be a
> major bummer.

Ensure you have set SESSION_COOKIE_NAME differently for each Django
instance in the settings.py files.

This is needed because each instance runs under same VirtualHost name.
Cookies are not distinguished based on port.

Look for some comments about this in:

  http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

It was talking about multiple instances mapped at different URL in
same virtual host/port number, but same applies if different port
number.

Graham

> On May 21, 6:14 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > And indeed, throwing in a "PythonInterpreter site" in my port 80
> > VirtualHost, & a PythonInterpreter testsite in my port 8080
> > VirtualHost solved all my problems.  You guys are the best!
>
> > On May 21, 5:54 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > Awesome!  Thanks for all the advice, guys.  Will try the
> > > PythonInterpreter trick & get back to you.
>
> > > Just FYI, I'd deliberately ignored that part of the documentation
> > > since it specifies:
>
> > > "If you need to put two Django installations within the same
> > > VirtualHost, you’ll need to take a special precaution to ensure
> > > mod_python’s cache doesn’t mess things up. Use the PythonInterpreter
> > > directive to give different  directives separate
> > > interpreters"
>
> > > ...and my two Django installations are very much in different
> > > VirtualHosts.  So maybe the docs could use a bit of revision there...?
>
> > > Also, I'd very much like to try themod_wsgistuff, so if anyone has a
> > > good pointer to docs/tutorials regarding that, I'd appreciate.  Though
> > > I suspect I'll have *something* googled w/in minutes of pressing
> > > "send" here, so no worries...
>
> > > Thanks again!
>
> > > On May 21, 4:52 pm, Graham Dumpleton <[EMAIL PROTECTED]>
> > > wrote:
>
> > > > On May 22, 9:41 am, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > > On May 21, 4:17 pm, Jashugan <[EMAIL PROTECTED]> wrote:
>
> > > > > > On May 21, 4:10 pm, Jason <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Hey folks--
>
> > > > > > > I'm trying to set up a mirror instance of Django on our webserver,
> > > > > > > having grown tired of bringing our whole site down every time I'm
> > > > > > > debugging new code.
>
> > > > > > Why aren't you debugging on your local machine?
>
> > > > > a) thought it would be safer, environment-wise, to actually test on
> > > > > the same machine, if possible, & b) don't really have a local machine
> > > > > to test on.  Could set up something on my Mac, but that would be
> > > > > pretty radically different.  Have an Ubuntu-converted PC, but it's
> > > > > also pretty janky, & setting it up to exactly mirror our remote server
> > > > > would be a daunting proposition.  And basically, I'd just rather do it
> > > > > this way if I could.
>
> > > > > > > I've got an Apache VirtualHost set up on port 8080 that more or 
> > > > > > > less
> > > > > > > mirrors our website.   And I've installed a separate instance of
> > > > > > > Django to work with it.
>
> > > > > > Are you listening on both ports? Check httpd.conf and make sure it 
> > > > > > has
> > > > > > something like this:
>
> > > > > > Listen 80
> > > > > > Listen 8080
>
> > > > > Oh yeah, that's all taken care of.  The "test site" is working fine on
> > > > > port 8080, separate from the regular port 80 site.  My problem is that
> > > > > if I change the Django settings exclusively on the port 8080
> > > > > VirtualHost (as per my last post), it also changes my main sites
> > > > > settings & throws me into the empty new Django install.  Hope that's
> > > > > clear...?
>
> > > > In mod_python, a single Python interpreter instance is used for a
> > > > virtual host. This doesn't take into consideration the port number. As
> > > > such, you would be sharing the same Python interpreter for all Django
> > > > instances on the same virtual host.
>
> > > > To avoid this, use the PythonInterpreter directive from mod_python to
> > > > designate that each instance should run in a separate interpreter.
>
> > > > Better still perhaps, usemod_wsgi. Run your main l

auto_add or default or save?

2008-05-25 Thread Rob Hudson

I don't recall where, but I thought I had heard once that the auto_add
and auto_add_now options to date fields in models was going away.

I've seen 2 main options in the wild and I'm not sure which is
preferred... I suppose each has its own use case:

1) Add default=datetime.now to the field.  This seems to provide a
pre-save setting of a date that shows up in the admin and can be
changed prior to saving.  Looks like it's good for a created date
field if you're ok with the idea that you can change it in the admin.

2) Override save and set the field prior to saving.  This seems like
it's good for an 'updated' date field that automatically updates every
time it's saved.

Are those breakdowns accurate?  Is the auto_now_* stuff really going
away?  And if so, could the docs be updated to reflect that?  Are
there other ways to get 'created' and 'updated' functionality?

Thanks,
Rob

--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: a problem with djikiki

2008-05-25 Thread Qiang



Qiang wrote:
> anyone have used the djikiki,a django wiki engine?
> i want to write a wiki engine with django like the djikiki.i installed
> the Djikiki.but i encounter a problem.
> i execute manage.py runserver there is no error.then i check the
> http://127.0.0.1:8000/admin. the django give me a trackback like this
> below. i want konw what wrong with it? how can i fix it? thanks
>
>
> TypeError at /admin/
> __init__() takes at most 4 arguments (5 given)
> Request Method:   GET
> Request URL:  http://127.0.0.1:8000/admin/
> Exception Type:   TypeError
> Exception Value:  __init__() takes at most 4 arguments (5 given)
> Exception Location:   D:\Python\Lib\site-packages\django\conf\urls
> \defaults.py in patterns, line 18
--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---



Re: admin and foreign key problem

2008-05-25 Thread M.Ganesh

Karen Tracey wrote:
> On Sat, May 24, 2008 at 11:11 PM, M.Ganesh <[EMAIL PROTECTED] 
> > wrote:
>
>
> Hi All,
>
> Having some problem with foreign key and admin interface :
>
> 
> #models---
> class tagword(models.Model):
>name = models.CharField(max_length=50)
>
>def __unicode__(self):
>return self.name 
>
>class Admin:
>pass
>
>class Meta:
>ordering = ["name"]
>app_label = 'common_utils'
>
> class tag(models.Model):
>tagword = models.ForeignKey(tagword)
>
>content_type = models.ForeignKey(ContentType)
>object_id = models.PositiveIntegerField()
>
>content_object = generic.GenericForeignKey()
>
>def __unicode__(self):
>return self.tagword
>
>class Admin:
>pass
>
>class Meta:
>ordering = ["tagword"]
>app_label = 'common_utils'
> 
> #
>
> I get the following error while I try to access
> /admin/common_utils/tag/
>
> TypeError at /admin/common_utils/tag/
> coercing to Unicode: need string or buffer, tagword found
>
> What is my mistake?
>
>
> Your __unicode__ function for tag is returning a tagword object.  Try 
> returning self.tagword.__unicode__() instead.
>
> Karen
>

Thanks Karen, it worked

Regards Ganesh



--~--~-~--~~~---~--~~
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?hl=en
-~--~~~~--~~--~--~---