Re: How to choose a license for an app or a project?

2011-05-15 Thread Kenneth Gonsalves
On Sun, 2011-05-15 at 22:10 -0700, Jacob Kaplan-Moss wrote:
> On Sun, May 15, 2011 at 9:58 PM, Kenneth Gonsalves
>  wrote:
> > go read the GPL and stop irritating everyone here.
> 
> Kenneth, that's uncalled-for -- please don't respond to rudeness with
> more rudeness. 

right - monday morning is my only excuse ;-)
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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



Re: How to choose a license for an app or a project?

2011-05-15 Thread Jacob Kaplan-Moss
On Sun, May 15, 2011 at 9:58 PM, Kenneth Gonsalves
 wrote:
> go read the GPL and stop irritating everyone here.

Kenneth, that's uncalled-for -- please don't respond to rudeness with
more rudeness.

It's pretty clear to me that this discussion is incredibly off-topic
and that Bostjan has no interest in respecting our norms. Let's
respond by ignoring him, not stooping to his level.

Jacob

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



Re: How to choose a license for an app or a project?

2011-05-15 Thread Kenneth Gonsalves
On Sun, 2011-05-15 at 21:39 +0200, Boštjan Mejak wrote:
> What if I choose GPL v3 but I don't provide the source code of my
> application? Is that against the GPL v3 policy?
> 
> 

go read the GPL and stop irritating everyone here.
-- 
regards
KG
http://lawgon.livejournal.com
Coimbatore LUG rox
http://ilugcbe.techstud.org/

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



VALUE parameter in SELECT tag in ModelForm

2011-05-15 Thread Vladimir
One of model fields is ForeignKey, a corresponding form field is
ModelChoiceField. VALUE parameter of SELECT tag gets value equal to
primary key. What must I do to provide VALUE parameter equal to
another field?
Thank You very much!

-- 
You received this message because you are subscribed to the Google 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: Overide error messages in models

2011-05-15 Thread Mohd Kamal Bin Mustafa
There's self._meta._fields() that you can call to get a list of fields
defined in that models but all the error_messages property attached to
that field is just a proxy object to something else. I try the
following in model's __init__ but it doesn't has any effect:-

class Thread(models.Model):
field1 = models.CharField(max_length=255)
field2 = ...
def __init__(self, *args, **kwargs):
super(Thread, self).__init__(*args, **kwargs)
for f in self._meta._fields():
if 'blank' in f.error_messages:
f.error_messages['blank'] = 'Needed.'

sorry can't dig further ...

-- 
You received this message because you are subscribed to the Google 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: Overide error messages in models

2011-05-15 Thread Shawn Milochik

On 05/15/2011 08:03 PM, Daniel França wrote:

I don't know if I understood, but the example you posted is about forms,
right?
That's the point, I don't wanna need to write forms to modify error
messages.


Yeah, it looks like the link I posted was about forms. I got a bit 
turned around after looking at the code for the field class:

http://code.djangoproject.com/browser/django/trunk/django/db/models/fields/__init__.py

If you look there you'll see that there's a default_error_messages 
property of the Field base class that's inherited by all of your fields. 
It's not clear to me from that code how you should be overriding your 
field, or whether you can do it from a standard model declaration, but 
play with that. If you don't get it working then re-post asking for 
specifics based on what you find. Or maybe some knowledgeable person 
will read my half-baked info here and jump in with exactly what you need.


Shawn


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



Re: how to list all model classes within admin that extends another model?

2011-05-15 Thread garagefan
basically speaking, i want a class' admin page w/ it's list of entries
listed on the client page.

so, every class object that has a Client pk foreign field relationship
is listed on that Client's admin page whether it is a portfolio
object, an invoice object, or any future class i create that gets a
foreign field relationship to Client

On May 15, 8:29 pm, garagefan  wrote:
> yeah, i've changed things around just slightly and included a
> tabularinline
>
> however, now i need to modify the template to display a link to each
> of the items pages, b/c as is it only allows one to update the name of
> the clientobject, which is now:
>
> class ClientObject(models.Model):
>   client = models.ForeignKey(Client)
>   name = models.CharField(max_length=250)
>   def __unicode__(self):
>     return self.name
>
> i would like each ClientObject listed to link to it's admin page.
> Right now i just have the portfolio application w/ the Portfolio class
> extending the ClientObjects class. Ultimately, i also wouldnt mind a
> list of classes that extend the ClietObjects class to be listed w/ an
> "add blahblahblah" to client link that pops open an admin popup
>
> On May 15, 7:42 pm, Shawn Milochik  wrote:
>
>
>
>
>
>
>
> > Try this:
>
> >http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contri...

