newforms - How to add class attribute for the text field.

2007-11-22 Thread Nicholas Ding
Hi, guys:
I'm using the newforms library, but I wanna add class attribute to the text
field, I don't know how to add those html attributes into suchs fields.

Any ideas?

Thanks
-- 
Nicholas @ Nirvana Studio
http://www.nirvanastudio.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



how to use django.db module out of django views?

2007-11-22 Thread [EMAIL PROTECTED]

i have file named dump.py at the root folder of django project,i want
to connect database using django settings.py, so here is my code:

from django.db import connection, transaction
cursor = connection.cursor()
cursor.execute( .)

and i got this error:
from django.db import connection, transaction
  File "c:\python25\lib\site-packages\django\db\__init__.py", line 7,
in 
if not settings.DATABASE_ENGINE:
  File "c:\python25\lib\site-packages\django\conf\__init__.py", line
28, in __ge
tattr__
self._import_settings()
  File "c:\python25\lib\site-packages\django\conf\__init__.py", line
55, in _imp
ort_settings
raise EnvironmentError, "Environment variable %s is undefined." %
ENVIRONMEN
T_VARIABLE
EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is
undefined.


can somebody help 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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Popup 'add another' and custom widget in newforms-admin

2007-11-22 Thread Julien

Doesn't anyone know how to help me on this?

