Re: Template Question

2009-07-13 Thread CrabbyPete

Smartif is great, I don't get why it's not a standard part of django
templates.

On Jun 17, 5:02 pm, Steve Howell  wrote:
> Another option is to install the snippet below, which supports "in":
>
> http://www.djangosnippets.org/snippets/1350/
>
> On Jun 17, 1:53 pm, Ben Davis  wrote:
>
>
>
> > Nope, you'll need to set a variable in your view.  You can also try creating
> > your own filter such that {% if friend|is_in_group %}  would work (it's
> > pretty easy to do, just check out the docs for custom template filters)
>
> > On Tue, Jun 16, 2009 at 2:40 PM,CrabbyPete wrote:
>
> > > Is there a way do something like this with the template system
> > > {% if friend in group.members.all %} or simply {% friend in
> > > group.members.all %}- 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Adding errors

2009-08-04 Thread CrabbyPete

I want to return an error that a user was not found. I wanted to add
the error and have it formatted using errorlist as happens with a
required field. So I did the following

lform._errors['username']  = ErrorList("User does not exist or wrong
password")

The result in lform.errors is

ErrorDict: usernameUser does not exist or wrong password ...


instead of :
usernameUser does
not exist or wrong password

What am I doing wrong?





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



Complex query in model manager

2009-08-22 Thread CrabbyPete

I have the following code in model manager

class SpotMessageManager(models.Manager):

  def for_user(self, user, start = 0, end = None, friends ):
messages = self.filter(user = user).order_by
('date_added').reverse()
...

friends is a list of users, and I want the query set to include the
user and all the friends in the list. What is the best way to do 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Complex query in model manager

2009-08-23 Thread CrabbyPete

or another words can I use a Q object in a model manager?

On Aug 23, 12:05 am, CrabbyPete  wrote:
> I have the following code in model manager
>
> class SpotMessageManager(models.Manager):
>
>       def for_user(self, user, start = 0, end = None, friends ):
>             messages = self.filter(user = user).order_by
> ('date_added').reverse()
>             ...
>
> friends is a list of users, and I want the query set to include the
> user and all the friends in the list. What is the best way to do 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Validate with PIL

2009-04-05 Thread CrabbyPete

I installed the PIL Imaging library and when I validate my model I get
the error that I need the imaging library. I'm using Python 2.6.

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



save message text with registered character

2009-04-07 Thread CrabbyPete

I am trying to save a message that has  a registered trademark
character in it, like Coke is a registered trademark.
I get a DjangoDecodeError. How do I prevent this from happening?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Help DjangoDecode Error

2009-04-07 Thread CrabbyPete

I keep getting this message when I try to save a record to my database
DjangoDecodeError: 'utf8' codec can't decode byte 0xae in position 268

I have __unicode__ defined in my models. I changed mysql to use utf8.
I don't know what else to do

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



blank = True and unique = True

2009-04-10 Thread CrabbyPete

I have a field for emails. I want it to be blank if nothing in there
and unique if something is. I get a duplicate field error if I have to
messages with blank fields. I can use null = True and it works, but
django's admin blows up. I seen some stuff, but no real solution. Does
anyone have a good solution for 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



residual fields admin error

2009-04-14 Thread CrabbyPete

I am just starting coding with django. So please bear with me.

I made a change to my User model so the field email_addr is now email.
I deleted the database, made new tables with manage.py, did a resync,
and changed all the code that refered to email_addr to email.
Everything looks fine, but I still get Ithe following error  when I
looked at my database with the admin. Is there some

Caught an exception while rendering: 'User' object has no attribute
'email_addr'Request Method: GET
Request URL: http://localhost:8000/admin/base/message/1/
Exception Type: TemplateSyntaxError
Exception Value: Caught an exception while rendering: 'User' object
has no attribute 'email_addr'
Exception Location: C:\Python26\lib\site-packages\django\template
\debug.py in render_node, line 81
Python Executable: C:\Python26\pythonw.exe
Python Version: 2.6.1
Python Path: [u'C:\\Django\\spot', u'C:\\Django', 'C:\\Documents and
Settings\\pdouma\\Application Data\\PyScripter', 'C:\\Python26\\lib\
\site-packages\\setuptools-0.6c9-py2.6.egg', 'C:\\Python26\\lib\\site-
packages\\elixir-0.6.1-py2.6.egg', 'C:\\Python26\\lib\\site-packages\
\tesla-0.2.5-py2.6.egg', 'C:\\Python26\\lib\\site-packages\
\authkit-0.4.3-py2.6.egg', 'C:\\Python26\\lib\\site-packages\
\migrate-0.2.2-py2.6.egg', 'C:\\Python26\\lib\\site-packages\
\pil-1.1.7a2-py2.6-win32.egg', 'C:\\Python26\\lib\\site-packages\
\pylint-0.18.0-py2.6.egg', 'C:\\Python26\\lib\\site-packages\
\logilab_astng-0.19.0-py2.6.egg', 'C:\\Python26\\lib\\site-packages\
\logilab_common-0.39.0-py2.6.egg', 'C:\\WINDOWS\\system32\
\python26.zip', 'C:\\Python26\\DLLs', 'C:\\Python26\\lib', 'C:\
\Python26\\lib\\plat-win', 'C:\\Python26\\lib\\lib-tk', 'C:\
\Python26', 'C:\\Python26\\lib\\site-packages', 'C:\\Python26\\lib\
\site-packages\\PIL', 'C:\\Python26\\lib\\site-packages\\win32', 'C:\
\Python26\\lib\\site-packages\\win32\\lib', 'C:\\Python26\\lib\\site-
packages\\Pythonwin']
Server time: Tue, 14 Apr 2009 16:36:05 -0400


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



Re: save message text with registered character

2009-04-15 Thread CrabbyPete

Karen,

Sorry for the cryptic message.I just start using google groups and
django.  I was storing email that I received in a database. One of the
characters was a mark that could not be coverted for some reason. I
found the program decodeh.py and it fixed it for me.



On Apr 7, 1:40 pm, Karen Tracey  wrote:
> On Tue, Apr 7, 2009 at 1:29 PM, CrabbyPete  wrote:
>
> > I am trying to save a message that has  a registered trademark
> > character in it, like Coke is a registered trademark.
> > I get a DjangoDecodeError. How do I prevent this from happening?
>
> Wild guess: a decode error sounds like you are passing in a bytestring
> somewhere, and furthermore one that is not utf-8 encoded, as Django
> generally assumes utf-8 encoding for bytestrings. If you'd like a more
> educated guess you'll have to supply a few more details of what exactly it
> is your code is doing.
>
> 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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



contrib.auth Group class

2009-04-29 Thread CrabbyPete

Is there any advantage to using the Group class in contrib.auth, over
making your own group. Or is it best to extend Group?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



User Profile in Admin

2009-05-01 Thread CrabbyPete

I created the following:

class Profile(models.Model):
user= models.ForeignKey(User, unique=True)
phone   = models.CharField(max_length=15,  blank = True, null
= True, unique = True)

   def __unicode__(self):
return self.user.username


But when I look at it in the Admin. It shows  the Profile and that I
have 2 users, but does not display the username to select. Help?



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



class for form fields

2009-05-11 Thread CrabbyPete

I just started using forms and I have the following html
Zip Code: 

How do you specify the class type for the input field.

I created a form
   class Address(form.Forms)
zip = forms.CharField(label = 'Zip Code:',max_length =
15)


This changes the label
Zip Code: {{ form.zip }}

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



Re: class for form fields

2009-05-11 Thread CrabbyPete

Thanks

On May 11, 12:06 pm, David Zhou  wrote:
> On Mon, May 11, 2009 at 12:04 PM, CrabbyPete  wrote:
>
> > I just started using forms and I have the following html
> > Zip Code:  > size="15" maxlength="15">
>
> > How do you specify the class type for the input field.
>
> See:
>
> http://docs.djangoproject.com/en/dev/ref/forms/widgets/#django.forms
>
> -- dz
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



query reverse

2009-05-21 Thread CrabbyPete

I want to create a list of items from the most recently added to the
oldest. I tried this
message = Message.objects.reverse('date_added')

It still returned the oldest items first. What is the best way to
return the newest item first?

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



Re: query reverse

2009-05-21 Thread CrabbyPete

Never mind I figured it out.

On May 21, 10:42 am, CrabbyPete  wrote:
> I want to create a list of items from the most recently added to the
> oldest. I tried this
> message = Message.objects.reverse('date_added')
>
> It still returned the oldest items first. What is the best way to
> return the newest item first?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Python noob tuples question

2009-05-22 Thread CrabbyPete


I am trying to make a selector in  a forms based on information in the
database.

The selector uses a tuple like this:

PEOPLE = (('john','adams'),('sam','smith'),('john','doe'), ...)

if I start a tuple with ( ('john","adams"))



if I start with PEOPLE = (('john','adams')) how do I add the
subsequent tuples?

I have tried  PEOPLE,('sam",smith) which works for the first one but
the next add gives me
 ((('john','adams'),('sam','smith')),('john','doe'))


If I do this PEOPLE += ('john','doe') I get a string
(('john','adams'),('sam','smith'),'john','doe' )

Could someone explain how I add tuples to tuples to get PEOPLE the way
its supposed to be.

Thanks

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



adding errors to forms

2009-05-22 Thread CrabbyPete

If I have a form and  if  form.is_valid is False

The code code in the template {{ form.name.errors}} formats the error
like this.
This field is required.

How do you add an error so it gets formatted with the surrounding
html. If a user name already exists I want to add the error message
'User name already in use'

I tried form._errors[name] = 'User name already in use' and
{{form.name.errors}} just prints the string.



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



mod_wsgi manage.py

2009-06-03 Thread CrabbyPete

I wanted to see if I could deploy my project on Apache on a windows
server using mod_wsgi.  I got it working. The only problem is now I
can not run the development environment using manage.py I am using
Pyscripter and I now get this message every time I run manage.py

Command Line : runserver --noreload
Error: Could not import settings 'spot.settings' (Is it on sys.path?
Does it have syntax errors?): No module named settings
Exit code:  1

Any help greatly appreciated I would love to be able to switch back
and forth.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Desperate Help needed. manage.py runserver no longer works.

2009-06-04 Thread CrabbyPete

I am new to django and I am running it on a Windows server. I
installed mod_wsgi with Apache and go it to work, but now when I run
python manage.py runserver. I get the error

Error: Could not import settings 'spot.settings' (Is it on sys.path?
Does it have syntax errors?): No module named settings
Exit code:  1

mysite is call spot. Can anyone tell me why running the django server
no longer works. I am going nuts trying to figure this out, and before
I rip out everything and start over can some please give me some
advise what to look for and what I might have gone wrong. I can only
assume it has something to do with what I did in my spot.wsgi file

import os
import sys

sys.stdout = sys.stderr

from os.path import abspath, dirname, join
from site import addsitedir

PROJECT_ROOT = abspath(join(dirname(__file__), "../"))

sys.path.insert(0, join(PROJECT_ROOT, "apps"))
sys.path.insert(0, abspath(join(dirname(__file__), "../../")))

from django.core.handlers.wsgi import WSGIHandler

os.environ["DJANGO_SETTINGS_MODULE"] = "spot.settings"

application = WSGIHandler()


Thanks in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Template Question

2009-06-16 Thread CrabbyPete

Is there a way do something like this with the template system
{% if friend in group.members.all %} or simply {% friend in
group.members.all %}
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Email Field

2010-04-20 Thread CrabbyPete
Where in the django.contrib is the models.EmailField defined? I have
email address that are longer than 60 characters and I want to see if
I can override 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Running django on IIS

2010-04-21 Thread CrabbyPete
I tried for a while, and finally switched to Apache on Windows. It
works great and easy to set up.

On Apr 21, 6:29 am, Nick  wrote:
> Hiya
>
> I have exactly the same problem as described here.
>
> Did you (or anyone) find a fix or workaround for this?
>
> Cheers!
> Nick.
>
> On Apr 14, 12:24 pm, Paweł Roman  wrote:
>
>
>
> > > I suspect it is trying to import Http but can't.
>
> > > Fire up python (Start -> Python Interactive Shell, or Start -> Run ->
> > > cmd -> type python), and type:
>
> > > import Http
> > > If that doesn't work, you haven't installed it properly. See the
> > > following quote from the Django wiki:
>
> > > "•Go to c:\pyisapie\source\PyISAPIe\Python\ and copy the entire Http
> > > folder to c:\python25\lib\site-packages. Note: the Http folder is case
> > > sensitive. Saving in 'http' (or any other variation) will not work
> > > [SF]. "
>
> > I've copied Http to site-packeges. "import Http" works OK.
>
> > Interesting thing is that running "from Http import *"  fails
> > (AttributeError: 'module' object has no attribute 'Read'), but I guess
> > this has something to do with the fact that Http's __init__.py tries
> > to set __all__ (in other words: import) modules that are not in the
> > filesystem, but somewhere in the pyisapie.dll (?), like the mentioned
> > 'Read'. There is even a comment line that says #From DLL. I don't know
> > how this is supposed to work, i.e. how python can import modules from
> > dll (?), I even included tha path to the DLL in the pytonpath, just in
> > case, but it didnt help.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

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



Re: Email Field

2010-04-21 Thread CrabbyPete
Yes, but my problem is its defined in contrib.auth.User with no
length, which I assume defaults to 60. Facebook proxy email address
can be 90 characters long.

On Apr 20, 11:03 am, "ge...@aquarianhouse.com"
 wrote:
> did you try:
>
> email = models.EmailField(max_length=60)
>
> On Apr 20, 5:00 pm,CrabbyPete wrote:
>
> > Where in the django.contrib is the models.EmailField defined? I have
> > email address that are longer than 60 characters and I want to see if
> > I can override 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-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

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



Re: Email Field

2010-04-22 Thread CrabbyPete
Thanks. That helps.  At least I know someone else is facing the same
thing.

On Apr 21, 2:20 pm, Tom Evans  wrote:
> On Wed, Apr 21, 2010 at 6:22 PM, CrabbyPete  wrote:
> > Yes, but my problem is its defined in contrib.auth.User with no
> > length, which I assume defaults to 60. Facebook proxy email address
> > can be 90 characters long.
>
> http://lmgtfy.com/?q=django+auth.User+email+truncating&l=1
>
> Funnily, the OP there was dealing with the same issue. 75 characters
> is ridiculously short, commercial email addresses are often way longer
> than that - combine long company name with a typical spanish* name and
> a first.middle.l...@company email policy and you can get some real
> massive email addresses. I've even seen companies prepend
> 'temporary-contractor--ibm-' to the front of some email addresses :)
>
> Cheers
>
> Tom
>
> * Not that I have anything against spanish names, but sometimes they
> can be gloriously magnificent - take Juan Antonio Samaranch as an
> example. Don't think he was ever an IBM contractor tho :/
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

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



Close window after download

2010-05-06 Thread CrabbyPete
I have code that generates a file for download. I want to close the
window after the user selects the download or even redirect them.

Here is my code:

response = HttpResponse(cal.as_string(), mimetype='text/calendar')
response['Content-Disposition'] = 'attachment; filename=schedule.ics'
return response

I can't close the window before the download using


 


because I get an error that the window closed.

So after the form download the window is hanging in limbo. If anyone
knows
how to close the window I'd appreciate 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Close window after download

2010-05-11 Thread CrabbyPete
Does anyone know how to track if a download completed?

On May 6, 9:52 pm, CrabbyPete  wrote:
> I have code that generates a file for download. I want to close the
> window after the user selects the download or even redirect them.
>
> Here is my code:
>
> response = HttpResponse(cal.as_string(), mimetype='text/calendar')
> response['Content-Disposition'] = 'attachment; filename=schedule.ics'
> return response
>
> I can't close the window before the download using
>
> 
>  
> 
>
> because I get an error that the window closed.
>
> So after the form download the window is hanging in limbo. If anyone
> knows
> how to close the window I'd appreciate 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-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

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



Re: Updating profiles

2010-05-11 Thread CrabbyPete
should be

AUTH_PROFILE_MODULE = 'app_name.Profile'

On May 11, 10:15 am, Bill Freeman  wrote:
> Is AUTH_PROFILE_MODULE set correctly in settings.py?
>
>
>
> On Tue, May 11, 2010 at 6:43 AM, django_jedi  wrote:
> > OK, I'm baffled.  I must be missing something right in front of my
> > face...
>
> > I'm trying to create a form that will allow users to update their
> > profiles.  No matter what I try, I get a
>
> > "User matching query does not exist."
>
> > ...error.  Below is the associated view, and the related model and
> > form clases.  Any help would be appreciated.
>
> > VIEW
> > ---
> > @login_required
> > def update_profile(request):
> >    try:
> >        myprofile = request.user.get_profile()
> >    except:
> >        up = Profile(user=request.user)
> >        up.save()
> >        myprofile = request.user.get_profile()
>
> >    if request.method == 'POST':
> >        form = ProfileUpdateForm(request.POST, request.FILES,
> > instance=myprofile)
> >        if form.is_valid():
> >            form.save()
> >    else:
> >        form = ProfileUpdateForm(instance=myprofile)
>
> >    return render_to_response('profiles/update.html', {'form':form,
> > 'profile':myprofile},
> >        context_instance = RequestContext(request))
>
> > MODEL
> > ---
> > class Profile(models.Model):
> >    # This is the only required field
> >    user = models.ForeignKey(User, unique=True)
> >    picture = models.ImageField(upload_to='img/profilepics/%Y%m%d/',
> > blank=True, null=True)
> >    # The rest is completely up to you...
> >    favorite_band = models.CharField(max_length=100, blank=True)
> >    favorite_cheese = models.CharField(max_length=100, blank=True)
> >    lucky_number = models.IntegerField(null=True, blank=True)
>
> > FORM
> > ---
> > class ProfileUpdateForm(ModelForm):
> >    class Meta:
> >        model = Profile
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

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



insert html in html

2010-05-18 Thread CrabbyPete
I want to insert a html calendar into an existing web page. What is
the best way to insert html into a template that I have for the web
page?

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



Re: insert html in html

2010-05-19 Thread CrabbyPete
Brian,

Thanks. The safe filter worked for me. I was writing it to a file and
then doing an {% include calendar %}, but your solution worked out.

On May 18, 7:00 pm, Brian Neal  wrote:
> On May 18, 2:00 pm,CrabbyPete wrote:
>
> > I want to insert a html calendar into an existing web page. What is
> > the best way to insert html into a template that I have for the web
> > page?
>
> In what form do you have this calendar HTML? Do you compute it in a
> view? Is it already in a file? If you have it in a view, then one way
> to do it would be to pass it to a template and in the template:
>
> My Calendar
> 
> {{ my_calendar_data|safe }}
> 
>
> You could make this a template tag, or {% include %} it, or put it in
> your base template...
>
> We'd need more information to help further.
>
> Hope that helps.
> BN
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group 
> athttp://groups.google.com/group/django-users?hl=en.

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



Re: Dajax or Jquery

2010-07-12 Thread CrabbyPete
I never saw Dajax, but after reading I see it supports Jquery. I use
mootools and Jquery and both are great.  Dajax just seem to integrate
them into django a little easier.

On Jul 12, 6:36 am, Imad Elharoussi  wrote:
> Hi,
>
> I want to know what's the best plugin of Ajax to use with django Dajax or
> Jquery (for someone who just began in developping with such technologies)
>
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Python/Django hosting

2010-07-29 Thread CrabbyPete
www.webfaction.com

On Jul 29, 12:02 pm, kostia  wrote:
> We are PROJECTOR team. We have a web site, developed on Django /
> Python.
>
> The site is temporarily launched with test data herehttp://kostia.pythonic.nl/
>
> We are working with github herehttp://github.com/vaxXxa/projector
>
> The web site contains User Profiles, Projects and Events for these
> Projects. All data is text-based and there will be not much traffic.
>
> People will be uploading small videos on youtube/vimeo/etc and link
> them on the site. The content of the video is a 3-5 minutes of
> author's presentation, where he is trying to describe what he is
> doing, what he needs and what the effect it will cause on the society.
> An idea just to bring so-called value-business on the top and help
> authors to find people to help with their ideas/projects.
>
> The web site is social oriented and we are looking for any hosting
> solution.
>
> I will consider any propositions.
>
> Thank you very much.
>
> Kostia

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



fixtures and dates

2010-09-24 Thread CrabbyPete
I have a spreadsheet of football games that I wanted to get into an
sqlite3 database. I converted it to json, but when i loaded it I was
required to put the date in -MM-DD format. So I changed it. The
problem is now when I run the admin and look at the game I get this
error

TemplateSyntaxError at /admin/football/game/
Caught TypeError while rendering: unsupported operand type(s) for +:
'datetime.date' and 'unicode'

Any ideas why?

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



Re: fixtures and dates

2010-09-25 Thread CrabbyPete
Thanks Shawn. I looked back in my model and found I left off something
in my unicode.



On Sep 24, 1:44 pm, Shawn Milochik  wrote:
> We need more information. Preferably the full traceback.
>
> In short, something is trying to add a date object to a unicode text
> object. Possibly the date as a date object and the time as a unicode
> string. How did you convert the original data to JSON?

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



Re: JavaScript with Dango

2010-09-26 Thread CrabbyPete
Yes.

On Sep 26, 7:48 am, aug dawg  wrote:
> Does Django work with JavaScript? If so, how can I use JavaScript in my
> Django projects?

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



Re: Django in production on Windows

2010-12-01 Thread CrabbyPete
I developed Djano on a windows server and everything went smoothly
except getting it to work with IIS. I loaded apache on windows and it
works great.

On Dec 1, 6:43 am, ashdesigner  wrote:
> Hello,
>
> I am absolutely new to Python/Django. Being responsible for a large
> corporate startup project and having looked through a number of MVC/
> MVT frameworks I decided to outsource the webproject in Django.
>
> The only undiscovered issue to us is whether we can launch a heavy
> loaded website in Django under Windows (IIS) + MSSQL. Would appreciate
> any comment please.
>
> Anthony

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



Re: Django in production on Windows

2010-12-02 Thread CrabbyPete
I'm not saying not to use IIS, I could just not get it to work. Other
people have asked how to get it work as well. Its not easy and I would
love to here from someone that was able to get it to work with IIS. I
developed everything on windows, and running Apache on windows was
great. No headaches and easy to debug if I ran into problems. I have a
friend who was a windows admin look at what I was doing with IIS and
he could not figure it out. If you know IIS and want to try it, I
would love to know how you made out with it.

On Dec 1, 8:40 am, ashdesigner  wrote:
> Pete,
>
> Does this mean that we shouldn't even try to run it on IIS7 in
> production?
>
> On Dec 1, 4:27 pm, CrabbyPete  wrote:
>
> > I developed Djano on a windows server and everything went smoothly
> > except getting it to work with IIS. I loaded apache on windows and it
> > works great.
>
> > On Dec 1, 6:43 am, ashdesigner  wrote:
>
> > > Hello,
>
> > > I am absolutely new to Python/Django. Being responsible for a large
> > > corporate startup project and having looked through a number of MVC/
> > > MVT frameworks I decided to outsource the webproject in Django.
>
> > > The only undiscovered issue to us is whether we can launch a heavy
> > > loaded website in Django under Windows (IIS) + MSSQL. Would appreciate
> > > any comment please.
>
> > > Anthony
>
>

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



Re: Fwd: Django in production on Windows

2010-12-03 Thread CrabbyPete
Windows is a great platform to work on. There are loads of tools and
support for Windows. The issue is not Windows vs Linux
the issue is Apache ( which works great on Windows ) v IIS. If your
admin is wants to use Windows by all means stick with it, and just
install Apache. I developed on Windows and deployed on both Windows
servers and Unix servers. Stay platform neutral and it won't matter.

On Dec 2, 10:32 am, ashdesigner  wrote:
> Javier,
>
> Under "hack approach" I meant PyISAPIe + IIS (wich is weird by itself,
> but still).
>
> Anthony
>
> On Dec 2, 6:25 pm, Javier Guerra Giraldez  wrote:
>
> > On Thu, Dec 2, 2010 at 10:05 AM, ashdesigner  
> > wrote:
> > > not to use Python/Django
> > > +IIS+Windows because of lack of support and tools immaturity ("hack"
> > > approach).
>
> > not at all.   there are lots of goods reasons to go the *nix route (be
> > it Linux, BSD, Solaris, etc).  but Django does work anywhere Python
> > does.
>
> > FastCGI is _not_ a 'hack'.  It's a standard
>
> > --
> > Javier
>
>

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



Javascript Modal Window

2010-02-08 Thread CrabbyPete
I want to use greybox to show a login form. My question is what is the
best way to do this?
Here is the line I am using in m template

Login

Should I directly link to the form, or use {% url xxx %}, or is there
something else I should do?
Also can I send it back up if I get errors? Any advice much
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Javascript Modal Window

2010-02-10 Thread CrabbyPete
Thanks, but  I was not clear in my question. If I use jQuery or any
other javascript framework, to do a modal window from a link I have to
load some html code that is the form

Here is an example using thickbox in a template




login

In a view I load an html template with get_template()

Do I do this within the template as well?






get_template('mypage.html')

On Feb 8, 5:00 pm, Shawn Milochik  wrote:
> You can use a jQuery UI Dialog. It can be modal, and you can easily use some 
> jQuery AJAX to submit your login view and receive the response.
>
> Shawn

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



Custom button for imagefield form

2010-02-22 Thread CrabbyPete
I have form with where users can upload an image. All works well but I
want a graphic instead of the default browse button that shows up. Can
I change it and if so how do you change it in the form field or
template?


class ProfileForm(SignUpForm):

mugshot = forms.ImageField  (required = False)

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



Authentication issue

2010-02-24 Thread CrabbyPete
I have code that allows an anonymous user to look at some elses page,
but I want to limit what they can do so I have the following code

def show(request):
 u = request.GET['friend']
 user = User.objects.get(pk=u)
 visit = user.is_authenticated()

visit should be false, but it keeps coming back as true, even though
no one is logged in. Why and can I force user to be logged out?

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



Subclassing Comments model

2010-02-25 Thread CrabbyPete
I subclassed the django comment app model, because I wanted to add
photos.

class PictureComment( Comment ):
photos  = models.ManyToManyField(Photos)


In my template I use
{% get_comment_list for message as comment_list %}

{% for comment in comment_list %}


{% endfor %}

and  the list it returns is a list of comments, not the subclassed
PictureComment.

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



Re: Subclassing Comments model

2010-02-25 Thread CrabbyPete
Sorry I did not finish.

How do I get the subclass PictureComment, not Comment.



On Feb 25, 4:13 pm, CrabbyPete  wrote:
> I subclassed the django comment app model, because I wanted to add
> photos.
>
> class PictureComment( Comment ):
>     photos          = models.ManyToManyField(Photos)
>
> In my template I use
> {% get_comment_list for message as comment_list %}
>
> {% for comment in comment_list %}
>
> {% endfor %}
>
> and  the list it returns is a list of comments, not the subclassed
> PictureComment.

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



Facebook Connect

2010-03-15 Thread CrabbyPete
I am trying to integrate pyfacebook into a existing project, and its
driving me nuts. I just want users to be able to sign in with
facebook.  Anyone else try this and any recommendations.

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



Re: Upload image file, resize using PIL, then save into ImageField - what to save to ImageField?

2010-03-19 Thread CrabbyPete

The Imagefile is just a pointer to file. Here is what I do to upload
and resize an image. I hope it helps.

file_to_open = settings.MEDIA_ROOT+'//profiles//'+
user.username+'-'+file.name
fd = open(file_to_open, 'wb+')
if file.multiple_chunks():
for chunk in file.chunks():
fd.write(chunk)
else:
fd.write(file.read())
fd.close()

# Resize the image
ms = Image.open(file_to_open)
size = 145,132
ms.thumbnail(size, Image.ANTIALIAS)
ms.save(file_to_open, "JPEG")

On Mar 18, 10:03 am, Alex Robbins 
wrote:
> I think Satchmo useshttp://code.google.com/p/sorl-thumbnail/
> I think it uses PIL underneath a layer of abstraction. That might work
> for you if you are just wanting to generate alternate versions of
> uploaded images.
>
> Alex
>
> On Mar 18, 12:10 am, robinne  wrote:
>
> > I can save an uploaded image to a FileField like this (where
> > "ProductFile" is a model) and "TempFile" is an ImageField:
>
> > uploadedfile = request.FILES['uploadfile']
> > ProductFile.objects.create(FileName=UploadDate=datetime.datetime.now(),
> > TempFile=uploadedfile)
>
> > But, how do I manipulate the image size and then save to this model? I
> > am working with PIL, but I can't save a PIL Image to a ImageField. Can
> > I save the file to disk using PIL and then pass in the file path and
> > name to the model? If so, what is the syntax for saving the ImageFile
> > when you are no longer working with the original uploadedfile 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



auto authenticate

2010-03-25 Thread CrabbyPete
I am connecting facebook to an app I have running. In order not to
change a load of code I created a dummy account when someone logs in
through facebook. My only problem is I want to authenticate with this
account when they log  Is there a way to login in a user using the
encrypted password. I am using pyfacebook and FacebookUser is the
following model


class FacebookUser(models.Model):
user= models.ForeignKey(User, unique = True)
fb_uid  = models.CharField( max_length=100, blank = True,
unique = True)

def __unicode__(self):
if self.user.username == u'':
return str(self.pk)
return self.user.username


the fb_uid is the Facebook id I get back. Here is my view when I get
called from facebook

fb = request.facebook
 try:
  fid = FacebookUser.objects.get(Q(fb_uid = fb.uid))
except FacebookUser.DoesNotExist:
   return ...

name = fid.user
pswd = fid.user.password
user = auth.authenticate(username=name, password=pswd)
 if user is not None and user.is_active:
 auth.login(request, user)


pswd is an encrypted password. Is there a way for me to authenticate
with 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: auto authenticate

2010-03-26 Thread CrabbyPete
Thanks Peter that is exactly what I was looking for.

On Mar 25, 5:12 pm, Peter Bengtsson  wrote:
> If what you want to achieve is to log in a user programmatically you
> don't do that by authenticating by username and password.
> Example:
>
> def login_by_id(request):
>
>            user = FacebookUser.objects.get(...).user
>
>            from django.contrib.auth import load_backend, login
>            for backend in settings.AUTHENTICATION_BACKENDS:
>                 if user == load_backend(backend).get_user(user.pk):
>                     user.backend = backend
>            if hasattr(user, 'backend'):
>                  login(request, user)
>
> On 25 Mar, 18:27, CrabbyPete  wrote:> I am connecting 
> facebook to an app I have running. In order not to
> > change a load of code I created a dummy account when someone logs in
> > through facebook. My only problem is I want to authenticate with this
> > account when they log  Is there a way to login in a user using the
> > encrypted password. I am using pyfacebook and FacebookUser is the
> > following model
>
> > class FacebookUser(models.Model):
> >     user            = models.ForeignKey(User, unique = True)
> >     fb_uid          = models.CharField( max_length=100, blank = True,
> > unique = True)
>
> >     def __unicode__(self):
> >         if self.user.username == u'':
> >             return str(self.pk)
> >         return self.user.username
>
> > the fb_uid is the Facebook id I get back. Here is my view when I get
> > called from facebook
>
> > fb = request.facebook
> >  try:
> >       fid = FacebookUser.objects.get(Q(fb_uid = fb.uid))
> > except FacebookUser.DoesNotExist:
> >        return ...
>
> > name = fid.user
> > pswd = fid.user.password
> > user = auth.authenticate(username=name, password=pswd)
> >  if user is not None and user.is_active:
> >      auth.login(request, user)
>
> > pswd is an encrypted password. Is there a way for me to authenticate
> > with 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



decorators

2010-04-04 Thread CrabbyPete
I am using pyfacebook and when I run the debug server I get the
following:

C:\Python26\lib\site-packages\facebook\djangofb\__init__.py:185:
DeprecationWarning: Calling the deprecated function 'new_wrapper'
Downgrade to decorator 2.3 if you want to use this functionality
  return decorator.new_wrapper(updated, f)

Can someone please explain this to me.

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



facebook email

2010-04-08 Thread CrabbyPete
I am fooling around with the facebook api. Facebook gives you a proxy
email address that is to big for the current User email field. Is
there a way to extend this field, or should I use another field
completely.

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



EmailMessage hangs in Windows

2012-04-23 Thread CrabbyPete
I am using
from django.core.mail   import  EmailMessage

and I have the following code
msg = EmailMessage ( subject   =  subject,
   body  =  body,
   from_email = sender,
   to  = receivers,
  bcc = bcc
)
try:
print "Mailing"
err = msg.send( fail_silently = False )
except Exception, e:
err = "Email Send Error " + str(e)
print err
else:
print "Mailed"

I am mailing a bunch of messages and every once in a while it hangs on
the send. I never know when, and it only happens with windows.

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



EmailMessage hangs in windows

2012-04-24 Thread CrabbyPete
I have the following code:

  msg = EmailMessage ( subject   = subject,
 body  = body,
 from_email = sender,
 to  = receivers,
 bcc= bcc
   )

try:
msg.send()
except Exception, e:
err = "Email Send Error " + str(e)
logger.error(self.log(err))
return False
   
return True

This works perfectly on my linux servers, but when I run it on windows it 
hangs, but not right away. Sometimes I can send 
4 five messages before it hangs.

Anyone have any idea what is going on?

Thanks

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



Model Inheritance and methods

2011-08-20 Thread CrabbyPete
I have the following models:

class Deal(models.Model):
"""
Deal is a deal for  Interest. There should only be one
deal for each Interest pair
"""
interest = models.ForeignKey( Interest )
max_sell = models.IntegerField(default = 1)

def terms(self):
return self.term_set.all()

class Term( models.Model ):
"""
A Term are the terms of a Deal. There can be many Terms for each
Deal
"""
deal  = models.ForeignKey( Deal )
canceled  = models.BooleanField(default = False)
cost  = models.CharField( max_length = 10, blank = True, null
= True )
buyer = models.ForeignKey( User, blank = True, null = True )

def execute(self, **kwargs):
pass

class Expire( Term ):
"""
Subclass of Term that is good until an expiration date
"""
date= models.DateField()

def execute(self):
if self.buyer == None or self.canceled:
return False

delta = self.date - date.today()
if delta.days >= 0:
return True
return False

def __unicode__(self, **kwargs):
return ''

class Cancel( Term ):
"""
Subclass of Term that the Term is good until canceled
"""
def execute(self):
if self.buyer == None or self.canceled:
return False
return True

def __unicode__(self):
return ''


I want to do the following:
for term in deal.terms()
 if term.execute():
do something


My thought was the term.execute method would be overridden and the
type of term, either cancel's or expire's execute method would occur,
but it only executes the term.execute()

I can get around it by having the following as the term execute, but
its ugly
def execute(self):
try:
   term.cancel.execute()
except:
   pass
try:
  term.expire.execute()
except:
   pass

Any suggestions?

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



Error was: No module named io

2011-08-27 Thread CrabbyPete
I developed my code with python 2.6 and django 1.3. Now that I am
deploying it on a dreamhost server the python is version 2.5 and I get
the error above. Is there a work around. Do I need to upgrade python?

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



Re: Error was: No module named io

2011-08-28 Thread CrabbyPete
Thanks, but that's not the problem.  Here is the traceback

Traceback:
File "/home/brightmap/lib/python2.5/site-packages/Django-1.3-py2.5.egg/
django/core/handlers/base.py" in get_response
  101. request.path_info)
File "/home/brightmap/lib/python2.5/site-packages/Django-1.3-py2.5.egg/
django/core/urlresolvers.py" in resolve
  252. sub_match = pattern.resolve(new_path)
File "/home//brightmap/lib/python2.5/site-packages/Django-1.3-
py2.5.egg/django/core/urlresolvers.py" in resolve
  158. return ResolverMatch(self.callback, args, kwargs,
self.name)
File "/home/brightmap/lib/python2.5/site-packages/Django-1.3-py2.5.egg/
django/core/urlresolvers.py" in _get_callback
  167. raise ViewDoesNotExist("Could not import %s. Error
was: %s" % (mod_name, str(e)))

Exception Type: ViewDoesNotExist at /
Exception Value: Could not import base.views. Error was: No module
named io

On Aug 27, 10:06 pm, sreekanth  wrote:
> Hi,
>
> Please check the path , as you changed to a new server and also check the
> permissions.
>
>
>
>
>
>
>
> On Sun, Aug 28, 2011 at 6:29 AM, CrabbyPete  wrote:
> > I developed my code with python 2.6 and django 1.3. Now that I am
> > deploying it on a dreamhost server the python is version 2.5 and I get
> > the error above. Is there a work around. Do I need to upgrade python?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.

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



Re: Error was: No module named io

2011-08-29 Thread CrabbyPete
This is what I suspected. Even though Django 1.3 is supposed to
support python 2.5

On Aug 29, 3:53 am, Łukasz Rekucki  wrote:
> It's not a path problem. It's a python version problem:
>
> http://docs.python.org/library/io.html
>
> "New in version 2.6."
>
> It's not a problem with Django as 1.3 runs fine on 2.5.X. It's a
> problem in your code, so either upgrade to 2.6 or rewrite your code in
> terms of the older API that io module replaces.
>
> --
> Łukasz Rekucki

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



Class Views

2011-10-06 Thread CrabbyPete
I have the following class defined

class TeamView(TemplateResponseMixin, View):
template_name = 'team.html'

def get(self, request):
if 'team' in request.GET:
team = Team.objects.get(id = request.GET['team'])
form = TeamForm(  )
else:
team = None
form = TeamForm()

return self.render_to_response({'form':form, 'team':team})

def post(self, request):
form = TeamForm(request.POST)

if not form.is_valid():
return self.render_to_reponse({'form': form})
...

When I call the self.render_to_response in the get it works fine, but
when I call it in the post
I get 'TeamView' object has no attribute 'render_to_reponse'

Any suggestions what I am doing wrong?

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



Class Views Questions

2011-10-08 Thread CrabbyPete
I am fooling around with django generic class views, and I was
wondering if its possible to actually build class views per item for
example I have the following class view.


class TeamView( View, TemplateResponseMixin ):
template_name = 'team.html'

def get(self, request):
if 'team' in request.GET:
team = Team.objects.get(id = request.GET['team'])
form = TeamForm( instance = team )
else
team = None
form = TeamForm( )

return self.render_to_response({'form':form})

def post(self, request):
form = TeamForm(request.POST)

if not form.is_valid():
return self.render_to_response({'form': form})



I want to use this class to also delete the team. I love to use a
method by itself by adding
   def delete(self,request)
   if 'team' in request.GET:
team = Team.objects.get(id = request.GET['team'])
team.delete()

Is there a way to specify this in url.py and get around the dispatch
for the get?

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



Re: Class Views Questions

2011-10-09 Thread CrabbyPete
Thanks,

That helped me understand generic views much better. I'm using
mongoengine and also found this set of tools which uses class views

https://github.com/wpjunior/django-mongotools

On Oct 8, 11:08 am, Flavia Missi  wrote:
> Hi,
>
> There's a mixin that does exactly what you're doing in your view,
> ProcessFormView; used by the generic view FormView. You should use it. ;)
>
> If you want to use the same view to delete an object you will probably have
> to change your dispatch method (defined at  View class), there's no way to
> do this by the urlconf module.
>
> From the docs:
>
> The URLconf doesn't look at the request method. In other words, all request
> methods -- POST, GET, HEAD, etc. -- will be routed to the same function for
> the same URL.
>
> Check it 
> on:https://docs.djangoproject.com/en/dev/topics/http/urls/#what-the-urlc...
>
> Just for the record, there's a generic class view, called DeleteView, that
> you should use, but as a different view.
>
> Hope that helps. ;)
>
> []'s
>
> On Sat, Oct 8, 2011 at 11:12 AM, CrabbyPete  wrote:
> > I am fooling around with django generic class views, and I was
> > wondering if its possible to actually build class views per item for
> > example I have the following class view.
>
> > class TeamView( View, TemplateResponseMixin ):
> >    template_name = 'team.html'
>
> >    def get(self, request):
> >        if 'team' in request.GET:
> >            team = Team.objects.get(id = request.GET['team'])
> >            form = TeamForm( instance = team )
> >        else
> >            team = None
> >            form = TeamForm( )
>
> >        return self.render_to_response({'form':form})
>
> >    def post(self, request):
> >        form = TeamForm(request.POST)
>
> >        if not form.is_valid():
> >            return self.render_to_response({'form': form})
>
> >        
>
> > I want to use this class to also delete the team. I love to use a
> > method by itself by adding
> >   def delete(self,request)
> >       if 'team' in request.GET:
> >            team = Team.objects.get(id = request.GET['team'])
> >            team.delete()
>
> > Is there a way to specify this in url.py and get around the dispatch
> > for the get?
>
> > Any advise 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
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Flávia Missi
> @flaviamissi <http://twitter.com/flaviamissi>
> flaviamissi.com.brhttps://github.com/flaviamissi

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



Re: Which Linux distro to use on EC2?

2011-11-14 Thread CrabbyPete
I've used Ubuntu 11.0 on an EC2 micro, using nginx and uwsgi and its
great. There is also a google group for ubuntu on ec2, with loads of
support. If you use uwsgi you have to compile it on the server. I had
a tough time using Amazons version, I don't remember why, but had no
problem using Ubuntu. Also make sure what version of python you wind
up with.

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



Automatically direct unauthenticated users to homepage

2011-11-15 Thread CrabbyPete
I have a site with lots of views. When someone comes to my site and is
not logged in I direct them to the homepage to login. However a user
could type in a whole url for a view and it will go there and cause an
error because the view expects the user to be logged in. I could put
logic in every view to see if the user is logged in but it seems
redundant. Is there a way to force anonymous users to the home even if
they type in a full url to a specific 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Automatically direct unauthenticated users to homepage

2011-11-15 Thread CrabbyPete
I have a site with lots of views. When someone comes to my site and is
not logged in I direct them to the homepage to login. However a user
could type in a whole url for a view and it will go there and cause an
error because the view expects the user to be logged in. I could put
logic in every view to see if the user is logged in but it seems
redundant. Is there a way to force anonymous users to the home even if
they type in a full url to a specific 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Automatically direct unauthenticated users to homepage

2011-11-15 Thread CrabbyPete
Ivo,

Thank you. I was not using the @login_required decorator. I was using
generic classes like FormView and TemplateView but I see that in order
use login_required I have to put it in the url.py file and edit the
settings.LOGIN_URL to point to my login page.




On Nov 15, 11:25 am, Ivo Brodien  wrote:
> Hi,
>
> these views are protected by @login_required view, right?
>
> If so, users that are not logged in should be redirected to the login view.
>
> If you are not using the decorator, how are you handling users that are not 
> logged in these different views? You are probably doing something against the 
> DRY principle.
>
> bye
> Ivo
>
> On Nov 15, 2011, at 17:16 , CrabbyPete wrote:
>
>
>
>
>
>
>
> > I have a site with lots of views. When someone comes to my site and is
> > not logged in I direct them to the homepage to login. However a user
> > could type in a whole url for a view and it will go there and cause an
> > error because the view expects the user to be logged in. I could put
> > logic in every view to see if the user is logged in but it seems
> > redundant. Is there a way to force anonymous users to the home even if
> > they type in a full url to a specific 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 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.
>
>
>
>  smime.p7s
> 5KViewDownload

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



Radio Choices and Generic Views

2011-11-20 Thread CrabbyPete
I use the following code that I got from a django snippet, which works
great if you want to have radio buttons with different types of fields
associated with them

from django import forms
from django.utils.encoding  import force_unicode

class ChoiceWithOtherRenderer(forms.RadioSelect.renderer):
def __init__(self, *args, **kwargs):
super(ChoiceWithOtherRenderer, self).__init__(*args, **kwargs)

def __iter__(self):
for inp in self.choices:
id = '%s_%s' % (self.attrs['id'], inp[0]) if 'id' in 
self.attrs
else ''
label_for = ' for="%s"' % id if id else ''
checked = '' if not force_unicode(inp[0]) == self.value 
else
'checked="true" '
html = ' %s %%s' %  \
(label_for, id, inp[0], self.name, checked, inp[1])

yield html

class ChoiceWithOtherWidget(forms.MultiWidget):
def __init__(self, choices):
widgets = [forms.RadioSelect(choices=choices,
renderer=ChoiceWithOtherRenderer),]
for choice in choices:
widgets.append(choice[2])

super(ChoiceWithOtherWidget, self).__init__(widgets)

def decompress(self, value):
if not value:
return [None, None]
return value

def format_output(self, rendered_widgets):
render = []
for widget in rendered_widgets[1:]:
render.append(widget)

render = tuple(render)
return rendered_widgets[0] %render

class ChoiceWithOtherField(forms.MultiValueField):
def __init__(self, *args, **kwargs):
fields = [

forms.ChoiceField(widget=forms.RadioSelect(renderer=ChoiceWithOtherRenderer),
*args, **kwargs),
]
widget = ChoiceWithOtherWidget(choices=kwargs['choices'])
kwargs.pop('choices')
self._was_required = kwargs.pop('required', True)
kwargs['required'] = False
super(ChoiceWithOtherField, self).__init__(widget=widget,
fields=fields, *args, **kwargs)

def compress(self, value):
if self._was_required and not value or value[0] in (None, ''):
raise 
forms.ValidationError(self.error_messages['required'])
if not value:
return [None, u'']
return (value[0], value[1] if force_unicode(value[0]) ==
force_unicode(self.fields[0].choices[-1][0]) else u'')


So in forms.py I create a form something like this.


BUDGET_CHOICES = [('Budget'   , 'Budget',forms.TextInput() ),
  ('No Budget', 'No Budget', forms.RadioSelect )
 ]


class PaymentForm(forms.Form):
budget  = ChoiceWithOtherField ( choices =
BUDGET_CHOICES )



This works great,  until I created a FormsView class

class Payment( FormView ):
template_name = 'leadb/lb_payment.html'
form_class= PaymentForm


def form_valid(self, form):
"""

then I got
Exception Type: ValueError
Exception Value:

too many values to unpack

Exception Location: C:\Python27\lib\site-packages\django-1.3.1-
py2.7.egg\django\forms\fields.py in valid_value, line 680

I am passing three choices and it expects 2. I am trying to figure out
how to get around this. Any advice 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how django forms.ChoiceField with queryset ?

2011-11-21 Thread CrabbyPete
Do want to initialize a choice field? You can do this with forms

class SomeForm(forms.Form):


interest = forms.ChoiceField( choices=(),
 
widget=forms.Select(attrs={})
)

def __init__(self, *args, **kwargs):
super(SomeForm, self).__init__(*args, **kwargs)
self.fields['interest'].choices = [(i.interest,i.interest) for
i in Interest.objects.filter(status='standard')]



On Nov 20, 10:41 pm, 郁夫  wrote:
> hi.
>
> I have a forms.ChoiceField , I want with a queryset  field value.
>
> thank
>
> --
> http://szxatjp.blog.163.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



One from from multiple models using ModelForm

2011-12-04 Thread CrabbyPete
I wanted to combine two models into one form so I created the
following

class UserForm( ModelForm ):
class Meta:
model = User
fields = ('email','first_name','last_name')

class ProfileForm( ModelForm ):
class Meta:
model = Profile

class UserProfile ( UserForm, ProfileForm )
 class Meta( UserForm.Meta, ProfileForm.Meta)
  exclude = ('user',)

It only inherits UserForm

Is there a way to create one form using 2 modelform or to have
ProfileForm inherit from UserForm and add
Profile form data. Something like this

class ProfileForm( UserForm )
 class ( UserForm.Meta ):
  model = Profile





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



Re: Django E-Commerce Framework

2011-12-06 Thread CrabbyPete
Roll your own and use packages like django-authorize and django-paypal
they are easy to use and don't bring along lots of baggage.

On Dec 6, 8:19 am, Andre Terra  wrote:
> I haven't worked with either one of them, but satchmo[1] is also often
> mentioned.
>
> Django packages also has a list of e-commerce tools for django [2].
>
> Hope that helps!
>
> Cheers,
> AT
>
> [1]http://www.satchmoproject.com/
> [2]http://djangopackages.com/grids/g/ecommerce/
>
> On Tue, Dec 6, 2011 at 10:55 AM, Reinout van Rees wrote:
>
>
>
>
>
>
>
> > On 06-12-11 06:40, Md,Mehedi Hasan Kabir(Tanim) wrote:
>
> >> Can anyone give me some suggestion/link for Django E-Commerce Framework?
>
> > No personal experience, but the one I see mentioned most often: django
> > lightning fast shop.http://www.getlfs.com/
>
> > Reinout
>
> > --
> > Reinout van Rees                    http://reinout.vanrees.org/
> > rein...@vanrees.org            
> > http://www.nelen-schuurmans.**nl/
> > "If you're not sure what to do, make something. -- Paul Graham"
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-users@googlegroups.com.
> > To unsubscribe from this group, send email to django-users+unsubscribe@**
> > googlegroups.com .
> > For more options, visit this group athttp://groups.google.com/**
> > group/django-users?hl=en
> > .

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



Re: One from from multiple models using ModelForm

2011-12-06 Thread CrabbyPete
That is to bad. I have a project that I use mongodb and mongotools and
I can do the following with one form and it works great. I wonder if
any other form tools can do it

class UserForm ( MongoForm ):
class Meta:
document = User
fields = ('first_name','last_name')


class ProfileForm ( UserForm ):
class Meta(UserForm.Meta):
document = Profile

On Dec 4, 11:56 am, akaariai  wrote:
> On Dec 4, 6:05 pm,CrabbyPete wrote:
>
>
>
>
>
>
>
>
>
> > I wanted to combine two models into one form so I created the
> > following
>
> > class UserForm( ModelForm ):
> >     class Meta:
> >         model = User
> >         fields = ('email','first_name','last_name')
>
> > class ProfileForm( ModelForm ):
> >     class Meta:
> >         model = Profile
>
> > class UserProfile ( UserForm, ProfileForm )
> >      class Meta( UserForm.Meta, ProfileForm.Meta)
> >           exclude = ('user',)
>
> > It only inherits UserForm
>
> > Is there a way to create one form using 2 modelform or to have
> > ProfileForm inherit from UserForm and add
> > Profile form data. Something like this
>
> I don't think that is possible.
>
> You will need to use both forms separately, and if you need combined
> validation or something like that, then do that in your view code. You
> can create a wrapper class which behaves mostly like a form, but
> delegates the actions to the two underlying forms. (eg is_valid():
> return form1.is_valid() and form2.is_valid()). Making it behave
> exactly like a single form will be hard.
>
>  - Anssi

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



Re: Django E-Commerce Framework

2011-12-07 Thread CrabbyPete
There are lots of good payment packages you can use. I'm using this
one https://bitbucket.org/adroll/authorize/wiki/Home for CIM services
with Authorize.Net, but
there are lots of good packages you can use and its really very easy
to implement them. Satchmo is great, but if you really want to
understand and have controll roll your own.  I've also used
https://github.com/johnboxall/django-paypal and it really not hard at
all. I would also like to try this one https://github.com/abunsen/Paython



On Dec 6, 2:50 pm, Denhua  wrote:
> Hi Pete,
>
> Do you mean django-authorizenet?
> I can't find a django-authorize.
>
> Thanks,
> Dennis
>
> On Dec 6, 9:04 am, CrabbyPete  wrote:
>
>
>
>
>
>
>
> > Roll your own and use packages like django-authorize and django-paypal
> > they are easy to use and don't bring along lots of baggage.
>
> > On Dec 6, 8:19 am, Andre Terra  wrote:
>
> > > I haven't worked with either one of them, but satchmo[1] is also often
> > > mentioned.
>
> > > Django packages also has a list of e-commerce tools for django [2].
>
> > > Hope that helps!
>
> > > Cheers,
> > > AT
>
> > > [1]http://www.satchmoproject.com/
> > > [2]http://djangopackages.com/grids/g/ecommerce/
>
> > > On Tue, Dec 6, 2011 at 10:55 AM, Reinout van Rees 
> > > wrote:
>
> > > > On 06-12-11 06:40, Md,Mehedi Hasan Kabir(Tanim) wrote:
>
> > > >> Can anyone give me some suggestion/link for Django E-Commerce 
> > > >> Framework?
>
> > > > No personal experience, but the one I see mentioned most often: django
> > > > lightning fast shop.http://www.getlfs.com/
>
> > > > Reinout
>
> > > > --
> > > > Reinout van Rees                    http://reinout.vanrees.org/
> > > > rein...@vanrees.org            
> > > > http://www.nelen-schuurmans.**nl/<http://www.nelen-schuurmans.nl/>
> > > > "If you're not sure what to do, make something. -- Paul Graham"
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "Django users" group.
> > > > To post to this group, send email to django-users@googlegroups.com.
> > > > To unsubscribe from this group, send email to 
> > > > django-users+unsubscribe@**
> > > > googlegroups.com .
> > > > For more options, visit this group athttp://groups.google.com/**
> > > > group/django-users?hl=en<http://groups.google.com/group/django-users?hl=en>
> > > > .

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



Iterable check boxes

2011-12-15 Thread CrabbyPete
According to the documentation I can iterate radio buttons
{% for radio in myform.beatles %}

{{ radio }}

{% endfor %}

I want to do the same for checkboxes, but get
TemplateSyntaxError
Exception Value:

Caught TypeError while rendering: 'BoundField' object is not iterable

My field is

class CategoryForm( forms.Form ):
   standard= forms.MultipleChoiceField( required = False,
 choices=[],
 widget =
forms.CheckboxSelectMultiple( attrs= {'class':"chkboxdiv"} )
   )

and I initialize it with
   def __init__(self, *args, **kwargs):
super( CategoryForm, self).__init__(*args, **kwargs)
self.fields['standard'].choices = [(i.interest,i.interest) for
i in Interest.objects.filter( status = 'standard')]

Is it possible to iterate over this in the template so I can place
every choice in a 

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



Show deactived radio button on a form

2011-12-30 Thread CrabbyPete
I have the following form:

DEAL_CHOICES = [
('Standard','Standard'),
('Sponsored','Sponsored'),
('Trial' ,'Trial')
   ]

class ApplyForm(forms.Form):

deal_type= forms.ChoiceField( required = True,
  choices=DEAL_CHOICES,
 
widget=forms.RadioSelect(attrs={'class':"termscode"})
)

def __init__(self, *args, **kwargs):
super(ApplyForm, self).__init__(*args, **kwargs)

If a trial is no longer available, I want to show it, but as a
deactivated choice. Can I do it, and is there a way to pass argument
to the init function to tell it to do so?

I tried ApplyForm( trial = False), but it causes the super(ApplyForm,
self).__init__(*args, **kwargs)
to blow up.



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



django uwsgi

2011-04-30 Thread CrabbyPete
I am trying to deploy a django project with nginx and uwsgi. I think I
have it all set up right but when I hit the site I get the following
error:

No module named project.urls

I know everything else is working because I still have debug on and
can see that settings.py is being read.
I know I'm forgetting something stupid but I can't figure it out so
any help appreciated.

Here is the wsgi.py file I am running:

import os
import sys

from os.path import abspath, dirname, join
from site import addsitedir

PROJECT_ROOT = abspath(dirname(__file__))

addsitedir(PROJECT_ROOT)
os.environ['DJANGO_SETTINGS_MODULE']='settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

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



Re: django uwsgi

2011-04-30 Thread CrabbyPete
Thanks Shawn,
That is exactly what it is. I could have added one path up. I just
changed my
ROOT_URLCONF = 'urls' instead of ROOT_URLCONF = 'project.urls' in my
settings and it works fine.

On Apr 30, 1:42 pm, Shawn Milochik  wrote:
> It sounds like your project directory is not on your PYTHONPATH, so when
> settings tries to import your default urls.py it fails.
>
> I'm not familiar with uwsgi, so maybe that's what the addsitedir is
> supposed to do, but other wsgi files I've seen there's always been a
> line like sys.path.append(project_path).

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



Update a user profile after LInkedin Oauth

2011-05-20 Thread CrabbyPete
I am trying to update a user profile of an existing user with a
LinkedIn profile. My problem is I need an email address, but LinkedIn
does not give you that information. So I have a user create an account
with their email address and ask if they want to link their profile to
their LinkedIn profile. The problem is that the way Oauth works is
that it uses a call back and there is no way to link the user who
initiated the Oauth call to the call back coming from LinkedIn. If you
look at the request.user its Anonymous.

Does anyone have an idea how to get around 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django-linkedin & oauth2

2011-05-21 Thread CrabbyPete
I took the code below from django-linked in which is code from
oauth2.  It works but does not do the callback.
How do you set the call back from oauth2

# from settings.py
consumer = oauth.Consumer(settings.LINKEDIN_TOKEN,
settings.LINKEDIN_SECRET)
client = oauth.Client(consumer)

request_token_url = 'https://api.linkedin.com/uas/oauth/requestToken'
access_token_url = 'https://api.linkedin.com/uas/oauth/accessToken'
authenticate_url = 'https://www.linkedin.com/uas/oauth/authenticate'

def oauth_login(request):
# Step 1. Get a request token from Provider.
resp, content = client.request(request_token_url, "GET")
if resp['status'] != '200':
raise Exception("Invalid response from Provider.")

# Step 2. Store the request token in a session for later use.
request.session['request_token'] = dict(cgi.parse_qsl(content))

# Step 3. Redirect the user to the authentication URL.
url = "%s?oauth_token=%s" % (authenticate_url,
request.session['request_token']['oauth_token'])

return HttpResponseRedirect(url)

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



save and restore session

2011-05-24 Thread CrabbyPete
I'm trying to access LinkedIn using Oauth. I don't want to log in with
it, just get user info from it. I'm using a call back which creates an
anonymous session on the callback. I want to save the session of the
user who initiated the callback. Is there a way to save a session and
then restore it back to the original user.

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



Re: Djungo on Microsoft IIS

2011-06-15 Thread CrabbyPete
Yaroslav,

I tried and tried to get Django to work with IIS on my Windows Server,
but could not get it to work. I would love to know how you did it. I
finally gave up and installed Apache on Windows. Will this work with
an existing Django project?

Pete

On Jun 15, 2:52 am, Yaroslav Govorunov  wrote:
> Hello!
>
> We have recently developed a solution to install and run Django
> applications on Microsoft IIS. Here is the link:  
> http://www.helicontech.com/zoo/
>
> Currently IIS 7, 7.5 and IIS Express are supported.  We expect to
> demonstrate production level performance in this environment on
> release. To use the solution you will need to install Web Platform
> Installer, as shown on the page, then click on "Blank Django Project"
> and after installation is completed overwrite this blank project with
> a real one or start development from this point.
>
> Please help us to beta-test our solution. We need to collect some
> statistic on how real Django application is operating in IIS
> environment.  Please direct either success or fail reports to
> supp...@helicontech.com or tweet using #heliconzoo 
> hashtag:http://twitter.com/?status=%23heliconzoo
>
> Thanks in advance!
>
> Yaroslav Govorunov
> Helicon Techhttp://www.helicontech.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django form radio input layout

2011-07-14 Thread CrabbyPete
I am trying to do the same thing. Did you ever get a response?

On Jun 16, 11:55 am, NateB  wrote:
> Hello all,
>
> I posted this to stackoverflow a couple weeks ago, but I have yet to get any
> takers.  I was able to backburner this for a little bit, but I'd like to see
> it wrapped up.
>
> In my form class, I have a forms.ChoiceField whose widget is a
> forms.RadioSelect widget, one of whose choices needs to be presented with an
> inline text input (which is also a field in the form). I'm using custom
> validation to ignore the text field when itsradiochoice is not selected.
> When rendered, I want it to appear like below:
>
> 
>  name="rad" /> No Textbox
>  name="rad" /> One Textbox:  />
> 
>
> However, I can't simply produce this in my template, because theradio
> choices are not exposed. I can't see a way to do this without tightly
> coupling my form to my template, or alternately, putting all of the
> presentation logic in the form class. What is the right way to solve this
> problem?
>
> I'm a much better backend programmer than web designer, and I'm on this
> project alone, so maybe it's a lack of education - is what I described
> simply poor design? Should I just be designing this a different way? I'm
> really open to any suggestion here that will help me move past this.
>
> If you're a stackoverflow user, and you'd like 15 rep for 
> answering,http://stackoverflow.com/questions/6218299/django-form-radio-input-la...
> the question is here
> --
> View this message in 
> context:http://old.nabble.com/django-form-radio-input-layout-tp31862033p31862...
> Sent from the django-users mailing list archive at Nabble.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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: django form radio input layout

2011-07-16 Thread CrabbyPete
Here is the closest snippet I found that works well for using 1 other
field. I have 2 other fields and I guess I'll try to modify it. If you
have any other snippets
or suggestions please let me know.

http://djangosnippets.org/snippets/863/



On Jul 14, 3:56 pm, Bill Freeman  wrote:
> Unless things have changed, the trouble is that the individual bound fields
> aren't all in existence at the same time, but are created and discarded
> one at a time as the outer widget iterates the choices.  I once uploaded
> a snippet for a template tag that performed the iteration, allowing finer
> styling control.  I've forgotten the details, or the pointer to my snippet,
> but such a tag could let you iterate template code for each button, rendering
> what you want, having recognized, say, the value of the button field that
> you want to render differently in a template ifequal, or equivalent.  Of 
> course
> you are also then stuck with self rendering the whole Form, unless you put
> everything else in one Form, and this in another, but all within the same
> "form" tag so that they are submitted together.  Your view needs to be aware
> of the two forms.  But at this point you could just separately render the list
> of choices by hand, leaving the Choice field out of the Form's fields list.  I
> always put my choices lists as Model attributes, so I can make them easily
> accessible in the template, though a suitable iterator method on the Model
> makes the template code cleaner.
>
> I'm liking the last approach best in that things like my template tag had to
> dip into Field internals, so it is fragile across Django versions,
> while rendering
> the special radio collection by hand fits the "explicit is better than 
> implicit
> (magic)" mantra, and doesn't use anything that is likely to change out from
> under you.  (Though adding a suitable iterator method on Choice/MultiChoice
> Fields to the API would not be unwelcome.)
>
> Bill
>
>
>
>
>
>
>
> On Thu, Jul 14, 2011 at 3:10 PM, NateB  wrote:
>
> >CrabbyPetewrote:
>
> >> I am trying to do the same thing. Did you ever get a response?
>
> > I accepted an answer to the one on the stack overflow question I linked to
> > in my previous email - however, it wasn't what I was *really* hoping for
> > (although it definitely works).  Before asking, I spent a long time
> > searching through the Django code, and I couldn't come up with a clean
> > solution (but figured that it was simply my ignorance, because I considered
> > that a weird oversight).  I get the impression now that there *is* no easy,
> > pretty way of doing it, just a circuitous, not-so-pretty way of doing it.
> > --
> > View this message in 
> > context:http://old.nabble.com/django-form-radio-input-layout-tp31862033p32063...
> > Sent from the django-users mailing list archive at Nabble.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 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

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



Re: django form radio input layout

2011-07-16 Thread CrabbyPete
I found a snippet that does what I want. 
http://djangosnippets.org/snippets/1377/

The documentation for it isn't great, and you have to edit it using
snippet 863 as a base.
His example does not work either but I got it to work like this

 terms   = ChoiceWithOtherField( choices = [ ('a','Until
Cancel', forms.RadioSelect),
 
('b','Until Date',   forms.DateInput),
 
('c','Until Count',  forms.TextInput)
   ] )

On Jul 16, 10:08 am, CrabbyPete  wrote:
> Here is the closest snippet I found that works well for using 1 other
> field. I have 2 other fields and I guess I'll try to modify it. If you
> have any other snippets
> or suggestions please let me know.
>
> http://djangosnippets.org/snippets/863/
>
> On Jul 14, 3:56 pm, Bill Freeman  wrote:
>
>
>
>
>
>
>
> > Unless things have changed, the trouble is that the individual bound fields
> > aren't all in existence at the same time, but are created and discarded
> > one at a time as the outer widget iterates the choices.  I once uploaded
> > a snippet for a template tag that performed the iteration, allowing finer
> > styling control.  I've forgotten the details, or the pointer to my snippet,
> > but such a tag could let you iterate template code for each button, 
> > rendering
> > what you want, having recognized, say, the value of the button field that
> > you want to render differently in a template ifequal, or equivalent.  Of 
> > course
> > you are also then stuck with self rendering the whole Form, unless you put
> > everything else in one Form, and this in another, but all within the same
> > "form" tag so that they are submitted together.  Your view needs to be aware
> > of the two forms.  But at this point you could just separately render the 
> > list
> > of choices by hand, leaving the Choice field out of the Form's fields list. 
> >  I
> > always put my choices lists as Model attributes, so I can make them easily
> > accessible in the template, though a suitable iterator method on the Model
> > makes the template code cleaner.
>
> > I'm liking the last approach best in that things like my template tag had to
> > dip into Field internals, so it is fragile across Django versions,
> > while rendering
> > the special radio collection by hand fits the "explicit is better than 
> > implicit
> > (magic)" mantra, and doesn't use anything that is likely to change out from
> > under you.  (Though adding a suitable iterator method on Choice/MultiChoice
> > Fields to the API would not be unwelcome.)
>
> > Bill
>
> > On Thu, Jul 14, 2011 at 3:10 PM, NateB  wrote:
>
> > >CrabbyPetewrote:
>
> > >> I am trying to do the same thing. Did you ever get a response?
>
> > > I accepted an answer to the one on the stack overflow question I linked to
> > > in my previous email - however, it wasn't what I was *really* hoping for
> > > (although it definitely works).  Before asking, I spent a long time
> > > searching through the Django code, and I couldn't come up with a clean
> > > solution (but figured that it was simply my ignorance, because I 
> > > considered
> > > that a weird oversight).  I get the impression now that there *is* no 
> > > easy,
> > > pretty way of doing it, just a circuitous, not-so-pretty way of doing it.
> > > --
> > > View this message in 
> > > context:http://old.nabble.com/django-form-radio-input-layout-tp31862033p32063...
> > > Sent from the django-users mailing list archive at Nabble.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 
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/django-users?hl=en.

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



Re: Static Files on IIS7

2011-07-23 Thread CrabbyPete
Have you got django to run on II7 at all. I tried it and was not able
to get it to work. If you did I'd love to try it and see what comes up
with it.

On Jul 22, 7:46 am, The Ape  wrote:
> Hi,
>
> I am running Django (1.3) with PyISAPIe (Python 2.6.6) on IIS7.
> I am using the Django tutorial pages as test sites. Now when I am
> trying to access the adminsite,
> the site is loaded without the static files (loaded via IIS7).
> When I use the Django development server the site is rendered
> perfectly.  Templates are found...
>
> Hope someone can help me.
>
> Thanks!
>
> my settings look like this:
>
> STATIC_ROOT = ''
> STATIC_URL = '/static/'
> ADMIN_MEDIA_PREFIX = '/static/admin/'
> STATICFILES_DIRS = (
> )
>
> STATICFILES_FINDERS = (
>     'django.contrib.staticfiles.finders.FileSystemFinder',
>     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
> #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
> )
>
> TEMPLATE_DIRS = (
>     "C:/PATH/Django Pages/templates".
> )
>
> My ISAPI config:
>
> from django.core.handlers.wsgi import WSGIHandler as DjangoHandler
> os.environ["DJANGO_SETTINGS_MODULE"] = "mysite.settings"
> os.environ["django.root"] = "/mysite"
>
> sys.path.append(r'C:\PATH\django')
> sys.path.append(r'C:\PATH\django\contrib\admin')
> sys.path.append(r'C:\PATH\Django Pages')
> sys.path.append(r'C:\PATH\Django Pages\mysite')
> sys.path.append(r'C:\PATH\Django Pages\mysite\polls')
> sys.path.append(r'C:\PATH\Django Pages\templates')
> sys.path.append(r'C:\PATH\Django Pages\static')
> ROOT_URLCONF = 'mysite.urls'

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



Re: django & py2exe

2011-07-24 Thread CrabbyPete

I've been doing this with no problem here is the top of my routine
that runs on its own. After this just write what code you want to run

import os, sys
from os.pathimport abspath, dirname, join,split
from site import addsitedir

# Set up the environment to run on it own.
APP_ROOT, tail = split(abspath(dirname(__file__)))
PROJECT_ROOT, tail = split(APP_ROOT)

sys.path.insert(0,PROJECT_ROOT)
sys.path.insert(0,APP_ROOT)

from django.core.management import setup_environ
import settings
setup_environ(settings)


On Jul 23, 9:15 pm, Gelonida N  wrote:
> On 07/22/2011 04:15 PM, Alexey Luchko wrote:
>
>
>
>
>
>
>
> > On 22.07.2011 02:59, Gelonida N wrote:
> >> Another issue, that I had is trying to use django under windows with
> >> py2exe.
>
> >> Management commands are no more found, as django would require the
> >> python source code in order to find existing management commands.
>
> >> Perhaps there is an easy  work around, but I am not aware of one.
>
> > Same here.
>
> > I far as I can see it requires some changes to
> > django/core/management/__init__.py
>
> > You could try a hack filling django.core.management._commands manually
> > in your project's manage.py.
>
> > But for a project's prototype I've just created a script that imports
> > settings and then calls a manage command manually like that:
> >     from django.core.management.commands import syncdb
> >     syncdb.Command().execute()
>
> I did the same for one  management command.
> What's even worse is, that even standard management commands like
> 'syncdb' are  lost during the creation of py2exe of one doesn't
> reregister them manually
>
> The clean fix might be a rewrite of django/core/management/__init__.py
>
>
>
>
>
>
>
> > --
> > Best regards,
> > Alexey.

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



Re: Django, Apache, MySQL on Windows in Production

2011-07-26 Thread CrabbyPete
I've run django on Windows Server with apache and it was easy to
deploy.  Forget IIS. I've deployed Nginx and uWSGI on linux and that
was even easier.
I've never done Nginx on windows, but I don't think it would be a big
deal.

On Jul 26, 1:25 pm, Dimitry Zolotaryov  wrote:
> So if I run into performance issues, I can always pipe from Apache to
> something like gunicorn and keep Apache serving static media?
>
> Dimitry
>
> On 26 juil, 13:03, Javier Guerra Giraldez  wrote:
>
>
>
>
>
>
>
> > On Tue, Jul 26, 2011 at 11:33 AM, Dimitry Zolotaryov  
> > wrote:
> > > Knowing this, any advice on the original question would be greatly
> > > appreciated.
>
> > I haven't done any deployment on windows; but i do know some helpful facts:
>
> > - microsoft invests a lot of money in making sure that high-profile
> > OSS projects do run and run well on windows.  That definitely includes
> > Apache, Python, and MySQL at least.   don't know if PostgreSQL enjoys
> > this treatment (might erode into MS-SQL server mindshare?)
>
> > - nginx and mod_wsgi can be compiled, and kinda run; but with severe
> > limitations.  mod_wsgi in particular can't run in daemon mode.
>
> > - any pure-Python setting should run without surprises, that lets you
> > choose either gunicorn or flup (for FastCGI) behind Apache.  contrary
> > to some comments, a well-supervised flup setup can perform just as
> > good as the cool guys; but if you're not familiar with it gunicorn
> > might be easier.  again, it's more a question of familiarity than of
> > performance.
>
> > good luck!
>
> > --
> > Javier

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



Re: Django, Apache, MySQL on Windows in Production

2011-07-26 Thread CrabbyPete
PS, I used mod_wsgi and make sure you have the latest pywin32

On Jul 26, 2:03 pm, CrabbyPete  wrote:
> I've run django on Windows Server with apache and it was easy to
> deploy.  Forget IIS. I've deployed Nginx and uWSGI on linux and that
> was even easier.
> I've never done Nginx on windows, but I don't think it would be a big
> deal.
>
> On Jul 26, 1:25 pm, Dimitry Zolotaryov  wrote:
>
>
>
>
>
>
>
> > So if I run into performance issues, I can always pipe from Apache to
> > something like gunicorn and keep Apache serving static media?
>
> > Dimitry
>
> > On 26 juil, 13:03, Javier Guerra Giraldez  wrote:
>
> > > On Tue, Jul 26, 2011 at 11:33 AM, Dimitry Zolotaryov  
> > > wrote:
> > > > Knowing this, any advice on the original question would be greatly
> > > > appreciated.
>
> > > I haven't done any deployment on windows; but i do know some helpful 
> > > facts:
>
> > > - microsoft invests a lot of money in making sure that high-profile
> > > OSS projects do run and run well on windows.  That definitely includes
> > > Apache, Python, and MySQL at least.   don't know if PostgreSQL enjoys
> > > this treatment (might erode into MS-SQL server mindshare?)
>
> > > - nginx and mod_wsgi can be compiled, and kinda run; but with severe
> > > limitations.  mod_wsgi in particular can't run in daemon mode.
>
> > > - any pure-Python setting should run without surprises, that lets you
> > > choose either gunicorn or flup (for FastCGI) behind Apache.  contrary
> > > to some comments, a well-supervised flup setup can perform just as
> > > good as the cool guys; but if you're not familiar with it gunicorn
> > > might be easier.  again, it's more a question of familiarity than of
> > > performance.
>
> > > good luck!
>
> > > --
> > > Javier

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



South

2011-08-11 Thread CrabbyPete
I've used South and I love it, but when I ran it for my latest
database I got this


C:\> manage.py migrate base

Running migrations for base:
 - Migrating forwards to 0001_initial.
 > base:0001_initial
 ! Error found during real run of migration! Aborting.

 ! Since you have a database that does not support running
 ! schema-altering statements in transactions, we have had
 ! to leave it in an interim state between migrations.

! You *might* be able to recover with:   = DROP TABLE `base_profile`
CASCADE; []
...

 ! The South developers regret this has happened, and would
 ! like to gently persuade you to consider a slightly
 ! easier-to-deal-with DBMS.
 ! NOTE: The error which caused the migration to fail is further up.

Do I have to redesign my schema or is there a way around this. Should
I try
nashvegas

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



template newlines

2011-08-13 Thread CrabbyPete
I'm using the django template system for format a text email. I send
it a dictionary and it formats the output. The problem is that it
inserts lots of newlines

Here is the template, and reports is a dictionary that contains an
event and a dictionary of interests

Weekly Contact List For {{date}}
{% for event, interests in report.items %}
{% if interests|length > 0 %}
{{event}}
{% for interest, value in interests.items %}
{{ value }} {% if value == 1 %} lead {% else %} leads {%
endif %} for {{ interest }}
{% endfor %}
{% endif %}
{% endfor %}

Is there a way for it just to print the lines without adding all the
extra blank lines when interests = 0?

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



Re: template newlines

2011-08-14 Thread CrabbyPete
Even if there are no if interests|length > 0  I get the extra
whitespaces. Sam is correct. I've used Jinja2 before and used the - to
remove unnecessary lines.
I have lots of templates written for django, so I don't want to
retrofit them all. Worse case I could post process the message, but I
would love it if django support this feature in its template engine.

On Aug 14, 9:19 am, Python_Junkie 
wrote:
> If you have a solution that is fine.
>
> But if you did the business logic in the view, there is no need for
>
> {%- if interests|length > 0 %}   and you would  simply return your
> dictionary values while rendening as a variable that contains actual
> values
> and no need for the if statement which provides the extra carriage
> return
>
> {% for event, interests in report.items %}
>            {{event}}
>
> On Aug 14, 7:28 am, Sam Lai  wrote:
>
>
>
>
>
>
>
> > On 14 August 2011 14:00, Python_Junkie  
> > wrote:
>
> > > I think that if you performed the logic to determine if there actually
> > > is something in the interest for that row in the view and
> > > then only pass those components from the view, and not in the template
> > > then your problem goes away.
>
> > I don't think so, but I haven't tested it. Django's template parser
> > does not remove newlines anywhere, even if only a template directive
> > exists on that line. For HTML, this isn't an issue. You can try
> > sacrificing template readability by putting everything on to one line.
>
> > There has been a fair bit of discussion about this, but no consensus
> > was arrived at. For now, the better solution is to use jinja2
> > (http://jinja.pocoo.org/). Its language is based on Django's, and is
> > largely compatible, but it has the added bonus of being able to remove
> > newlines like so,
>
> > {%- if interests|length > 0 %}
> > ...
> > {%- endif %}
>
> > Notice the - after the % sign. This tells jinja2 to remove the
> > previousnewlinecharacter. You can also add them at the closing % to
> > remove the followingnewlinecharacter.
>
> > It is pretty easy to use with Django (and many people do), and you can
> > just use it for this particular template, leaving all others to use
> > Django's in-built templating system.
>
> > > On Aug 13, 8:53 pm,CrabbyPete wrote:
> > >> I'm using the django template system for format a text email. I send
> > >> it a dictionary and it formats the output. The problem is that it
> > >> inserts lots of newlines
>
> > >> Here is the template, and reports is a dictionary that contains an
> > >> event and a dictionary of interests
>
> > >> Weekly Contact List For {{date}}
> > >> {% for event, interests in report.items %}
> > >>     {% if interests|length > 0 %}
> > >>         {{event}}
> > >>         {% for interest, value in interests.items %}
> > >>             {{ value }} {% if value == 1 %} lead {% else %} leads {%
> > >> endif %} for {{ interest }}
> > >>         {% endfor %}
> > >>     {% endif %}
> > >> {% endfor %}
>
> > >> Is there a way for it just to print the lines without adding all the
> > >> extra blank lines when interests = 0?
>
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Django users" group.
> > > To post to this group, send email to django-users@googlegroups.com.
> > > To unsubscribe from this group, send email to 
> > > django-users+unsubscr...@googlegroups.com.
> > > For more options, visit this group 
> > > athttp://groups.google.com/group/django-users?hl=en.

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



Re: django and eclipse

2010-12-30 Thread CrabbyPete
You have to set up the run environment. Make sure on run manage.py and
the parameters are runserver x.x.x.x:000 where x.x.x.x is the server
and :000 is the port you want to run from.  After that it should not
ask anything and run off your settings.

On Dec 29, 7:38 pm, Emmanuel Mayssat  wrote:
> I installed the pydev plugin in eclipse.
> I configured it.
> Imported my django project and it almost works.
>
> Is any one of you using django/eclipse?
>
> Well, all goes well until I start the django development server.
> 1/ how can I change the default port, it is running on ?
> 2/ My sqlite db files is regenerated by the runserver (I had never
> seen  that!) in a different directory (at the project level).
> If I symlink the 2 db files, it works as expected.
> Any clue?
>
> BTW, I noticed that when creating a django project in eclipse, it ask
> for the path to the db files (when using sqlite3)
> It is configured to point to the right location, but runserver doesn't get 
> that.
> So what is this db file path used for ? (settings.py is created but
> not even configured...)
>
> --
> Emmanuel Mayssat

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



Re: New to Django, sheet music organization site

2011-01-03 Thread CrabbyPete
Good Luck. Just start banging it out. You'll see as you go how much
more there is.

On Jan 1, 11:24 pm, Kyle  wrote:
> I am wanting to create an app that helps me organize sheet music. I
> want to be able to sort by the artist. Every piece of sheet music I
> have I want to be scanned in and uploaded as an image file, then when
> I want to open a particular file, it opens as a PDF.
>
> This would be my long terms goals. For now since I am new to Django, I
> just want to simply organize my music and be able to easily sort.
>
> I know I will need:
>
> from django.db import models
>
> class Artist(models.Model):
>         name = models.CharField(max_length=30)
>         genre = models.CharField(max_length=30)
>
> class Song(models.Model):
>         name = models.CharField(max_length=30)
>         artist = models.ForeignKey(Artist)
>
> What else can I do to help me get a start with this? I've gone through
> the tutorial and I understand how Django works, its just a matter of
> getting some hands on experience.
>
> Thanks for any help.

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



Pydev, decorators, and breakpoints

2011-01-03 Thread CrabbyPete
I use pydev to debug my python apps, but I can not break on a
decorated function. Anyone know why and how to fix 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django facebook authentication

2011-01-25 Thread CrabbyPete
I am going nuts this should be simple but I keep getting a
verification error every time in my response in the following code. I
double checked my APP_ID and SECRET  I try the following code. I'm
using python2.5. Any help appreciated.

def login( request ):

parms = { 'client_id': settings.FACEBOOK_APP_ID,
  'redirect_uri': 'http://' + request.get_host() +
request.get_full_path()
}

if 'code' in request.GET:
parms['code'] = request.GET['code']
parms['client_secret'] = settings.FACEBOOK_APP_SECRET
url = 'https://graph.facebook.com/oauth/access_token?' +
urllib.urlencode(parms)

response = urllib.urlopen(url).read()
pdb.set_trace()
response =cgi.parse_qs(response)

if 'access_token' in response:
access_token = response['access_token'][0]
graph = GraphAPI( access_token )
profile = graph.get_object("me")
url = reverse('sites')
url = reverse('sites')

else:
parms['scope'] = 'email,user_location'
url = "https://graph.facebook.com/oauth/authorize?"; +
urllib.urlencode(parms)

return HttpResponseRedirect(url)

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



Re: looking cheap Python/Django/mySQL hosting

2011-01-26 Thread CrabbyPete
http://www.asmallorange.com/

On Jan 26, 12:36 am, GSV  wrote:
> for small project.
>
> Thank you

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



Re: django facebook authentication

2011-01-27 Thread CrabbyPete
Thanks I figured it out. I should just use request.path  I used
request.get_full_path() which returns the whole request including the ?
code=xxx which messed me up.

On Jan 26, 12:07 am, Matias Aguirre  wrote:
> Hi,
>
> Is your request.get_host() the same defined in Facebook app settings? (Web 
> site
> section if I can recall correctly), facebook doesn't accept 127.0.0.1 as
> redirect url and might not accept localhost too.
>
> Check social_auth/backends/facebook.py 
> onhttps://github.com/omab/django-social-auth
> for an example.
>
> Regards,
> Matías
>
> Excerpts fromCrabbyPete'smessage of Wed Jan 26 00:39:05 -0200 2011:
>
> > I am going nuts this should be simple but I keep getting a
> > verification error every time in my response in the following code. I
> > double checked my APP_ID and SECRET  I try the following code. I'm
> > using python2.5. Any help appreciated.
>
> > def login( request ):
>
> >     parms = { 'client_id': settings.FACEBOOK_APP_ID,
> >               'redirect_uri': 'http://' + request.get_host() +
> > request.get_full_path()
> >             }
>
> >     if 'code' in request.GET:
> >         parms['code'] = request.GET['code']
> >         parms['client_secret'] = settings.FACEBOOK_APP_SECRET
> >         url = 'https://graph.facebook.com/oauth/access_token?'+
> > urllib.urlencode(parms)
>
> >         response = urllib.urlopen(url).read()
> >         pdb.set_trace()
> >         response =cgi.parse_qs(response)
>
> >         if 'access_token' in response:
> >             access_token = response['access_token'][0]
> >             graph = GraphAPI( access_token )
> >             profile = graph.get_object("me")
> >             url = reverse('sites')
> >         url = reverse('sites')
>
> >     else:
> >         parms['scope'] = 'email,user_location'
> >         url = "https://graph.facebook.com/oauth/authorize?"; +
> > urllib.urlencode(parms)
>
> >     return HttpResponseRedirect(url)
>
> --
> Matías Aguirre 

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



Facebook session problems.

2011-01-29 Thread CrabbyPete
I managed to log into facebook using the graph api, I store the FB id
and tie it to a User, like this

class FacebookUser(models.Model):
user= models.ForeignKey(User)
fb_uid  = models.CharField( max_length=100, blank = True,
unique = True )
access_token= models.CharField( max_length=100, blank = True,
null   = True )

def __unicode__(self):
if self.user.username == u'':
return str(self.pk)
return self.user.username

after I get the user I do the following:
user = auth.authenticate(username=user.username, password=password)
if user is not None and user.is_active:
auth.login(request, user)

I log in and all is good except I loose the session if I go to another
web site and come back.

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



Re: Facebook session problems.

2011-01-30 Thread CrabbyPete
Thanks, but no. I'm running it on Firefox now.

On Jan 30, 3:43 pm, Aljoša Mohorović 
wrote:
> On Sun, Jan 30, 2011 at 6:30 AM, CrabbyPete  wrote:
> > I log in and all is good except I loose the session if I go to another
> > web site and come back.
>
> if this is facebook canvas app it wont work properly in safari and
> explorer because of some iframe restrictions.
> is this facebook canvas app and you're using safari/explorer?
> if it is i can share more info about possible solutions.
>
> Aljosa Mohorovic

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



Re: Facebook session problems.

2011-01-31 Thread CrabbyPete
I am loosing the django session.

On Jan 31, 8:44 am, "christian.posta" 
wrote:
> Which session are you losing?
> The django authenticated session, or the facebook session?
>
> On Jan 29, 10:30 pm, CrabbyPete  wrote:
>
>
>
>
>
>
>
> > I managed to log into facebook using the graph api, I store the FB id
> > and tie it to a User, like this
>
> > class FacebookUser(models.Model):
> >     user            = models.ForeignKey(User)
> >     fb_uid          = models.CharField( max_length=100, blank = True,
> > unique = True )
> >     access_token    = models.CharField( max_length=100, blank = True,
> > null   = True )
>
> >     def __unicode__(self):
> >         if self.user.username == u'':
> >             return str(self.pk)
> >         return self.user.username
>
> > after I get the user I do the following:
> > user = auth.authenticate(username=user.username, password=password)
> >     if user is not None and user.is_active:
> >         auth.login(request, user)
>
> > I log in and all is good except I loose the session if I go to another
> > web site and come back.
>
> > Any help or advice greatly 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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Facebook session problems.

2011-01-31 Thread CrabbyPete
Its definitely a django thing. It does it on explorer as well. Somehow
the session information is lost. Maybe because it goes out to facebook
to get the log in. I used firebug and I can see the facebook cookies
as well as those for my site.

On Jan 31, 9:33 am, Aljoša Mohorović 
wrote:
> On Mon, Jan 31, 2011 at 2:59 PM, CrabbyPete  wrote:
> > I am loosing the django session.
>
> try setting the P3P on response:
> response['P3P:CP'] = "IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi
> HIS OUR IND CNT"
> it probably wont help but it fixes this issue with explorer so it doesn't 
> hurt.
>
> test if you can use cookies, most session issues in iframe apps are
> cookie related.
> also, try using a different browser just to figure out if it's browser
> related or if it's server-side problem.
>
> Aljosa Mohorovic

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



forms and models

2011-02-04 Thread CrabbyPete
I have the following code:
def sites(request):
if 'url' in request.GET:
url = request.GET['url']

website = WebSite.objects.get( url = url )
form = WebSiteForm(instance = website)

return submit_web_form( request, form )
else:
form = WebSiteForm(request.POST)
if not form.is_valid():
return submit_web_form(request, form)

   

It always come back invalid, and when if feed it back it displays the
error that "name" already exists.
I know it exist, but I want to edit the existing model. Do I have to
load in the data separately
like data = {'name':'blabla.com  and then form =
WebSiteForm( data ) or can I use the instance.

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



Re: How to reinstall Python Interpreters?

2011-02-18 Thread CrabbyPete
I wouldn't reinstall python because of an unresolved import error.
What's unresolved and what type of system are you on PC/Linux?

On Feb 17, 7:48 pm, LJ  wrote:
> I installed the latest version of dajaxice, but I am still getting
> Unresolved import errors.
> My guess is that I need to remove and reinstall the Python
> Interpreters.
> Is there a some documentation somewhere that explains how to reinstall
> the Python Interpreters, so I can resolve all of my Unresolved Import
> errors?

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



Re: How to reinstall Python Interpreters?

2011-02-19 Thread CrabbyPete
Why not just use virtualenv and then just easy_install

I'm using it with python 2.5 and it works great.

On Feb 18, 8:07 pm, lduros  wrote:
> Did you install dajaxice through apt-get? From the command line: sudo
> apt-get install python-django-dajaxice
> If not, you might want to try it it might do the trick of installing
> it in a much easier way than from the sources.
>
> On Feb 18, 5:04 pm, LJ  wrote:
>
> > Just adding a note for anyone else struggling with a similar
> > 'unresolved import' problem...
> > This article explains in details how to modify the PYTHONPATH if you
> > decide to go that route.
> >  http://www.stereoplex.com/blog/understanding-imports-and-pythonpath
> > I don't prefer to use this method, but I now understand how django is
> > able to find imported libraries.
>
> > I am still looking for a good article on how to install/configure a
> > 3rd party app in site packages--or dist-packages on Ubuntu (Python
> > 2.6).
>
> > On Feb 18, 12:39 pm, LJ  wrote:
>
> > > I am on Ubuntu 10, using Python 2.6 and Django 1.2.3.
> > > Mike Ramirez suggested that I look at the site packages (in my case
> > > dist-packages) in my python lib dir.
> > > I did not see anything in there that references dajaxice.  I may need
> > > to manually edit the PYTHONPATH once I figure out how and where.
>
> > > My errors are:
> > > Unresolved import: dajaxice_autodiscover
> > > Unresolved import: dajaxice_functions
>
> > > On Feb 18, 7:17 am, CrabbyPete  wrote:
>
> > > > I wouldn't reinstall python because of an unresolved import error.
> > > > What's unresolved and what type of system are you on PC/Linux?
>
> > > > On Feb 17, 7:48 pm, LJ  wrote:
>
> > > > > I installed the latest version of dajaxice, but I am still getting
> > > > > Unresolved import errors.
> > > > > My guess is that I need to remove and reinstall the Python
> > > > > Interpreters.
> > > > > Is there a some documentation somewhere that explains how to reinstall
> > > > > the Python Interpreters, so I can resolve all of my Unresolved Import
> > > > > errors?

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



  1   2   >