-- 
You received this message because you are subscribed to the Google 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 problem in creating server

2011-05-15 Thread Shawn Milochik

On 05/15/2011 08:16 PM, MOHAK R wrote:

while creating a django server i am getting import receiver not
found...
i have followed all the installation process properly as mentioned in
documentation.
and my os is mac osx.


Traceback or it didn't happen. ;o)

--
You received this message because you are subscribed to the Google 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 problem in creating server

2011-05-15 Thread MOHAK R
while creating a django server i am getting import receiver not
found...
i have followed all the installation process properly as mentioned in
documentation.
and my os is mac osx.

-- 
You received this message because you are subscribed to the Google 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 list all model classes within admin that extends another model?

2011-05-15 Thread garagefan
yeah, i've changed things around just slightly and included a
tabularinline

however, now i need to modify the template to display a link to each
of the items pages, b/c as is it only allows one to update the name of
the clientobject, which is now:

class ClientObject(models.Model):
  client = models.ForeignKey(Client)
  name = models.CharField(max_length=250)
  def __unicode__(self):
return self.name

i would like each ClientObject listed to link to it's admin page.
Right now i just have the portfolio application w/ the Portfolio class
extending the ClientObjects class. Ultimately, i also wouldnt mind a
list of classes that extend the ClietObjects class to be listed w/ an
"add blahblahblah" to client link that pops open an admin popup

On May 15, 7:42 pm, Shawn Milochik  wrote:
> Try this:
>
> http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contri...

-- 
You received this message because you are subscribed to the Google 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: Overide error messages in models

2011-05-15 Thread Daniel França
I don't know if I understood, but the example you posted is about forms,
right?
That's the point, I don't wanna need to write forms to modify error
messages.

On Thu, May 12, 2011 at 10:54 PM, Shawn Milochik  wrote:

> On 05/12/2011 09:35 PM, Daniel França wrote:
>
>> I wanna change the error messages without to need to rewrite fields code,
>> to
>> be more specific I want to translate them...
>>
>>
> Did you try setting the error_messages value?
>
> http://docs.djangoproject.com/en/1.3/ref/forms/validation/#using-validators
>
> There's a full example in this document, using e-mail field as an example.
> It's also translation-friendly, if you follow the convention of importing
> ugettext_lazy as _ (underscore) and using it in your model.
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: how to list all model classes within admin that extends another model?

2011-05-15 Thread Shawn Milochik

Try this:

http://docs.djangoproject.com/en/1.3/ref/contrib/admin/#django.contrib.admin.InlineModelAdmin

--
You received this message because you are subscribed to the Google 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: MEDIA and STATIC in a nutshell?

2011-05-15 Thread Eiji Kobayashi
Shawn,

Thank you. For the compliment and your help. I'll try putting the static
folder in my apps and try.

Yes, the Japanese documentation is still stuck in 1.0, but there are other
places to look. But I often use the English docs as last resort, because the
language is so difficult for us. I have a feeling other international people
who are interested in Django do the same. I'm going to see if I can help in
the update process.

That's a shame because I think django/python offers a lot more than
ruby/rails, which has much better up-to-date documentation in Japan by the
way. I guess I'm just black sheep.

Thank you again.

Eiji

On Sat, May 14, 2011 at 5:02 PM, Shawn Milochik  wrote:

> Eiji,
>
> Sorry to hear about the Japanese translation being out-of-date. I just
> checked and saw that it's extremely old. The development of Django moves too
> quickly to rely on static documentation. I don't know of any alternatives to
> the English version if you want to remain current, but in any case your
> English is very good, so at least you should be able to get by, and this
> list is usually a big help.
>
> Shawn
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google 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: flushing correctly the db

2011-05-15 Thread Shawn Milochik

On 05/15/2011 05:00 PM, manaus wrote:

Hello,
I had to change one of the models, did flush and syncdb, but still the view
returns 'integrity error, myapp_user.town_id may not be NULL, the field
seems to be still there. What can I do? (using sqlite3)


Thanks!


1. syncdb doesn't do anything to existing models. You have to use South.
http://south.aeracode.org/

2. sqlite3 doesn't support deleting fields.