Also, I've found another problem. Using the custom form field
CitiesField makes the attribute required (I get an error if I don't
put any cities in a person's profile). But it is not required if I
switch back to the regular ManyToManyField form field. How can I make
the custom one not required and interpret the "blank=True" statement?

Many thanks,

Julien

On Nov 22, 10:53 pm, Julien <[EMAIL PROTECTED]> wrote:
> Ooops, just realised I didn't finished writing the first sentence of
> my previous post. So here it is:
> "I have created a custom widget using the branch newforms-admin to
> represent a ManyToMany relation with checkboxes."
>
> On Nov 22, 10:49 pm, Julien <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
>
> > I have created a custom widget using the branch newforms-admin to
> > represent  (see code below):
>
> > To test it, create a couple of countries, then a few cities attached
> > to those countries, and then create a new Person.
>
> > In the class PersonOptions, the line "formfield.widget.render =
> > widgets.RelatedFieldWidgetWrapper(formfield.widget.render,
> > db_field.rel, self.admin_site)" allows me to get the green cross. By
> > clicking that cross, a popup appears and you can add a new city. Until
> > then it's great
>
> > except that once the new city is saved, the popup doesn't close.
> > It remains blank, and if you look at the html source of that popup
> > you'll get something like:
> > "opener.dismissAddAnotherPopup(window,
> > 7, "New York");"
>
> > By looking at the function "dismissAddAnotherPopup" in the file
> > "http://127.0.0.1:8000/media/js/admin/RelatedObjectLookups.js"; it
> > seems that if the widget is not a "select" component, then it won't be
> > refreshed.
>
> > So, my questions:
> > - How can we get that pop up window to close when the new city is
> > saved?
> > - How can we refresh the custom widget?
> > - How can we put the green cross in a better place? (with the current
> > template it is placed in the bottom left corner, which is not that
> > visible)
>
> > Thanks a lot for your help!
>
> > The actual code:
>
> > class Country(models.Model):
> > name = models.CharField(max_length=50)
> > def __unicode__(self):
> > return self.name
>
> > class City(models.Model):
> > name = models.CharField(max_length=50)
> > country = models.ForeignKey(Country)
> > def __unicode__(self):
> > return self.name
>
> > class Person(models.Model):
> > firstName = models.CharField(max_length=30)
> > lastName = models.CharField(max_length=30)
> > citiesLived = models.ManyToManyField(City, null=True, blank=True)
> > def __unicode__(self):
> > return self.firstName + " " + self.lastName
>
> > from django.newforms.widgets import *
> > from django.newforms.fields import MultipleChoiceField
> > from django.template import Context, Template
> > from django.newforms.util import flatatt
> > from django.utils.encoding import force_unicode
> > from itertools import chain
> > from django.utils.html import escape
> > class CitiesWidget(CheckboxSelectMultiple):
> > template_string="""{% regroup city_list|dictsort:"country" by
> > country as cities_by_country %}
> >{% for country in cities_by_country %}
> >{{ country.grouper }}
> >{% for city in country.list|dictsort:"name"
> > %}
> >{{ city.html }}
> >{% endfor %}
> >
> >{% endfor %}
> > """
> > def render(self, name, value, attrs=None, choices=()):
> > if value is None: value = []
> > has_id = attrs and 'id' in attrs
> > final_attrs = self.build_attrs(attrs, name=name)
> > str_values = set([force_unicode(v) for v in value]) #
> > Normalize to strings.
> > city_list = []
> > for i, (option_value, option_label) in
> > enumerate(chain(self.choices, choices)):
> > city = City.objects.get(id=option_value)
> > # If an ID attribute was given, add a numeric index as a
> > suffix,
> > # so that the checkboxes don't all have the same ID
> > attribute.
> > if has_id:
> > final_attrs = dict(final_attrs, id='%s_%s' %
> > (attrs['id'], i))
> > cb = CheckboxInput(final_attrs, check_test=lambda value:
> > value in str_values)
> > option_value = force_unicode(option_value)
> > rendered_cb = cb.render(name, option_value)
> > html = (u'%s %s' % (rendered_cb,
> > escape(force_unicode(option_label
> > city_list.append({"country":city.country.name, "name":
> > option_label, "html":html})
> > t = Template(self.template_string)
> > c = Context({"city_list": city_list})
> > return t.render(c)
>
> > class CitiesField(MultipleChoiceField):
> > widget = CitiesWidget
>
>

New Program Send Big File Fast and Easy Apply For FREE!!!

2007-11-22 Thread peter borman
WHO WE ARE
YouSendIt is the No. 1 digital file delivery company serving business and
individuals businesses who want a easy, secured, reliable and faster way to
SEND, RECEIVE and TRACK DIGITAL FILES.

YOUSENDIT SOLUTION
We replace the hassles of dealing with unreliable FTP servers, eliminate the
frustrations of bounced email attachments. With YouSendIt you also save time
and money not having to burn CDs and using expensive overnight couriers.

Get Free Code:  Limited Time Only!
http://www.tkqlhce.com/click-2667396-10501907

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



Re: Does a model have a fields attribute?

2007-11-22 Thread Russell Keith-Magee

On Nov 23, 2007 4:07 AM, Ken <[EMAIL PROTECTED]> wrote:
>
> Does a Model have a fields dict attribute like a Form?  I did a dir()
> on a model and don't see one.  I see, instead, that the model fields
> are themselves attributes.  Is this the case?

This sort of detail is all kept in the _meta attribute of the model.
It contains the fields, relationships with the model, display and
database table names - all the metadata about the model.

Yours,
Russ Magee %-)

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



Re: Does a model have a fields attribute?

2007-11-22 Thread Alex Koshelev

._meta.fields - list of model's fields instances
._meta.get_field - returns field instance with given name

On 22 нояб, 22:07, Ken <[EMAIL PROTECTED]> wrote:
> Does a Model have a fields dict attribute like a Form?  I did a dir()
> on a model and don't see one.  I see, instead, that the model fields
> are themselves attributes.  Is this the case?
>
> Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Does a model have a fields attribute?

2007-11-22 Thread Ken

Does a Model have a fields dict attribute like a Form?  I did a dir()
on a model and don't see one.  I see, instead, that the model fields
are themselves attributes.  Is this the case?

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



Re: efficiently search for ManyToMany links?

2007-11-22 Thread Joe

You can query the database directly:

from django.db import connection

# Database connection
cursor = connection.cursor()

# Raw Query
cursor.execute("SELECT statement;")
rows = cursor.fetchall()

J

On Nov 22, 12:55 pm, Adam Seering <[EMAIL PROTECTED]> wrote:
> Hi all,
> I have code that, greatly simplified, looks like the following:
>
> class CheckBoxType(models.Model):
> name = models.TextField()
>
> class Course(models.Model):
> name = models.TextField()
> checkboxes = models.ManyToManyField(CheckBoxType)
>
> Essentially, a Course has multiple properties (represented by a  
> graphical Check Box image in a view); if there's a ManyToMany link  
> between the two tables, that property for that class is Checked (so  
> it gets the checkbox image).
>
> I'm trying to populate a matrix (== HTML ) of Course vs.  
> CheckBoxType; essentially, for a certain subset of Courses and a  
> certain subset of CheckBoxTypes, display all links above.  I want to  
> do this efficiently.  We had previous code that checked each cell in  
> this , and so executed len(myCourses)*len(myCheckBoxTypes)  
> queries.  This was really slow.
>
> If I could query the ManyToMany table directly, I ought to be able to  
> do this in a single query.  Is this possible in Django?  What would  
> people recommend as a solution in this case?
>
> Thanks,
> Adam
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Web Hosting Service

2007-11-22 Thread Kenneth Gonsalves


On 22-Nov-07, at 2:15 AM, Daniel Roseman wrote:

>> http://www.webfaction.com/
>>
>> They are amazing and reasonably priced. Their support is great. They
>> have exceeded my expectations many times.
>>
>> Chuck
>
> Second this recommendation. I am very happy with them, and they have
> responded to support calls nearly instantly.

I used to be very pro webfaction - they have huge memory leak  
problems and unless you stop and start apache once every 20 minutes,  
you very easily go over the memory limits. I now feel they are only  
good for toy sites.

-- 

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



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



If you are in need of fast, effective tax debt assistance, we are here to help.

2007-11-22 Thread sari RU
 *What we will do for you:*

   - *Speak to the IRS so you don't have to*
   - *Stop Enforced Collections*
   - *Release Wage/Bank Levies*
   - *Settle Federal & State back taxes and unfiled returns*
   - *Bring you back into full tax filing compliance*
   - *Negotiate an affordable tax debt resolution***

Contact 
TODAY

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



efficiently search for ManyToMany links?

2007-11-22 Thread Adam Seering

Hi all,
I have code that, greatly simplified, looks like the following:

class CheckBoxType(models.Model):
name = models.TextField()

class Course(models.Model):
name = models.TextField()
checkboxes = models.ManyToManyField(CheckBoxType)

Essentially, a Course has multiple properties (represented by a  
graphical Check Box image in a view); if there's a ManyToMany link  
between the two tables, that property for that class is Checked (so  
it gets the checkbox image).

I'm trying to populate a matrix (== HTML ) of Course vs.  
CheckBoxType; essentially, for a certain subset of Courses and a  
certain subset of CheckBoxTypes, display all links above.  I want to  
do this efficiently.  We had previous code that checked each cell in  
this , and so executed len(myCourses)*len(myCheckBoxTypes)  
queries.  This was really slow.

If I could query the ManyToMany table directly, I ought to be able to  
do this in a single query.  Is this possible in Django?  What would  
people recommend as a solution in this case?

Thanks,
Adam


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



Join Now in the Referral Contest and Start Earning 20,000,00 USD

2007-11-22 Thread [EMAIL PROTECTED]

Aglocomails Referral Contest

 It is 100% FREE.

You will receive 10% earnings from your referral work. All will be
credited to your account daily

Minimum payout for free members is 20,000,00 USD - easy to reach.

Join Now

http://aglocomailsreferralcontest.blogspot.com/

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



FastCGI shared hosting

2007-11-22 Thread Dwarf

Hello,
the problem is getting to be annoyed.
I have shared django hosting with Apache, fcgid module and flup.
The problem is that my  app.fcgi sript does not respawn when I make
changes in it or say:
" touch app.fci"
It runs with rights of "apache" user and I have no clue how to restart
it.

Administrator tells me to change my "app.fcgi"  in the way that it
itself takes care about it.
But I believe that Apache should take care about it.

Can anyone hints me where to dig?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: weird "can't adapt" error

2007-11-22 Thread Jarek Zgoda

Michael napisał(a):
> Thanks Thomas... your shot in the dark hit it's mark for me :)
> 
> I was suffering the same "can't adapt" psycopg2 error (worked fine
> with sqlite), but it was due to the exact reason you stated.
> 
> Although your solution is probably better in the long run, another
> solution is to simply convert the result of slugify into a normal
> string (as slugify now returns a django.utils.safestring.SafeUnicode
> object and the psycopg2 cursor cannot convert this to a string). For
> example:
> 
 from django.template import defaultfilters
> 
 self.group_slug = defaultfilters.slugify(self.name)
> 
> becomes:
 self.group_slug = str(defaultfilters.slugify(self.name))
> 
> Thanks again! It's been causing me headaches...

I'll try this. I tried to do a force_unicode() on slughifi output, but
without luck. I'll try with str() instead.

-- 
Jarek Zgoda
Skype: jzgoda | GTalk: [EMAIL PROTECTED] | voice: +48228430101

"We read Knuth so you don't have to." (Tim Peters)

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



Re: weird "can't adapt" error

2007-11-22 Thread Sandro Dentella

On Tue, Nov 20, 2007 at 03:04:09PM -0600, Jeremy Dunck wrote:
> 
> On Oct 26, 2007 2:47 AM, sandro dentella <[EMAIL PROTECTED]> wrote:
> ...
> >
> >   once again I stumble into this problem. This time I gathered some
> > more
> >   info so I describe them.
> 
> http://groups.google.com/group/django-users/browse_thread/thread/091aa6c088f6c090
> 
> I understand you're running wsgi rather than mod_python, but if you're

correct

> running multiple interpreters, you'll still have the problem discussed
> there.

but that server only has 1 django project (and nothing more). In other
servers I have many concurrent django process but probably I'm not using
decimal. 

The link you reported are very interesting but do not explain me why I'm
meeting probelms from all machines on the LAN and not  from mine (or from
Windows and not from Linux, but these conditions overlap...).

sandro
*:-)

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



cartas comerciais gratuitas

2007-11-22 Thread Paula

Carta Comercial Modelos de Cartas Comerciais Modelos de documentos
comerciais, carta comercial cartas modelo. tipos de cartas comerciais
modelos prontos.

Visite agora:
http://www.modelosdecartascomerciais.com

Cartas Comerciais elaborados com criatividade e conhecimento, convites
contratos propostas,avisos, cartas de venda, recibos, currículos,
pedidos de desculpas, agradecimentos...
Como escrever um texto ou documentos comerciais Utilizando modelos
prontos. cartas comerciais em português e inglês. modelos de cartas
comerciais gratis, cartas comerciais gratuitas.

Visite agora:
http://www.modelosdecartascomerciais.com


carta comercial, modelos de cartas comerciais, documentos, modelo de
oficio, carta modelo, cartas comerciais, exemplo de documentos,
apresentacao comercial, propostas comerciais, como escrever, cartas
comerciais, redacao comercial, tipos de cartas. modelos de cartas
comerciais e documentos, modelo de oficio, carta modelo
como escrever cartas comerciais, modelos prontos de cartas comerciais,
escrevendo uma carta comercial, como escrever uma carta comercial.


OUTRA SUGESTÃO:

Cadastros de e-mails atualizados e segmentados de pessoa fisícas e
juridícas. Oferece emails de todos os segmentos para envio de Mala
Direta
milhões de e-mails para envio de mala direta, divididos por estados,
cidades, pessoas físicas e jurídicas. Entrega Grátis:

Conheça detalhes em:
http://www.divulgaemails.com


mala direta por e-mail, milhões de e-mails para divulgação, listas
atualizadas, lista de emails, e-mail marketing.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django and PyAMF, AMF remoting

2007-11-22 Thread Bert Heymans

Hi Arnar,

Cool, I'm checking it out at this moment, I'd love to use it. I'm
trying out the example on the wiki here http://pyamf.org/wiki/DjangoHowto
but I can't get it to work just yet.

Maybe I did something wrong or the install script didn't behave like
it's supposed to in my environment (Mac OSX 10.4, python 2.5). I got
the PyAMF code from the subverison repository here ( svn co
http://svn.pyamf.org/pyamf/trunk pyamf )

Installing went fine (sudo python setup.py install), and the tests are
OK (python setup.py test) but somehow I can't access the django
package. This is the output I get in a terminal:

Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
[GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from pyamf.gateway.django import DjangoGateway
Traceback (most recent call last):
  File "", line 1, in 
  File "pyamf/gateway/django.py", line 37, in 
_thismodule = sys.modules['django']
KeyError: 'django'
>>> import pyamf.gateway
>>> dir(pyamf.gateway)
['BaseGateway', 'ServiceRequest', 'ServiceWrapper', '__builtins__',
'__doc__', '__file__', '__name__', '__path__', 'remoting', 'sys',
'traceback', 'types']

You see, no 'django' in the list. Anyway, if I look at the sourcecode
it's all there in the gateway package there's 'django', 'twisted' and
'wsgi'.

I'll post my solution when I solve the problem, but I'd appreciate it
if anyone could already give help me with some pointers :)

Bert


On Nov 9, 5:41 pm, Arnar <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> Some here might be interested in the following, others - excuse this
> annoyance :o)
>
> A few folks (Nick Joyce and Thijs Triemstra mostly) are working onPyAMF, an 
> AMF encoder and decoder in Python. It may be considered pre-
> alpha for the moment. It includes Remoting gateways for Twisted, WSGI
> and now Django as well.
>
> Exposing functions for AMF remoting is simple, define a gateway (a
> dispatcher) like this:
>
> # yourproject/yourapp/amfgateway.py
>
> frompyamfimport gateway
>
> def echo(data):
> return data
>
> echoGateway = gateway.BaseGateway({'echo': echo})  # could include
> other functions as well
>
> and add them to urlconf via a generic view:
>
> # yourproject/urls.py
>
> urlpatterns = patterns('',
>
> # AMF Remoting Gateway
> (r'^gateway/', 'pyamf.gateway.djangogateway.DjangoGateway',
>  {'gateway':
> 'yourproject.yourapp.amfgateway.echoGateway'}),
>
> )
>
> Hope you check it out and give us a hand with testing. The project
> website ishttp://pyamf.org/
>
> cheers,
> Arnar
>
> ps. we are aware of DjangoAMF,PyAMFis meant as a more generic AMF
> implementation - not exclusive to Django.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: GeoDjango Distances

2007-11-22 Thread Justin Bronn

Dan,

You raised some excellent questions, thanks for sharing.

> 1 - Is there anyway in Geodjango to calculate distances between two
> points?

GEOSGeometry objects may be used to calculate the distance between two
points.  For example:

>>> from django.contrib.gis.geos import Point
>>> p1 = Point(0, 0)
>>> p2 = Point(1, 1)
>>> print p1.distance(p2)
1.41421356237

However, as can be seen above, this is a simple Pythagorean
calculation and will not take into account the distance between two
points on a sphere.  Thus, for spherical coordinates (e.g., WGS84 lat/
lon) great-circle spherical distance formulation is needed -- the
geopy module (as Samuel suggested) contains some implementations, but
none are within GeoDjango at the moment.

> 2 - When using 'dwithin' like below, what is the unit used in
> distance?
>
> object.filter(point__dwithin=(point,distance))
>

The unit of distance is that of the SRID of the field.  For example,
if you did not explicitly specify an SRID in your geographic field
(you did not use the `srid` keyword), it defaults to WGS84, and the
units of the `distance` parameter would interpreted as degrees --
which are not optimal for calculating distances.

Because of this I use a projected coordinate systems for my models,
which use linear units of measurement for a particular portion of the
earth.   Specifically I use the SRID of 32140 ("NAD83 / Texas South
Central") which has its units in meters. Most of us are not fortunate
enough to encounter data already in our desired coordinate system,
which is why I implemented GeoDjango with implicit SRID
transformation.  This means that when a geographic parameter is in a
different SRID than that of the field, it will be transformed within
the spatial database automatically.   For example, let's say that I
have a Neighborhood model:

from django.contrib.gis.db import models
class Neighborhood(models.Model):
name = models.CharField(max_length=50)
poly = models.PolygonField(srid=32140)
objects = models.GeoManager()

Now, let's say we have a point of interest in WGS84 and we want to
find all neighborhoods within 5km of it.  We would use the `dwithin`
lookup type in the following manner:

>>> from django.contrib.gis.geos import Point
>>> from geoapp.models import Neighborhood
>>> pnt = Point(-95.3631, 29.7633, srid=4326) # notice the srid being set here
>>> qs = Neghborhood.objects.filter(poly__dwithin=(pnt, 5000.0))

Within the SQL, ST_Transform() will be used to convert the WGS84 point
into the SRID of the coordinate system, and return the desired
results.

Happy Thanksgiving,
-Justin

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



Work

2007-11-22 Thread Dave

I am a recruiter looking for excellent Django/Python developers, the
role is with a company based in Central London and the salary is very
competitive. Please see my ad below and if you are interested please
contact me:

Python Developer - Central London - £45k - Python, Django, Plone, Zope

£45000

A Python/Django Developer is needed for an exciting .com organisation
in their brand new offices in central London (W1).

The successful candidate will have a good development background in
either Python or Django. They will need to be highly proficient in
HTML and CSS as well as JavaScript (including libraries such as
mootools, scriptaculous etc). A solid background in SQL is essential
with good XSLT skills.

Essential skills required:

*   Python/Django
*   SQL
*   XSLT
*   HTML
*   CSS
*   JavaScript


This is an excellent opportunity for anyone who wants to work with a
massive blue chip company, so if you think you fit the bill please
send your CV's to [EMAIL PROTECTED]


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



Uploading images

2007-11-22 Thread [EMAIL PROTECTED]

Hi!
I've a model like this:

class Photo(models.Model):
name = models.CharField(_("Nome"),max_length=50 ,blank=False)
image = models.ImageField(_("Immagine"), upload_to=
settings.MEDIA_ROOT+"/%Y/%m/")
caption = models.CharField(_("Didascalia"), max_length=4000,
blank=False)

I'm developing a service for add some images from some external
applications (for ex: a java application...).
I made a view that works like a webService that recieve from a post
the image data and write it on my django application..

Now, my view is :

def add_image(request):
img_name = request.POST['img_name']
img_url = request.POST['img_url']
img_caption = request.POST['img_caption']

image = Photo(name=img_name,
  image = img_url,
  caption = img_caption)
image.save()

...

I recieve an error like 'file does not exist'..
How can I do for upload the image file in my MEDIA folder before save
the Photo object?

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



Re: Receiving an XML from client and parsing into django db

2007-11-22 Thread Simon

Thank you for the quick reply DR.
I'll look into it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



SEE MY PICS????????

2007-11-22 Thread cute

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



Re: Receiving an XML from client and parsing into django db

2007-11-22 Thread Daniel Roseman

On 22 Nov, 11:59, Simon <[EMAIL PROTECTED]> wrote:
> Hi everyone,
> I'm actually very new to django and I haven't been able to find any
> answers to my problem.
> I was wondering if there was a way I could receive an xml from a
> client and parse that into
> the database that I created with django?
>
> Originally, I had a server side script that would take in the xml file
> through stdin,
> but since I don't know much about django and would like to use it for
> its database
> capabilities I was wondering if this would even be possible?
>
> Thanks for all the help.
>
> -Simon

Look into the django-rest-interface application at
http://code.google.com/p/django-rest-interface/ - that should do what
you want. It allows you to translate your models to and from XML among
other formats.
--
DR.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: starting point?

2007-11-22 Thread Daniel Roseman

In another thread many people (including myself) have recommended
Webfaction. It's the same sort of price level as Dreamhost, but much
more reliable for Django hosting. In fact they set everything up for
you, all you need to do is add your app.
--
DR.

On 22 Nov, 10:08, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> thanks!
>
> slicehost sounds nice too. it just is a bit expensive for what i do
> (even if it is cheap compared to similar offers). i find virtual
> private servers very interesting and i hope such webhosting will
> become cheaper once more extreme multicore processors (8 or 16
> cores,...) come out.
>
> On Nov 21, 10:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > dreamhost.com looks quite interesting though. how can they offer 500gb
> > > for that price? are they serious and reliable? do they allow
> > > subleasing of webspace?
>
> > I don't recommend Dreamhost as a host for Django applications. They
> > are 'serious' and their tech support is usually very helpful, but it
> > is an undesirable situation for a couple of reasons. First, they can
> > offer their amazing deals by overselling their resources. Second, it
> > is shared hosting so the reliability and performance of your machine
> > will depend on the other accounts hosted on the same machine, which
> > you cannot predict. In that same vein, you simple don't have much
> > control of your situation.
>
> > For example you might want to setup Memcached. Well... you can't. Or
> > you might want to use PostgreSQL instead of MySQL... and you can't.
> > And you might want to restart Apache... and... you can't. All these
> > things are relatively minor, but combined they make for a situation
> > that is probably untenable for an important project.
>
> > There is a newish offer by Dreamhost called DreamHost PS which allows
> > you to get guaranteed memory, etc, on the machines you are running on.
> > This is something of a step in the right direction, but you're still
> > going to be suffering from machines with unpredictable loads from
> > other individuals, and the people who I have known who use DreamHost
> > PS have not been resoundingly happy.
>
> > Personally I have had a very pleasant experience using Django on
> > Slicehost (http://www.slicehost.com). Essentially you get a virtual
> > machine to do whatever you want with, along with no overselling to get
> > performance and reliability more predictable. I wrote a howto on
> > getting started with Django on Slicehost (http://www.lethain.com/entry/
> > 2007/jul/17/dreamier-dream-server-nginx/), if you go that route.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Web Hosting Service

2007-11-22 Thread Chris Hoeppner

Yeah, Slicehost have a nice name in the industry, though you gotta order
with some time in advance. Don't rely on them for "I need a server for
yesterday" situations ;)

~ Chris

El jue, 22-11-2007 a las 04:37 -0800, [EMAIL PROTECTED] escribi�:
> 
> > Can anybody recommend me  a Django Web Hosting Service?
> 
> I recommend buying a VPS, and one of the very best VPS services is
> slicehost.com which i really recommend!
> If VPS is to expensive for you then WebFaction is the solution you
> should go 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Django Web Hosting Service

2007-11-22 Thread [EMAIL PROTECTED]


> Can anybody recommend me  a Django Web Hosting Service?

I recommend buying a VPS, and one of the very best VPS services is
slicehost.com which i really recommend!
If VPS is to expensive for you then WebFaction is the solution you
should go 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Permissions and user.has_perm

2007-11-22 Thread Jon Atkinson

> What's your app_label (usually the lowercase name of the app whose
> models.py contains your Person class")?
>
> The has_perm method should be called with .add_person
> and not with .add_person

Thank you for that - I can't believe I didn't try that myself :-)

--Jon

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



Receiving an XML from client and parsing into django db

2007-11-22 Thread Simon

Hi everyone,
I'm actually very new to django and I haven't been able to find any
answers to my problem.
I was wondering if there was a way I could receive an xml from a
client and parse that into
the database that I created with django?

Originally, I had a server side script that would take in the xml file
through stdin,
but since I don't know much about django and would like to use it for
its database
capabilities I was wondering if this would even be possible?

Thanks for all the help.

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



Re: Popup 'add another' and custom widget in newforms-admin

2007-11-22 Thread Julien

Ooops, just realised I didn't finished writing the first sentence of
my previous post. So here it is:
"I have created a custom widget using the branch newforms-admin to
represent a ManyToMany relation with checkboxes."

On Nov 22, 10:49 pm, Julien <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I have created a custom widget using the branch newforms-admin to
> represent  (see code below):
>
> To test it, create a couple of countries, then a few cities attached
> to those countries, and then create a new Person.
>
> In the class PersonOptions, the line "formfield.widget.render =
> widgets.RelatedFieldWidgetWrapper(formfield.widget.render,
> db_field.rel, self.admin_site)" allows me to get the green cross. By
> clicking that cross, a popup appears and you can add a new city. Until
> then it's great
>
> except that once the new city is saved, the popup doesn't close.
> It remains blank, and if you look at the html source of that popup
> you'll get something like:
> "opener.dismissAddAnotherPopup(window,
> 7, "New York");"
>
> By looking at the function "dismissAddAnotherPopup" in the file
> "http://127.0.0.1:8000/media/js/admin/RelatedObjectLookups.js"; it
> seems that if the widget is not a "select" component, then it won't be
> refreshed.
>
> So, my questions:
> - How can we get that pop up window to close when the new city is
> saved?
> - How can we refresh the custom widget?
> - How can we put the green cross in a better place? (with the current
> template it is placed in the bottom left corner, which is not that
> visible)
>
> Thanks a lot for your help!
>
> The actual code:
>
> class Country(models.Model):
> name = models.CharField(max_length=50)
> def __unicode__(self):
> return self.name
>
> class City(models.Model):
> name = models.CharField(max_length=50)
> country = models.ForeignKey(Country)
> def __unicode__(self):
> return self.name
>
> class Person(models.Model):
> firstName = models.CharField(max_length=30)
> lastName = models.CharField(max_length=30)
> citiesLived = models.ManyToManyField(City, null=True, blank=True)
> def __unicode__(self):
> return self.firstName + " " + self.lastName
>
> from django.newforms.widgets import *
> from django.newforms.fields import MultipleChoiceField
> from django.template import Context, Template
> from django.newforms.util import flatatt
> from django.utils.encoding import force_unicode
> from itertools import chain
> from django.utils.html import escape
> class CitiesWidget(CheckboxSelectMultiple):
> template_string="""{% regroup city_list|dictsort:"country" by
> country as cities_by_country %}
>{% for country in cities_by_country %}
>{{ country.grouper }}
>{% for city in country.list|dictsort:"name"
> %}
>{{ city.html }}
>{% endfor %}
>
>{% endfor %}
> """
> def render(self, name, value, attrs=None, choices=()):
> if value is None: value = []
> has_id = attrs and 'id' in attrs
> final_attrs = self.build_attrs(attrs, name=name)
> str_values = set([force_unicode(v) for v in value]) #
> Normalize to strings.
> city_list = []
> for i, (option_value, option_label) in
> enumerate(chain(self.choices, choices)):
> city = City.objects.get(id=option_value)
> # If an ID attribute was given, add a numeric index as a
> suffix,
> # so that the checkboxes don't all have the same ID
> attribute.
> if has_id:
> final_attrs = dict(final_attrs, id='%s_%s' %
> (attrs['id'], i))
> cb = CheckboxInput(final_attrs, check_test=lambda value:
> value in str_values)
> option_value = force_unicode(option_value)
> rendered_cb = cb.render(name, option_value)
> html = (u'%s %s' % (rendered_cb,
> escape(force_unicode(option_label
> city_list.append({"country":city.country.name, "name":
> option_label, "html":html})
> t = Template(self.template_string)
> c = Context({"city_list": city_list})
> return t.render(c)
>
> class CitiesField(MultipleChoiceField):
> widget = CitiesWidget
>
> from django.contrib.admin import widgets
> class PersonOptions(admin.ModelAdmin):
> def formfield_for_dbfield(self, db_field, **kwargs):
> if db_field.name == 'citiesLived':
> cities = kwargs['initial']
> kwargs['initial'] = [city.id for city in cities]
> formfield = CitiesField(**kwargs)
> formfield.choices = [(city.id, city.name) for city in
> City.objects.all()]
> formfield.widget.render =
> widgets.RelatedFieldWidgetWrapper(formfield.widget.render,
> db_field.rel, self.admin_site)
> return formfield
> else:
>  

Re: Custom ManyToManyField widget in admin

2007-11-22 Thread Julien

Hi Kamil and all,

I have finally found what I was looking for by using the branch
newforms-admin.
It could be tidied up a bit, but at least it works!
Hope that will help others.

(Note: all this led me to some other questions, which I have posted
there: 
http://groups.google.com/group/django-users/browse_thread/thread/cab9828c8da63975/bcc49fa7309464c8#bcc49fa7309464c8)

Here is the actual code:

class Country(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name

class City(models.Model):
name = models.CharField(max_length=50)
country = models.ForeignKey(Country)
def __unicode__(self):
return self.name

class Person(models.Model):
firstName = models.CharField(max_length=30)
lastName = models.CharField(max_length=30)
citiesLived = models.ManyToManyField(City, null=True, blank=True)
def __unicode__(self):
return self.firstName + " " + self.lastName



from django.newforms.widgets import *
from django.newforms.fields import MultipleChoiceField
from django.template import Context, Template
from django.newforms.util import flatatt
from django.utils.encoding import force_unicode
from itertools import chain
from django.utils.html import escape
class CitiesWidget(CheckboxSelectMultiple):
template_string="""{% regroup city_list|dictsort:"country" by
country as cities_by_country %}
   {% for country in cities_by_country %}
   {{ country.grouper }}
   {% for city in country.list|dictsort:"name"
%}
   {{ city.html }}
   {% endfor %}
   
   {% endfor %}
"""
def render(self, name, value, attrs=None, choices=()):
if value is None: value = []
has_id = attrs and 'id' in attrs
final_attrs = self.build_attrs(attrs, name=name)
str_values = set([force_unicode(v) for v in value]) #
Normalize to strings.
city_list = []
for i, (option_value, option_label) in
enumerate(chain(self.choices, choices)):
city = City.objects.get(id=option_value)
# If an ID attribute was given, add a numeric index as a
suffix,
# so that the checkboxes don't all have the same ID
attribute.
if has_id:
final_attrs = dict(final_attrs, id='%s_%s' %
(attrs['id'], i))
cb = CheckboxInput(final_attrs, check_test=lambda value:
value in str_values)
option_value = force_unicode(option_value)
rendered_cb = cb.render(name, option_value)
html = (u'%s %s' % (rendered_cb,
escape(force_unicode(option_label
city_list.append({"country":city.country.name, "name":
option_label, "html":html})
t = Template(self.template_string)
c = Context({"city_list": city_list})
return t.render(c)

class CitiesField(MultipleChoiceField):
widget = CitiesWidget



from django.contrib.admin import widgets
class PersonOptions(admin.ModelAdmin):
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'citiesLived':
cities = kwargs['initial']
kwargs['initial'] = [city.id for city in cities]
formfield = CitiesField(**kwargs)
formfield.choices = [(city.id, city.name) for city in
City.objects.all()]
formfield.widget.render =
widgets.RelatedFieldWidgetWrapper(formfield.widget.render,
db_field.rel, self.admin_site)
return formfield
else:
return
super(PersonOptions,self).formfield_for_dbfield(db_field,**kwargs)


admin.site.register(Country)
admin.site.register(City)
admin.site.register(Person, PersonOptions)





On Nov 22, 12:44 am, kamil <[EMAIL PROTECTED]> wrote:
> sorry
> line "{{ group.grouper.name }}: [
> shoud be:
> "{{ group.grouper.name }}": [
>
> On Nov 21, 11:49 am, kamil <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > HiJulien
>
> > in fact you don't even have to write view for it you can use generic
> > view  as follows:
>
> > put in your url.py:
> > ---
>
> > from yourproject.cities.models import City
>
> > urlpatterns = patterns('',
> > ..
> > (r'^custom_widget.js',
> > 'django.views.generic.list_detail.object_list', { 'queryset':
> > City.objects.all(),  template_name='custom_widget.html' } ),
> > 
> > )
>
> > --
> > with this line you hook all together: model view template and url
> > recommeded read about generic views :)
>
> > good luck
>
> > On Nov 21, 12:14 am,Julien<[EMAIL PROTECTED]> wrote:
>
> > > Thanks again Kamil for your help!
>
> > > Ok, now I'm trying to put everything together. Sorry I'm just starting
> > > with Django and I am still a bit lost.
>
> > > What I am not sure about is:
> > > - where to put the view?
> > > - how to hook the view to th

Popup 'add another' and custom widget in newforms-admin

2007-11-22 Thread Julien

Hi all,

I have created a custom widget using the branch newforms-admin to
represent  (see code below):

To test it, create a couple of countries, then a few cities attached
to those countries, and then create a new Person.

In the class PersonOptions, the line "formfield.widget.render =
widgets.RelatedFieldWidgetWrapper(formfield.widget.render,
db_field.rel, self.admin_site)" allows me to get the green cross. By
clicking that cross, a popup appears and you can add a new city. Until
then it's great

except that once the new city is saved, the popup doesn't close.
It remains blank, and if you look at the html source of that popup
you'll get something like:
"opener.dismissAddAnotherPopup(window,
7, "New York");"

By looking at the function "dismissAddAnotherPopup" in the file
"http://127.0.0.1:8000/media/js/admin/RelatedObjectLookups.js"; it
seems that if the widget is not a "select" component, then it won't be
refreshed.

So, my questions:
- How can we get that pop up window to close when the new city is
saved?
- How can we refresh the custom widget?
- How can we put the green cross in a better place? (with the current
template it is placed in the bottom left corner, which is not that
visible)

Thanks a lot for your help!


The actual code:

class Country(models.Model):
name = models.CharField(max_length=50)
def __unicode__(self):
return self.name

class City(models.Model):
name = models.CharField(max_length=50)
country = models.ForeignKey(Country)
def __unicode__(self):
return self.name

class Person(models.Model):
firstName = models.CharField(max_length=30)
lastName = models.CharField(max_length=30)
citiesLived = models.ManyToManyField(City, null=True, blank=True)
def __unicode__(self):
return self.firstName + " " + self.lastName



from django.newforms.widgets import *
from django.newforms.fields import MultipleChoiceField
from django.template import Context, Template
from django.newforms.util import flatatt
from django.utils.encoding import force_unicode
from itertools import chain
from django.utils.html import escape
class CitiesWidget(CheckboxSelectMultiple):
template_string="""{% regroup city_list|dictsort:"country" by
country as cities_by_country %}
   {% for country in cities_by_country %}
   {{ country.grouper }}
   {% for city in country.list|dictsort:"name"
%}
   {{ city.html }}
   {% endfor %}
   
   {% endfor %}
"""
def render(self, name, value, attrs=None, choices=()):
if value is None: value = []
has_id = attrs and 'id' in attrs
final_attrs = self.build_attrs(attrs, name=name)
str_values = set([force_unicode(v) for v in value]) #
Normalize to strings.
city_list = []
for i, (option_value, option_label) in
enumerate(chain(self.choices, choices)):
city = City.objects.get(id=option_value)
# If an ID attribute was given, add a numeric index as a
suffix,
# so that the checkboxes don't all have the same ID
attribute.
if has_id:
final_attrs = dict(final_attrs, id='%s_%s' %
(attrs['id'], i))
cb = CheckboxInput(final_attrs, check_test=lambda value:
value in str_values)
option_value = force_unicode(option_value)
rendered_cb = cb.render(name, option_value)
html = (u'%s %s' % (rendered_cb,
escape(force_unicode(option_label
city_list.append({"country":city.country.name, "name":
option_label, "html":html})
t = Template(self.template_string)
c = Context({"city_list": city_list})
return t.render(c)

class CitiesField(MultipleChoiceField):
widget = CitiesWidget



from django.contrib.admin import widgets
class PersonOptions(admin.ModelAdmin):
def formfield_for_dbfield(self, db_field, **kwargs):
if db_field.name == 'citiesLived':
cities = kwargs['initial']
kwargs['initial'] = [city.id for city in cities]
formfield = CitiesField(**kwargs)
formfield.choices = [(city.id, city.name) for city in
City.objects.all()]
formfield.widget.render =
widgets.RelatedFieldWidgetWrapper(formfield.widget.render,
db_field.rel, self.admin_site)
return formfield
else:
return
super(PersonOptions,self).formfield_for_dbfield(db_field,**kwargs)


admin.site.register(Country)
admin.site.register(City)
admin.site.register(Person, PersonOptions)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group 

**A site of all General Information IMPORTANT for ALL**

2007-11-22 Thread superstar


**Whatever is your need Click and get the information on this site**

http://indianfriendfinder.com/go/g906183-pmem

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



2nd Swiss Django User group meeting (5.Dez/19:00h/FAM)

2007-11-22 Thread OliverMarchand

To all Swiss Django users:

We will hold the 2nd Swiss Django User group meeting
Where: Fisch Asset Management AG, Bellerive 241, CH-8034 Zürich
   (next to Bahnhof Tiefenbrunnen)
When: Wednesday Dec 5th., starting at 19:00h

Topics:
- Demo of extending the admin screen to allow list actions
- Demo of using open office to create office documents using django
- Discussion validation problems
- Review of Django Sprint Dec. 1st
- anything else coming up

We'll be happy to have you here, Pizza and Drinks will be served.
Please give me a quick reply if you're thinking of coming.

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



Re: Django Web Hosting Service

2007-11-22 Thread Niels Sandholt Busch


> Can anybody recommend me  a Django Web Hosting Service?

Webfaction is really good. I'm a happy customer.

\Niels

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



Re: starting point?

2007-11-22 Thread [EMAIL PROTECTED]

thanks!

slicehost sounds nice too. it just is a bit expensive for what i do
(even if it is cheap compared to similar offers). i find virtual
private servers very interesting and i hope such webhosting will
become cheaper once more extreme multicore processors (8 or 16
cores,...) come out.

On Nov 21, 10:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> > dreamhost.com looks quite interesting though. how can they offer 500gb
> > for that price? are they serious and reliable? do they allow
> > subleasing of webspace?
>
> I don't recommend Dreamhost as a host for Django applications. They
> are 'serious' and their tech support is usually very helpful, but it
> is an undesirable situation for a couple of reasons. First, they can
> offer their amazing deals by overselling their resources. Second, it
> is shared hosting so the reliability and performance of your machine
> will depend on the other accounts hosted on the same machine, which
> you cannot predict. In that same vein, you simple don't have much
> control of your situation.
>
> For example you might want to setup Memcached. Well... you can't. Or
> you might want to use PostgreSQL instead of MySQL... and you can't.
> And you might want to restart Apache... and... you can't. All these
> things are relatively minor, but combined they make for a situation
> that is probably untenable for an important project.
>
> There is a newish offer by Dreamhost called DreamHost PS which allows
> you to get guaranteed memory, etc, on the machines you are running on.
> This is something of a step in the right direction, but you're still
> going to be suffering from machines with unpredictable loads from
> other individuals, and the people who I have known who use DreamHost
> PS have not been resoundingly happy.
>
> Personally I have had a very pleasant experience using Django on
> Slicehost (http://www.slicehost.com). Essentially you get a virtual
> machine to do whatever you want with, along with no overselling to get
> performance and reliability more predictable. I wrote a howto on
> getting started with Django on Slicehost (http://www.lethain.com/entry/
> 2007/jul/17/dreamier-dream-server-nginx/), if you go that route.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Error Handeling

2007-11-22 Thread Rufman



> All
> other status codes are generated directly by your views by returning an
> HttpResponse and setting the status code (or returning one of the
> special classes in django/http/__init__.py).
>

What is the best way (method that follows the Django design pattern)
to catch these status codes, so that I can make my own error page and
don't have the ugly standard Apache error page?

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



Re: GeoDjango Distances

2007-11-22 Thread Samuel Adam

I don't have answers for you but as you're working with geo data, you
might find this library useful:

http://exogen.case.edu/projects/geopy/

On Nov 22, 7:15 am, Dan <[EMAIL PROTECTED]> wrote:
> Hi
>
> I started using the Geodjango branch, it seems to be working really
> well so far, I have a few questions that I could not find the answers
> to:
>
> 1 - Is there anyway in Geodjango to calculate distances between two
> points?
>
> 2 - When using 'dwithin' like below, what is the unit used in
> distance?
>
> object.filter(point__dwithin=(point,distance))
>
> Cheers
>
> -Dan
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



الأن يمكنك مع ان ترسل اكثر من 150 رسالة للجوال من خلال هذا الموقع

2007-11-22 Thread [EMAIL PROTECTED]
الأن يمكنك مع ان ترسل اكثر من 150 رسالة للجوال من خلال هذا الموقع

الموقع لايريد سواء ان تقوم بتسجيل حسابك البريدي حتى يتمكن من وضع
الخدمة لك

ويرفع اسعار اسهمة بين المواقع

هذا هو

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



الأن يمكنك مع ان ترسل اكثر من 150 رسالة للجوال من خلال هذا الموقع

2007-11-22 Thread [EMAIL PROTECTED]
الأن يمكنك مع ان ترسل اكثر من 150 رسالة للجوال من خلال هذا الموقع

الموقع لايريد سواء ان تقوم بتسجيل حسابك البريدي حتى يتمكن من وضع
الخدمة لك

ويرفع اسعار اسهمة بين المواقع

هذا هو

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