3. If you don't mind flushing the database then just delete the sqlite3 
database and start over.



--
You received this message because you are subscribed to the Google 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.



flushing correctly the db

2011-05-15 Thread manaus
Hello, 
I had to change one of the models, did flush and syncdb, but still the view 
returns 'integrity error, myapp_user.town_id may not be NULL, the field 
seems to be still there. What can I do? (using sqlite3)


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.



how to list all model classes within admin that extends another model?

2011-05-15 Thread garagefan
building a client management application for myself

in one application model, called client_management, i have
class Client(models.Model):
  active = models.BooleanField(_('active client'), default=False)
  name = models.CharField(max_length=250)
  logo = models.ImageField(upload_to="logos")
  def __unicode__(self):
return self.name

class ClientObject(models.Model):
  class Meta:
abstract = True

in my portfolio app i have:

class Portfolio(ClientObject):
  client = models.ForeignKey(Client)
  active = models.BooleanField(_('active portfolio'), default=False)
  category = models.ForeignKey(PortfolioCategory)
  name = models.CharField(max_length=250)

within the main client_management application's Client within the
admin i want to list all apps, like Portfolio, that extend
ClientObject whose client foreign key is the current Client.

IE:

within a Client within the Client_Management in the admin i'd get a
link that says "add portfolio" perhaps with a list of portfolios
already added.

eventually i'd like to extend this with more client applications, like
invoices and notes, etc... plus unknown future applications, so i'd
like it to work without anything more than creating a class that
extends ClientObject

-- 
You received this message because you are subscribed to the Google 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 migrate user submitted data to new table upon approval

2011-05-15 Thread Shawn Milochik

If you want help you'll need to provide us information we can work with.

What error message are you getting? Have you checked to see if the 
application generates any logs?


What changed from when it was working until now? Was anything on the 
server removed or upgraded?


If there's any documentation for your particular app it's going to be 
something within your company.


If you need to make a new object from another object, try this snippet, 
assuming the fields are the same in both models.

http://djangosnippets.org/snippets/1040/

Shawn

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



How to migrate user submitted data to new table upon approval

2011-05-15 Thread fyoung
I took over a django project in which a user can submit a business and
then the administrator can approve the business. From my
understanding, once the business is approved, it moves from the
'UserSubmittedBusiness' table to the 'Business' table. However, this
is no longer working. I would like to know if anyone has any advice or
can point me to documentation showing how to do this. Also, if there
is a more efficient way of doing this please let me know.

Thanks,

Frank

-- 
You received this message because you are subscribed to the Google 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 choose a license for an app or a project?

2011-05-15 Thread Boštjan Mejak
What if I choose GPL v3 but I don't provide the source code of my
application? Is that against the GPL v3 policy?

-- 
You received this message because you are subscribed to the Google 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 choose a license for an app or a project?

2011-05-15 Thread Bjarni Rúnar Einarsson
On Sat, May 14, 2011 at 7:39 PM, Boštjan Mejak wrote:

> Say I create an app in Python and wxPython (a Python GUI framework). And
> then I upload my installation binaries (binaries created with py2exe and
> setup made with Inno Setup) to, say, Google Code. I don't want to dislose my
> source code. I just want my users to download the setup program and use my
> program at their will. What license would you give in such a case? And also,
> where would you put the license? Would you, in this particular case, even
> give a license?


If you don't want to disclose source code, you don't want to use an open
source license.  You do still need to take care to comply with the licenses
of any code you use however, so be sure you don't use any GPL'ed code or
libraries in your app.

You may want to use some proprietary license, but as I have no interest in
proprietary software, I have no advice for you there.  I suggest you talk to
a lawyer, getting legal advice from a mailing list of volunteers is not a
great idea.

Also, note that your source code will still be visible even if packaged with
py2exe, unless you use some form of obfuscation.

-- 
Bjarni R. Einarsson
The Beanstalks Project ehf.

Making personal web-pages fly: http://pagekite.net/

-- 
You received this message because you are subscribed to the Google 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: boolean default

2011-05-15 Thread Christophe Pettus

On May 15, 2011, at 2:15 PM, Greg Donald wrote:

> How do I set a default for a BooleanField() ?
> 
> I tried
> 
> foo = models.BooleanField( default=False )
> 
> 
> but that only produces
> 
> foo boolean NOT NULL,

The default= parameter in Django doesn't generate a DEFAULT in the SQL; the 
default is implemented in the Django ORM.

--
-- Christophe Pettus
   x...@thebuild.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.



boolean default

2011-05-15 Thread Greg Donald
How do I set a default for a BooleanField() ?

I tried

foo = models.BooleanField( default=False )


but that only produces

foo boolean NOT NULL,


Docs do not mention how as far as I can tell

http://docs.djangoproject.com/en/1.3/ref/models/fields/#booleanfield




-- 
Greg Donald
destiney.com | gregdonald.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: Error after updating to Django version 1.3

2011-05-15 Thread Mishen'ka
I have found the sollution ..
Since version 1.3 i need to set the setting LOGGING_CONFIG

I placed LOGGING_CONFIG = None

in settings.py and now it works

On May 15, 7:36 pm, "Mishen'ka"  wrote:
> Hello everyone,
>
> I was updating my Django version to version 1.3
>
> And i get a error where i cant find the reason.
> I have nothing more then this message:
>
> MOD_PYTHON ERROR
>
> ProcessId:      3138
> Interpreter:    'server1.lokaal'
>
> ServerName:     'server1.lokaal'
> DocumentRoot:   '/var/www'
>
> URI:            '/'
> Location:       '/'
> Directory:      None
> Filename:       '/var/www/'
> PathInfo:       ''
>
> Phase:          'PythonHandler'
> Handler:        'django.core.handlers.modpython'
>
> Traceback (most recent call last):
>
>   File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
> 1537, in HandlerDispatch
>     default=default_handler, arg=req, silent=hlist.silent)
>
>   File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
> 1229, in _process_target
>     result = _execute_target(config, req, object, arg)
>
>   File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
> 1128, in _execute_target
>     result = object(arg)
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/core/handlers/modpython.py", line 213, in handler
>     return ModPythonHandler()(req)
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/core/handlers/modpython.py", line 174, in __call__
>     self.load_middleware()
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/core/handlers/base.py", line 39, in load_middleware
>     for middleware_path in settings.MIDDLEWARE_CLASSES:
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/utils/functional.py", line 276, in __getattr__
>     self._setup()
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/conf/__init__.py", line 42, in _setup
>     self._wrapped = Settings(settings_module)
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/conf/__init__.py", line 139, in __init__
>     logging_config_func(self.LOGGING)
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/utils/dictconfig.py", line 553, in dictConfig
>     dictConfigClass(config).configure()
>
>   File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
> django/utils/dictconfig.py", line 154, in __init__
>     self.config = ConvertingDict(config)
>
> TypeError: 'bool' object is not iterable
>
> Can someone help me to find the reason?
>
> 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.



Error after updating to Django version 1.3

2011-05-15 Thread Mishen'ka
Hello everyone,

I was updating my Django version to version 1.3

And i get a error where i cant find the reason.
I have nothing more then this message:


MOD_PYTHON ERROR

ProcessId:  3138
Interpreter:'server1.lokaal'

ServerName: 'server1.lokaal'
DocumentRoot:   '/var/www'

URI:'/'
Location:   '/'
Directory:  None
Filename:   '/var/www/'
PathInfo:   ''

Phase:  'PythonHandler'
Handler:'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
1537, in HandlerDispatch
default=default_handler, arg=req, silent=hlist.silent)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
1229, in _process_target
result = _execute_target(config, req, object, arg)

  File "/usr/lib/python2.6/dist-packages/mod_python/importer.py", line
1128, in _execute_target
result = object(arg)

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/core/handlers/modpython.py", line 213, in handler
return ModPythonHandler()(req)

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/core/handlers/modpython.py", line 174, in __call__
self.load_middleware()

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/core/handlers/base.py", line 39, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/utils/functional.py", line 276, in __getattr__
self._setup()

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/conf/__init__.py", line 139, in __init__
logging_config_func(self.LOGGING)

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/utils/dictconfig.py", line 553, in dictConfig
dictConfigClass(config).configure()

  File "/usr/local/lib/python2.6/dist-packages/Django-1.3-py2.6.egg/
django/utils/dictconfig.py", line 154, in __init__
self.config = ConvertingDict(config)

TypeError: 'bool' object is not iterable


Can someone help me to find the reason?

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.



Re: Django app models

2011-05-15 Thread augdawg
Thanks so much for your help!

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



Re: Basic Django Support

2011-05-15 Thread Shawn Milochik

Would you paste in your database settings from settings.py?

--
You received this message because you are subscribed to the Google 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.



Basic Django Support

2011-05-15 Thread David Biglin
Hi,
I have been playing with Python for the past year now and enjoying it.
I am trying Django to make a web site for a friend. I am Following the
Django Tutorial on there web site to get the basic concepts here;
http://docs.djangoproject.com/en/dev/intro/tutorial01/

During the set up i am using SQLite3 which comes with python, how ever
when i try and create the DB tables i get the following errors

Command to create DBTables :

python manage.py syncdb



The Traceback :

Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File "/usr/lib/pymodules/python2.7/django/core/management/
__init__.py", line 438, in execute_manager
utility.execute()
  File "/usr/lib/pymodules/python2.7/django/core/management/
__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/pymodules/python2.7/django/core/management/
base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
  File "/usr/lib/pymodules/python2.7/django/core/management/
base.py", line 220, in execute
output = self.handle(*args, **options)
  File "/usr/lib/pymodules/python2.7/django/core/management/
base.py", line 351, in handle
return self.handle_noargs(**options)
  File "/usr/lib/pymodules/python2.7/django/core/management/
commands/syncdb.py", line 56, in handle_noargs
cursor = connection.cursor()
  File "/usr/lib/pymodules/python2.7/django/db/backends/
__init__.py", line 75, in cursor
cursor = self._cursor()
  File "/usr/lib/pymodules/python2.7/django/db/backends/sqlite3/
base.py", line 174, in _cursor
self.connection = Database.connect(**kwargs)
sqlite3.OperationalError: unable to open database file




Any help would be amazing also any other tutorials anyone could
recommend for starting python web development would be much
appreciated!
Thanks again

-- 
You received this message because you are subscribed to the Google 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: PyStack and Djangoverflow

2011-05-15 Thread Shawn Milochik

On 05/15/2011 04:27 AM, Jonathan Endersby wrote:

Hi

If you're on Twitter you might want to follow these two feeds of highly
rated Python and Django questions from Stack Overflow.

http://twitter.com/#!/djangoverflow

and

http://twitter.com/#!/pystack


Thanks. We'll see how much more of my time I can spend on answering 
questions. ;o)




--
You received this message because you are subscribed to the Google 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: existing data failing validation

2011-05-15 Thread Greg Donald
On Sun, May 15, 2011 at 10:24 AM, Shawn Milochik  wrote:
> I think the reason you're getting the error you are is that you didn't add
> 'company' to 'exclude' in your modelform.
>
> The code you pasted indicates that you will have an existing object 100% of
> the time in this view. If that's the case, your line to instantiate the form
> with request.POST and the instance kwarg should take care of remembering its
> existing 'company' value.
>
> If you want one form that is used for both creating a new Contact and
> editing an existing contact then there are ways to do that too.
>
> Here's one:
>
> In the __init__ of your form, check whether self.instance.id exists. If so,
> you can del(self.fields['company']). It won't be available in the form.
> Then, if you pass 'instance' when you create the form in your view your
> modelform will know what the proper value is.


I'm expected to exclude fields so my edit form works when data already
exists in the database?

Great, but now I find that change to get my edit form working has
broken my add form because the company no longer exists when I post
the form, even though it's right there in the post data.

This is so overly complicated.  What is the point of having a model
form if you're just going to exclude important things from it to cheat
to get by an edit form?


-- 
Greg Donald
destiney.com | gregdonald.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: existing data failing validation

2011-05-15 Thread Shawn Milochik
I think the reason you're getting the error you are is that you didn't 
add 'company' to 'exclude' in your modelform.


The code you pasted indicates that you will have an existing object 100% 
of the time in this view. If that's the case, your line to instantiate 
the form with request.POST and the instance kwarg should take care of 
remembering its existing 'company' value.


If you want one form that is used for both creating a new Contact and 
editing an existing contact then there are ways to do that too.


Here's one:

In the __init__ of your form, check whether self.instance.id exists. If 
so, you can del(self.fields['company']). It won't be available in the 
form. Then, if you pass 'instance' when you create the form in your view 
your modelform will know what the proper value is.


--
You received this message because you are subscribed to the Google 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 manage.py shell won't indent

2011-05-15 Thread Amanjeev Sethi
How about spaces?

On Sun, May 15, 2011 at 8:30 AM, Jinhyuk Im  wrote:

> I am using Django 1.3 at Ubuntu Server 10.04.
> I can't use tab key in manage.py shell.
> but, I can use tab key in Python 2.6 Shell
>
> >>> for link in links:
> ...
> Display all 176 possibilities? (y or n)
>
> What should I do?
> Thank you.
> Have a nice day.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
AJ

-- 
You received this message because you are subscribed to the Google 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 manage.py shell won't indent

2011-05-15 Thread Jinhyuk Im
I am using Django 1.3 at Ubuntu Server 10.04.
I can't use tab key in manage.py shell.
but, I can use tab key in Python 2.6 Shell

>>> for link in links:
...
Display all 176 possibilities? (y or n)

What should I do?
Thank you.
Have a nice day.

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



Re: Problems importing model classes that reference each other...

2011-05-15 Thread Leo
As Shawn said, if you really must have both apps refer to the other's
models, then then they're not really separate apps.

If you're just trying to resolve a generic circular-reference problem,
remember that ForeignKey can also take the name of a class as its
first argument, see 
http://docs.djangoproject.com/en/1.3/ref/models/fields/#foreignkey.

-- 
You received this message because you are subscribed to the Google 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: UTF-8 and files automatically created

2011-05-15 Thread Masklinn
On 2011-05-14, at 00:56 , Michael wrote:
> Hello everybody,
> 
> I am a beginner with Django and I was wondering something about UTF-8.
> As a matter of fact, the files created automatically by Django when
> you create your site and apps are not encoded in UTF-8. So some
> characteres like the end of line are specific to the OS you have been
> creating them.
EOLs have nothing to do with UTF-8.

> Since I created them on Windows, I was wondering what will happen when
> I will deploy my django site on a Linux server since the end of line
> character is different ?
As far as Python (the interpreter) is concerned, it should not matter.
Your editor may or may not have a universal line-end mode, and may or
may not be able to detect the file's line-ending format, but that's
about it.

> Wouldn't have been interesting to create all the files in a UTF format
> so that the end of line is the same whatever the OS is ?
EOLs have nothing to do with UTF-8 (or more generally unicode), bis).

-- 
You received this message because you are subscribed to the Google 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: existing data failing validation

2011-05-15 Thread Greg Donald
On Sat, May 14, 2011 at 7:35 PM, Shawn Milochik  wrote:
> That 'name = Charfield' doesn't belong there at all.
>
> Replace that line with this:
>    exclude = ['company']
>
> If you did want to add extra fields to a ModelForm you'd put them at the top
> -- the same place as you would in a Form. Just FYI -- you don't need one
> here.

But how do I handle the scenario I described?  I only need to set the
company when I create the record.  I do not need to set it or have it
validated when I edit the record.

Why does this code not take into account my company is already set?

contact = Contact.objects.get( pk=id )
form = ContactForm( instance=contact )

if request.method == 'POST':
form = ContactForm( request.POST, instance=contact )
if form.is_valid():
form.save()

Why do I get errors when I don't include previously set data?

ipdb> form.errors
{'company': [u'This field is required.']}


-- 
Greg Donald
destiney.com | gregdonald.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: UTF-8 and files automatically created

2011-05-15 Thread Malcolm Box
Utf-8 and line endings are orthogonal issues. The problem is not that the files 
are not in utf-8, but that windows and Linux don't agree on what character 
means line-end. 

You will run into problems shipping unmodified windows line endings to a Linux 
box. Luckily the answer is git. This can be configured to automagically do the 
conversions. 

Malcolm

Sent from my iPhone, please excuse any typos

On 13 May 2011, at 23:56, Michael  wrote:

> Hello everybody,
> 
> I am a beginner with Django and I was wondering something about UTF-8.
> As a matter of fact, the files created automatically by Django when
> you create your site and apps are not encoded in UTF-8. So some
> characteres like the end of line are specific to the OS you have been
> creating them.
> 
> Since I created them on Windows, I was wondering what will happen when
> I will deploy my django site on a Linux server since the end of line
> character is different ?
> Wouldn't have been interesting to create all the files in a UTF format
> so that the end of line is the same whatever the OS is ?
> 
> That was just a think.
> 
> Thank you
> Bye.
> Michael
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> 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.



PyStack and Djangoverflow

2011-05-15 Thread Jonathan Endersby
Hi

If you're on Twitter you might want to follow these two feeds of highly
rated Python and Django questions from Stack Overflow.

http://twitter.com/#!/djangoverflow

and

http://twitter.com/#!/pystack


-- 
Jonathan

-- 
You received this message because you are subscribed to the Google 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.