how can i use manage.py as a command in script file

2010-03-15 Thread pyleaf
I want to use manage.py as a command in script file.
e.g,
>> python manage.py shell
>>from testproject.testapp.models import Testee
>>from testproject.others.modules import utils
>>utils.do(Testee)

Above are commands in command window manually.
but, how to make these like :
#my_script.py
#!/usr/local/bim/python
from testproject.testapp.models import Testee
from testproject.others.modules import utils
utils.do(Testee)

i dont know how to import manage.py

thank you!
-- 
Believing is Everything.

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



Re: Tesing in Django and python

2010-03-15 Thread Shawn Milochik

http://docs.djangoproject.com/en/1.1/topics/testing/

http://docs.python.org/library/unittest.html


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



Re: how to make radio buttion selected as form is loaded

2010-03-15 Thread django_jedi
Reporting back on this one.  I solved the problem, but perhaps there's
a more elegant way of writing this.

1) Discovered that I was not in fact comparing like data types, so {%
ifequal %} was bound to fail.  (Pardon my newb-ness)

2) Once I fixed that problem, I ended up putting six ifequals together
in the loop, so that the radio button would be checked if any one of
the six possible selections in the "selections" list was equal:

...

...


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



Re: What validation tests are applied to ImageField?

2010-03-15 Thread creecode
Hello John,

On Mar 15, 7:56 pm, john2095  wrote:

> Question is "What is the definition of a 'valid image'" in this
> context?"
> and, optionally, where is the source code for that?

My understanding from what I've read is that most of the heavy lifting
for image handling is done by PIL (Python Imaging Library) <
http://www.pythonware.com/products/pil/ >.

I've been getting into using virtualenv and as part of that I've been
doing some PIL easy_installs.  One PIL install was built with the jpeg
library and when I tried uploading a jpeg image file, all went well.
Another PIL was built without the jpeg library and when I tried to
upload a jpeg image file, Django complained that the image wasn't in a
recognized format.

So, I assume Django is passing the file to PIL and asking if the file
is in a format that PIL can deal with and is in a valid format.

The PIL documentation may be able to clarify how it validates images.

Toodle-l
creecode

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



Re: multi natural_key dependencies problem

2010-03-15 Thread Russell Keith-Magee
On Tue, Mar 16, 2010 at 11:34 AM, victor  wrote:
> how to set multi natural_key dependincies?
> Model code as following:
> class Menu(models.Model):
>    mName = models.CharField(max_length=256)
>    mTitle = models.CharField(max_length=256)
>    url = models.CharField(max_length=1024, blank=True, null=True)
>    ordering = models.IntegerField()
>    mLevel = models.IntegerField()
>    parent = models.ManyToManyField('Menu', blank=True, null=True,
> symmetrical=False)
>    open_new_win = models.BooleanField(default=False)
>    show_to_anonymous = models.BooleanField(default=False)
>    show_to_authenticated = models.BooleanField(default=True)
>    show_to_staff = models.BooleanField(default=True)
>    permissions = models.ManyToManyField(Permission, null=True,
> blank=True)
>    objects = MenuManager()
>
>    def natural_key(self):
>        return self.mName
>    natural_key.dependencies = ['nav.menu', 'auth.permission']
>
> this model is belong to nav app,but when dumpdata:
> python manage.py dumpdata --natural>test1.json
> i got following error:
> Error: Can't resolve dependencies for nav.Menu in serialized app list.
> how can i fix it?thx

You can't. You have specified a model that has a dependency on itself.
This is a situation where you can't use natural keys.

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



multi natural_key dependencies problem

2010-03-15 Thread victor
how to set multi natural_key dependincies?
Model code as following:
class Menu(models.Model):
mName = models.CharField(max_length=256)
mTitle = models.CharField(max_length=256)
url = models.CharField(max_length=1024, blank=True, null=True)
ordering = models.IntegerField()
mLevel = models.IntegerField()
parent = models.ManyToManyField('Menu', blank=True, null=True,
symmetrical=False)
open_new_win = models.BooleanField(default=False)
show_to_anonymous = models.BooleanField(default=False)
show_to_authenticated = models.BooleanField(default=True)
show_to_staff = models.BooleanField(default=True)
permissions = models.ManyToManyField(Permission, null=True,
blank=True)
objects = MenuManager()

def natural_key(self):
return self.mName
natural_key.dependencies = ['nav.menu', 'auth.permission']

this model is belong to nav app,but when dumpdata:
python manage.py dumpdata --natural>test1.json
i got following error:
Error: Can't resolve dependencies for nav.Menu in serialized app list.
how can i fix it?thx

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



Tesing in Django and python

2010-03-15 Thread kamilski81
We are having a huge issue finding a good java-like testing
framework.  In java you can say 'run all classes in this folder'is
this possible with python/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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: how to make radio buttion selected as form is loaded

2010-03-15 Thread django_jedi

>
> Assuming that 'groupA' is a model field, there's no such property as
> 'selections.groupA', because as you've stated, selections is a
> queryset - ie a collection of model instances, not a single one.
>
> However in general you'd be better off using Django's forms framework,
> which outputs fields for you with all the correct attributes selected.
> --
> DR.

selections is a single record, obtained this way...

selections =
Workshop.objects.get(user__username=request.user.username)

I have no trouble accessing/printing the value of selections.groupA
(or selections.groupB, etc.) unless I'm inside the "for" loop that
displays the Workshops (I'd like to highlight the workshops that the
user has selected).

selections.groupA is the id for the Workshop they've selected.

The basic Django form didn't give me the interaction I was looking
for.  I want people to use radio buttons to select one Workshop from
among a group of five.  (That gets submitted as their Group A
selection).

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



What validation tests are applied to ImageField?

2010-03-15 Thread john2095
The documentation states about the ImageField

"Like FileField, but validates that the uploaded object is a valid
image. Has two extra optional arguments:"

http://docs.djangoproject.com/en/dev/ref/models/fields/#imagefield

I went cruising the source to try and work out what tests are
implemented to define "a valid image" but didn't get much
satisfaction. There seemed to be a fair bit of talk about dimensions
but nothing about much else.  I was thinking/hoping to find something
which inspected the binary stream to ensure the .jpg/.gif/.png/.bmp
fit its applicable formats.

Question is "What is the definition of a 'valid image'" in this
context?"
and, optionally, where is the source code for that?

t.i.a.

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



Re: Facebook Connect

2010-03-15 Thread Ian Langworth
Try django-socialregistration. I've had success with it.

On Mon, Mar 15, 2010 at 12:52, CrabbyPete  wrote:
> I am trying to integrate pyfacebook into a existing project, and its
> driving me nuts. I just want users to be able to sign in with
> facebook.  Anyone else try this and any recommendations.
>

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



Re: MEDIA_URL is not pushed to templates

2010-03-15 Thread Bobby Roberts
ah... my media processor got shot somehow

On Mar 15, 7:51 pm, Bobby Roberts  wrote:
> hi group... got a strange situation.  MEDIA_URL is not being pushed to
> the templates for some reason.
>
> In my settings file i have
>
> MEDIA_URL='/static/'
> ...
> TEMPLATE_CONTEXT_PROCESSORS=(
>    'django.core.context_processors.request',)
>
> and in the template i am specifying it as {{MEDIA_URL}}
>
> however there is no value for MEDIA_URL in the template.  What could I
> be missing?
>
> PS:  if i go directly to the file  /static/images/mypic.jpg, the image
> shows up fine

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



MEDIA_URL is not pushed to templates

2010-03-15 Thread Bobby Roberts
hi group... got a strange situation.  MEDIA_URL is not being pushed to
the templates for some reason.

In my settings file i have

MEDIA_URL='/static/'
...
TEMPLATE_CONTEXT_PROCESSORS=(
   'django.core.context_processors.request',)

and in the template i am specifying it as {{MEDIA_URL}}

however there is no value for MEDIA_URL in the template.  What could I
be missing?


PS:  if i go directly to the file  /static/images/mypic.jpg, the image
shows up fine

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



Using urlencode with the url tag

2010-03-15 Thread saxon75
I'm trying to generate a link where the URL of the current page gets
passed in the querystring of the link.  Like so: .

I would have thought that I could do this relatively easily with
template tags, so I've tried this:

<% url arg1, arg2 as the_url %>
http://www.example.com?variable={{ the_url|urlencode }}">

However, for whatever reason, the urlencode filter isn't applied when
the_url renders.  Is there a way to do this directly in the template,
or do I have to generate the encoded URL in the view and pass it to
the template?

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



Increase width of filter_horizontal in django admin

2010-03-15 Thread rc
I need to increase the width of the filter_horizontal in my django
admin page.

When the profile_test (keys off of testcase.test_name which is very
wide) fields are displayed both sides of the filter_horizontal are to
narrow. How do I increase the width?

I don't need the max_length of 300, but 75 would be good.

I have a models like this:

class Testcase(models.Model):
test_id = models.AutoField(primary_key=True)
test_name = models.CharField(max_length=300)
src = models.ForeignKey(Source, null=True, blank=True, \

help_text='Video source file')
asrc = models.ForeignKey(Source, null=True, blank=True, \

 help_text='Audio source file')
bitrate = models.IntegerField(null=True, blank=True)
audio_bitrate = models.IntegerField(null=True, blank=True)
test_type = models.CharField(max_length=300)
output_resolution = models.CharField(max_length=15, blank=True)
out_progressive = models.BooleanField()
out_framerate = models.CharField(max_length=10, blank=True)
multicodec = models.BooleanField()
out_audio_channels = models.CharField(max_length=10, blank=True)
out_samplerate = models.IntegerField(null=True, blank=True)
out_format = models.CharField(max_length=10, blank=True)
out_chan_map = models.CharField(max_length=10, blank=True)
description = models.CharField(max_length=3000, blank=True)
ref_file = models.CharField(max_length=765, blank=True)
ref_encode_filesize = models.IntegerField(null=True, blank=True)
ref_y_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
ref_u_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
ref_v_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
ref_yuv_psnr = models.DecimalField(null=True, max_digits=7,
decimal_places=2, blank=True)
highmark_version = models.CharField(max_length=60, blank=True)
def __unicode__(self):
return force_unicode(self.test_name)
class Meta:
ordering = ['test_name']
db_table = u'testcase'

class Profile(models.Model):
profile_id = models.AutoField(primary_key=True)
profile_name = models.CharField(max_length=75)
description = models.CharField(max_length=1500, blank=True)
profile_test = models.ManyToManyField(Testcase)
def __unicode__(self):
return force_unicode(self.profile_name)
class Meta:
ordering = ['profile_name']
db_table = u'profile

And model admins like this:
class ProfileAdmin(admin.ModelAdmin):
search_fields = ('profile_name',)
ordering = ('profile_name',)
filter_horizontal = ('profile_test')  *this is the field i
need to be wider**

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



Re: how to make radio buttion selected as form is loaded

2010-03-15 Thread Alastair Campbell
On Mon, Mar 15, 2010 at 10:26 AM, Daniel Roseman  wrote:
> Assuming that 'groupA' is a model field, there's no such property as
> 'selections.groupA', because as you've stated, selections is a
> queryset - ie a collection of model instances, not a single one.
>
> However in general you'd be better off using Django's forms framework,
> which outputs fields for you with all the correct attributes selected.

Co-incidentally I was asking a very similar question, I couldn't see
any way to use the model information in a formset. In the first
instance I'm just passing in the data, I assume it isn't possible to
use that as variables elsewhere?

Also, in the view, is it possible to reference a model associated with
each form in the formset?

This is a simplified version of the view:
http://dpaste.com/172317/

That's aimed at taking in multiple events and multiple members, which
is fine except that I can't see how to reference the members when:
- In the form (template).
- Iterating over the form information.

E.g. this doesn't work:

for entry_form in entry_formset.cleaned_data:
 this_member = members[entry_form]

Any pointers appreciated, I can't find a similar instance in the docs.

Kind regards,

-Alastair

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



Re: Handling upload, adding M2M relation before saving object in admin form

2010-03-15 Thread Henry Andersen
Thanks for your answer, but I do need a ManyToManyField().

In case anyone is curious about the answer, I solved my problem by
overriding my custom admin form's save method. In save(), I checked for the
existence of the file field in self.files; passed self.files to a document
form, which populates a new Document object, returns that (using
commit=False), save it manually so we can get the new primary key, then add
that primary key to Publication's form's documents field
(self.cleaned_data['documents']); then save the whole thing to the database
using super(). Turned out this was lot simpler than I originally thought it
would be, fortunately.

admin.py:
class PublicationAdmin (models.AdminForm):
  form = CustomForm

forms.py:
class DocumentForm (models.ModelForm):
  class Meta:
model = Document

class CustomForm (models.ModelForm):
  class Meta:
model = Publication

  # custom documentwidget is a hiden select box of document ids
  # with some jquery, and a file upload field
  documents = forms.MultipleChoiceField(widget=CustomDocumentWidget)

  def save(self, *args, **kwargs):
if 'file' in self.files:
  docform = DocumentForm(files=self.files)
  document = docform.save(commit=False)
  document.save()
  if document.pk: # add m2m relation with new document
  self.cleaned_data['documents'].append(document.pk)
super(CustomForm, self).save(*args, **kwargs)
return self.instance

Henry A

On Mon, Mar 15, 2010 at 2:58 PM, pjrhar...@gmail.com wrote:

> On Mar 12, 12:42 pm, Henry A  wrote:
> > Hi,
> >
> > For a client, I've got the following (simplified) models:
> >
> > class Document (models.Model):
> >   file = models.FileField()
> >
> > class Publication (models.Model):
> >   title = models.CharField()
> >   ...
> >   documents = models.ManyToManyField(Document)
> >
>
> Do you need a ManyToManyField here? I.E. can a document be in more
> than one Publication? I suspect you actually want:
>
> class Document (models.Model):
>  file = models.FileField()
>   publication = models.ForeignKey('Publication')
>
> class Publication (models.Model):
>  title = models.CharField()
>
> Then you can use inline admin forms:
>
> http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects
>
> In 1.2 there is now a nifty jQuery interface so you can keep adding
> documents.
>
> Hope that helps
>
> Peter
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: object has no attribute 'count'

2010-03-15 Thread Masklinn
On 15 Mar 2010, at 22:44 , wubble u wrote:
> 
> Hi All,
> 
> I'm trying to get a count of the number of rows in my queryset,
> basically a SELECT COUNT(*).
> 
> According to the django documentation, you can simply use
> queryset.count(), but I'm getting the error:
> 
> object has no attribute 'count'
> 
> my view code is:
> 
> hResults = Results.objects.select_related().get(home_team_id = '3')
>hResCount = hResults.count()
> 
> my model is:
> 
> class Results(models.Model):
>results_id = models.AutoField(primary_key=True)
>league_id = models.ForeignKey(Leagues)
>home_team_id = models.ForeignKey(Teams, related_name='home')
>away_team_id = models.ForeignKey(Teams, related_name='away')
> 
> I've even tried len(hResults) and I get the same error.
> 
> The count attribute seems to work ok though if I just do
> Results.objects.all()
> 
> Does anyone have any ideas why this errors?
> 
> Regards,
> 
> wubble u

If you go read the documentation for the get() method 
(http://docs.djangoproject.com/en/dev/ref/models/querysets/#id5), you'll soon 
realize it can only ever return a single object. No object and multiple objects 
both result in an exception being thrown. Your result is therefore a Results 
instance, not a queryset. Results model having no attribute `count` and not 
being a collection, I find sensible that calling .count() or len() on it 
doesn't work and believe you're misunderstanding what you're doing.

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



Re: object has no attribute 'count'

2010-03-15 Thread Shawn Milochik
If you're doing a 'get,' then you're always going to return exactly one results 
(or get an error).

If you do a 'filter' you can use count().

Shawn


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



object has no attribute 'count'

2010-03-15 Thread wubble u
Hi All,

I'm trying to get a count of the number of rows in my queryset,
basically a SELECT COUNT(*).

According to the django documentation, you can simply use
queryset.count(), but I'm getting the error:

object has no attribute 'count'

my view code is:

hResults = Results.objects.select_related().get(home_team_id = '3')
hResCount = hResults.count()

my model is:

class Results(models.Model):
results_id = models.AutoField(primary_key=True)
league_id = models.ForeignKey(Leagues)
home_team_id = models.ForeignKey(Teams, related_name='home')
away_team_id = models.ForeignKey(Teams, related_name='away')

I've even tried len(hResults) and I get the same error.

The count attribute seems to work ok though if I just do
Results.objects.all()

Does anyone have any ideas why this errors?

Regards,

wubble u

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



Re: django and buildout and mr.developer

2010-03-15 Thread John Griessen

andreas schmid wrote:

it seems to work with mr.developer

[buildout]
extensions = mr.developer
sources = sources
auto-checkout = django-mptt

parts =
django

eggs =
mock
django-notification
django-page-cms
django-haystack

[sources]
django-mptt = svn http://django-mptt.googlecode.com/svn/trunk/
django-mptt

[django]
recipe = djangorecipe
version = 1.1.1
settings = development
urls =
   
http://code.google.com/p/django-messages/source/browse/#svn/branches/messages-0.4.x

wsgi = true
eggs = ${buildout:eggs}
project = cottagematic_com

let me know.



I saw some errors and changed this:

[sources]
django-mptt = svn http://django-mptt.googlecode.com/svn/trunk/ path=django-mptt

and then fixed an indent problem and it ran.

Thanks for your help.  Now I need to learn to test this and next deploy to
a server.

John Griessen

j...@toolbench:~/WEBprojects/cottagematic_com$ python bin/buildout
Getting distribution for 'mr.developer'.
Got mr.developer 1.12.
mr.developer: Checking out 'django-mptt' with subversion.
Develop: '/home/john/WEBprojects/cottagematic_com/django-mptt/django-mptt'
Uninstalling django.
Installing _mr.developer.
Generated script '/home/john/WEBprojects/cottagematic_com/bin/develop'.
Installing django.
Page at http://pypi.python.org/simple/mock/ links to .py file(s) without 
version info; an index scan is required.
Getting distribution for 'django-tagging>0.2.1'.
zip_safe flag not set; analyzing archive contents...
tagging.tests.settings: module references __file__
tagging.tests.tests: module references __file__
Got django-tagging 0.3.1.
Getting distribution for 'html5lib>=0.10'.
zip_safe flag not set; analyzing archive contents...
Got html5lib 0.90.
Getting distribution for 'BeautifulSoup'.
zip_safe flag not set; analyzing archive contents...
/usr/lib/python2.5/site-packages/setuptools/command/bdist_egg.py:422: UnicodeWarning: Unicode equal comparison failed to convert 
both arguments to Unicode - interpreting them as being unequal

  symbols = dict.fromkeys(iter_symbols(code))
Got BeautifulSoup 3.1.0.1.
Generated script '/home/john/WEBprojects/cottagematic_com/bin/django'.
Generated script '/home/john/WEBprojects/cottagematic_com/bin/django.wsgi'.
django: Skipping creating of project: cottagematic_com since it exists

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



Facebook Connect

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

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



Re: Resize image if too large

2010-03-15 Thread Rafael de Oliveira Lopes Gonçalves
By the way, I don't think the user should wait for this kind of heavy
load work (resizing images, waiting the response).

Try to use lazy or remote call after you saved the image. Give celery
a try: http://ask.github.com/celery/

-- 
Rafael Lopes
(11)6729-1897



On Mon, Mar 15, 2010 at 1:59 PM, When ideas fail
 wrote:
> Turned out it was all up the pole, but have it working now. The
> validation to check the size did work though.
>
> On 15 Mar, 16:12, "ge...@aquarianhouse.com" 
> wrote:
>> well, something is missing, like
>>
>> def save(self, *args, **kwargs):
>>     #your code
>>
>> but in our case the form class should do the validation...
>>
>> On Mar 15, 5:07 pm, When ideas fail  wrote:
>>
>> > Hello, I've been trying to create a save method which resizes an image
>> > if it is too large. Using pil this is what I have so far:
>>
>> > class Photo(models.Model):
>>
>> >     title = models.CharField(max_length=750)
>> >     photo = models.FileField(upload_to='full_size/')
>> >     alt = models.CharField(max_length=50, null=True, blank=True)
>>
>> >    # Save the photo in less than or equal to 800x600
>>
>> >         if image.size[0] > 800:
>> >             if image.size[1] > 600:
>> >                 #resize image if its too large
>> >                 MAX_SIZE = (800,600)
>> >                 if self.photo:
>> >                     filename = self.photo.path
>> >                     image = Image.open(filename)
>> >                     image.thumbnail(MAX_SIZE, Image.ANTIALIAS)
>> >                     image.save(filename)
>> >                 super(Photo, self).save()
>> >         else:
>> >             super(Photo, self).save()
>>
>> > but it doesn't seem to work. It doesn't produce any errors but the
>> > images are the same size that they where before. Could someone tell me
>> > what i'm doing wrong? Thanks
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

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



Re: File validation process

2010-03-15 Thread Vincent
Thanks for the reply hcarvalhoalves.

I can see bypassing the file name extensions as you have mentioned,
they don't guarantee the file type anyway. That said, I would like to
be able to use some other means than mimetypes as I need to make sure
that the files are of a specific type (e.g. not just a video file but
one with a specific file header.)

As for the interruption of the upload itself however, that is pretty
crucial as the files would be around 1 GB each and I wouldn't want a
user to have to wait for it to complete only to find out that it was
of the wrong file type.


On Mar 13, 9:39 pm, hcarvalhoalves  wrote:

> You could avoid the Javascript check (file extensions are just a
> convention, rarely thrustable) and just check the uploaded file
> mimetype on form validation code.
>
> `import mimetypes` for more.
>
> There's no clean way to interrupt file upload, though.
>
> On Mar 12, 11:27 pm, Vincent  wrote:
>
> > I would like some help in figuring out how to handle file validation
> > in my application. I have a series of processing that I'd like to
> > happen at various stages. Some of this validation might have to happen
> > outside of Django itself, like using JavaScript in the actual form as
> > the files that are to be uploaded can be quite large in size.
>
> > For starters, I would like the extension of the selected file to be
> > checked prior to submission. I have no experience with JavaScript but
> > I take it that I can perform some sort of regex search there? I take
> > it that this has been done before. Could some one point me in the
> > direction of a clear and somewhat simple method of doing this with
> > either a simple self-made script or one built-in to a library?
>
> > If the filename passes validation, I want the form to be submitted BUT
> > it would be great if there was some way to check the first few bytes
> > of the file as it is being uploaded on the server-side. I should know
> > that the first few bytes of a correct file look like and can do a
> > regex search against a known list of strings. How does one check a
> > file while it's being uploaded in Django? Also, how does one trigger
> > and error or warning so that the upload stops and displays an error
> > page to the user?
>
> > I'm still pretty new to a lot of what Django provides as well as
> > Python in general so please pardon me if this are well-documented and/
> > or know procedures.
>
> > Thanks

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



Re: send_mail UnicodeDecodeError: 'ascii' codec can't decode byte

2010-03-15 Thread Michał Klich
Yes it did. I must have messed up something as i tried unicode().
Thanks

On Mar 14, 5:01 pm, "ge...@aquarianhouse.com"
 wrote:
> it should work with:
>
> body = unicode("Tre¶æ", 'utf-8')
>
> On Mar 14, 3:49 pm, Micha³ Klich  wrote:> Hi,
> > I do not fully understand how this works.
>
> > I have
> > subject = "Temat"
> > body = "Tre¶æ"
> > from = some.em...@dot.com
> > to = some.em...@dot.com
>
> > send_email(subject, body, from, to) prints out
>
> > Traceback (most recent call last):
> >   File "/usr/lib64/python2.6/logging/__init__.py", line 773, in emit
> >     stream.write(fs % msg.encode("UTF-8"))
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position
> > 35: ordinal not in range(128)
>
> > But why? I tried to unicode(body, "utf-8") and pass it but it would
> > fail. I am obviously doing something wrong.

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



Re: form.save_m2m() and exclude field

2010-03-15 Thread jul
hi,

sorry. Here's the copy of the traceback.
It's actually a warning, not an error.
I'm using form.save_m2m() because my model includes another m2m field
(I simplified the code for readability), and I'm using
form.save(commit=False) because I don't set the city field using the
city value from request.POST but from further processing of the data.
It still seems to me that save_m2m() tries to save the excluded tag
field.
Thanks for your help.
jul



Traceback:
File "/var/lib/python-support/python2.5/django/core/handlers/base.py"
in get_response
  92. response = callback(request, *callback_args,
**callback_kwargs)
File "/home/jul/atable/../atable/resto/views.py" in addRestaurant
  498. form.save_m2m()
File "/var/lib/python-support/python2.5/django/forms/models.py" in
save_m2m
  75. f.save_form_data(instance, cleaned_data[f.name])
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in save_form_data
  967. setattr(instance, self.attname, data)
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in __set__
  627. manager.add(*value)
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in add
  430. self._add_items(self.source_col_name,
self.target_col_name, *objs)
File "/var/lib/python-support/python2.5/django/db/models/fields/
related.py" in _add_items
  497. [self._pk_val] + list(new_ids))
File "/var/lib/python-support/python2.5/django/db/backends/util.py" in
execute
  19. return self.cursor.execute(sql, params)
File "/var/lib/python-support/python2.5/django/db/backends/mysql/
base.py" in execute
  84. return self.cursor.execute(query, args)
File "/var/lib/python-support/python2.5/MySQLdb/cursors.py" in execute
  168. if not self._defer_warnings: self._warning_check()
File "/var/lib/python-support/python2.5/MySQLdb/cursors.py" in
_warning_check
  82. warn(w[-1], self.Warning, 3)
File "/usr/lib/python2.5/warnings.py" in warn
  62.   globals)
File "/usr/lib/python2.5/warnings.py" in warn_explicit
  102. raise message

Exception Type: Warning at /restaurant/add/
Exception Value: Truncated incorrect DOUBLE value: 'a'



On Mar 15, 7:15 pm, Daniel Roseman  wrote:
> On Mar 15, 5:33 pm, jul  wrote:
>
>
>
> > hi,
>
> > in a ModelForm I replace a field by excluding it and adding a new one
> > with the same name, as shown below in AddRestaurantForm. When saving
> > the form with the code shown below, I get an error in form save_m2m()
> > (Truncated incorrect DOUBLE value), which seems to be due to the
> > function to attempt to save the tag field, while it is excluded.
> > Is the save_m2m() function supposed to save excluded fields?
> > Is there anything wrong in my code?
>
> > Thanks
> > Jul
>
> > (...)
> > new_restaurant = form.save(commit=False)
> > new_restaurant.city = city
> > new_restaurant.save()
>
> > tags =  form.cleaned_data['tag']
> > if(tags!=''): tags=tags.split(',')
> > for t in tags:
> >     tag, created = Tag.objects.get_or_create(name = t.strip())
> >     tag.save()
> >     new_restaurant.tag.add(tag)
>
> > new_restaurant.save()
> > form.save_m2m()
>
> Firstly, it is no use just giving the name of the error. Errors come
> with tracebacks, for good reason: they allow us to see exactly where
> the error is occurring, and the context.
>
> Anyway, in your case, there doesn't seem to be any need to use
> save_m2m. The documentation states:
>   "Calling save_m2m() is only required if you use save(commit=False)"
> In your case, you've already saved the form to get the new_restaurant
> instance, and you're adding tags to that instance with no problem. The
> last two calls, to new_restaurant.save() and form.save_m2m(), are
> unnecessary.
> --
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: form.save_m2m() and exclude field

2010-03-15 Thread Daniel Roseman
On Mar 15, 5:33 pm, jul  wrote:
> hi,
>
> in a ModelForm I replace a field by excluding it and adding a new one
> with the same name, as shown below in AddRestaurantForm. When saving
> the form with the code shown below, I get an error in form save_m2m()
> (Truncated incorrect DOUBLE value), which seems to be due to the
> function to attempt to save the tag field, while it is excluded.
> Is the save_m2m() function supposed to save excluded fields?
> Is there anything wrong in my code?
>
> Thanks
> Jul
>
> (...)
> new_restaurant = form.save(commit=False)
> new_restaurant.city = city
> new_restaurant.save()
>
> tags =  form.cleaned_data['tag']
> if(tags!=''): tags=tags.split(',')
> for t in tags:
>     tag, created = Tag.objects.get_or_create(name = t.strip())
>     tag.save()
>     new_restaurant.tag.add(tag)
>
> new_restaurant.save()
> form.save_m2m()


Firstly, it is no use just giving the name of the error. Errors come
with tracebacks, for good reason: they allow us to see exactly where
the error is occurring, and the context.

Anyway, in your case, there doesn't seem to be any need to use
save_m2m. The documentation states:
  "Calling save_m2m() is only required if you use save(commit=False)"
In your case, you've already saved the form to get the new_restaurant
instance, and you're adding tags to that instance with no problem. The
last two calls, to new_restaurant.save() and form.save_m2m(), are
unnecessary.
--
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



form.save_m2m() and exclude field

2010-03-15 Thread jul
hi,

in a ModelForm I replace a field by excluding it and adding a new one
with the same name, as shown below in AddRestaurantForm. When saving
the form with the code shown below, I get an error in form save_m2m()
(Truncated incorrect DOUBLE value), which seems to be due to the
function to attempt to save the tag field, while it is excluded.
Is the save_m2m() function supposed to save excluded fields?
Is there anything wrong in my code?

Thanks
Jul


(...)
new_restaurant = form.save(commit=False)
new_restaurant.city = city
new_restaurant.save()

tags =  form.cleaned_data['tag']
if(tags!=''): tags=tags.split(',')
for t in tags:
tag, created = Tag.objects.get_or_create(name = t.strip())
tag.save()
new_restaurant.tag.add(tag)

new_restaurant.save()
form.save_m2m()


***models.py***

class Tag(models.Model):
name = models.CharField(max_length=100, unique=True)

class Restaurant(models.Model):
name = models.CharField(max_length=50)
city=models.ForeignKey(City)
tag=models.ManyToManyField(Tag, blank=True, null=True)


***forms.py***

class AddRestaurantForm(ModelForm):
name = forms.CharField(widget=forms.TextInput(attrs=classtext))
city = forms.CharField(widget=forms.TextInput(attrs=classtext),
max_length=100)
tag = forms.CharField(widget=forms.TextInput(attrs=classtext),
required=False)

class Meta:
model = Restaurant
exclude = ('city','tag')



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



Trouble installing satchmo

2010-03-15 Thread Jonathan Hayward
I'm trying to get satchmo up and running from the instructions at
http://bitbucket.org/chris1610/satchmo/downloads/Satchmo.pdf , and when I
get to 2.1.3 (installing PIL manually as a workaround), there is no
/bin/clonesatchmo.py. After digging around, I move the scripts from the
install directory to under /usr/local, and create a symlink to
clonesatchmo.py. But it can't find things; my guess is that it's looking in
my PYTHONPATH and the same install issues that left no /bin/clonesatchmo.py
has left no Python files installed to the default PYTHONPATH. I get:

$ python /bin/clonesatchmo.py
Creating the Satchmo Application
Traceback (most recent call last):
  File "/bin/clonesatchmo.py", line 108, in 
create_satchmo_site(opts.site_name)
  File "/bin/clonesatchmo.py", line 47, in create_satchmo_site
import satchmo_skeleton
ImportError: No module named satchmo_skeleton

Do people have suggestions, including going to a Satchmo-specific list if
this list is not intended to discuss Django add-ons like Satchmo or Pinax?

-- 
→ Jonathan Hayward, a Senior Web Developer who cares deeply about usability
→ www.linkedin.com/in/jonathanhayward • jonathan.hayw...@pobox.com
→ Ajax, CGI, CMS, CSS, HTML, IA, JSON, JavaScript, LAMP, Linux, Perl, PHP,
Python, SQL, UI, Unix, Usability, UX, XHTML, XML
→ With a good interest in the human side of computing and making software
and websites a joy to use

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



Re: Resize image if too large

2010-03-15 Thread When ideas fail
Turned out it was all up the pole, but have it working now. The
validation to check the size did work though.

On 15 Mar, 16:12, "ge...@aquarianhouse.com" 
wrote:
> well, something is missing, like
>
> def save(self, *args, **kwargs):
>     #your code
>
> but in our case the form class should do the validation...
>
> On Mar 15, 5:07 pm, When ideas fail  wrote:
>
> > Hello, I've been trying to create a save method which resizes an image
> > if it is too large. Using pil this is what I have so far:
>
> > class Photo(models.Model):
>
> >     title = models.CharField(max_length=750)
> >     photo = models.FileField(upload_to='full_size/')
> >     alt = models.CharField(max_length=50, null=True, blank=True)
>
> >    # Save the photo in less than or equal to 800x600
>
> >         if image.size[0] > 800:
> >             if image.size[1] > 600:
> >                 #resize image if its too large
> >                 MAX_SIZE = (800,600)
> >                 if self.photo:
> >                     filename = self.photo.path
> >                     image = Image.open(filename)
> >                     image.thumbnail(MAX_SIZE, Image.ANTIALIAS)
> >                     image.save(filename)
> >                 super(Photo, self).save()
> >         else:
> >             super(Photo, self).save()
>
> > but it doesn't seem to work. It doesn't produce any errors but the
> > images are the same size that they where before. Could someone tell me
> > what i'm doing wrong? Thanks

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



Re: is there any possibility for two settings.py

2010-03-15 Thread dalore
Another common technique is to use the local_settings.py way, like so:

# local_settings.py can be used to override environment-specific
settings
# like database and email that differ between development and
production.
try:
from settings_local import *
except ImportError:
pass

---

(Note: I call my settings_local.py so it shows up next to settings.py
when sorted alphabetically)

The above code should be the last thing in your settings.py. What it
does is look for a another settings file settings_local.py in this
case, and uses them as overrides to default settings in your normal
settings.py.

This way you can override settings locally.  What we do is don't check
in the settings_local.py into your source control (as that is per
developer), but check in a settings_production.py (or other
settings_*.py) file. Then when we deploy we just copy over
settings_production.py into settings_local.py.

On Mar 14, 8:40 pm, Robert Mela  wrote:
> We load custom environments at startup based on directory from which the
> app is loaded.   The selection could just as easily be based on
> environment variable, machine name rather than directory path.
>
> The simple trick is to have settings.py serve as a proxy for those
> other, environment-specific settings files.   Values from those settings
> files are imported into the main settings.py file.
>
> In settings.py:
>
>     env_config = get_my_settings_module_name() # we have a function that
>     looks at the path
>                                                # of current settings
>     file, and picks an appropriate
>                                                # environment-specific
>     settings file.
>                                                #
>                                                # Our environments are
>     path-based...
>                                                # /home/user or
>     /Users/user for a developer,
>                                                # /our/deploy/path/dev or
>     /our/deploy/path/prod for
>                                                # deployed apps.
>                                                #
>                                                # You could just as
>     easily key off of an environment
>                                                # variable, etc.
>                                                #
>                                                # This works with both
>     Django's dev WSGI server
>                                                # and mod_wsgi
>
>     exec("from %s import *" % env_config)      # imports everything from
>     your env-specific settings file
>                                                # into main settings.py
>     for the project.
>
>
>
> chiranjeevi muttoju wrote:
> > we have two applications, what we want to do is, one app should run at
> > one address and other app should run at different address. this is my
> > requirement. is it possible to put those two apps in the same
> > project...?(different apps but same project, we sud be able to run
> > both apps separately with the different settings.)
>
> > On Mon, Mar 8, 2010 at 3:39 PM, Atamert Ölçgen  > > wrote:
>
> >     On Monday 08 March 2010 09:06:05 chiranjeevi muttoju wrote:
> >     > Hi friends,
> >     > i have two apps in my project, and i want to use two different
> >     settings for
> >     > each app. it means same project but i sud run those two apps
> >     separately. is
> >     > it possible..? if anyone of u guys know please reply me. And if
> >     u want any
> >     > further information regarding this post please ask me.
> >     No. But if you tell us which settings you want different and why,
> >     someone
> >     might offer an alternative solution.
>
> >     --
> >     Saygılarımla,
> >     Atamert Ölçgen
>
> >      -+-
> >      --+
> >      +++
>
> >    www.muhuk.com
> >     mu...@jabber.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.
>
> > --
> > Thanks & Regards,
> > Chiranjeevi.Muttoju
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
>
>
>  rmela.vcf
> < 1KViewDownload

-- 
You received this messa

Re: register model on different App

2010-03-15 Thread j.c.sackett
> I've created a custom model, that I'd like to be shown on the "Auth" box
> instead of the default one (a box with my app's name).
>

Is there a particular reason you want it in Auth? Is it logically part of
one of the Auth models, like Group or User? If so you could do an inline
admin:

from django.contrib import admin

class MyAppAdminInline(admin.StackedInline):
#code for your model's admin controls go here

class MyUserAdmin(admin.UserAdmin):
inlines = [MyAppAdminInline]

admin.site.unregister(User)
admin.site.register(User, MyUserAdmin)

There may very well be some other way to go at this, but I've found 90% of
the time I wanted to add something to Auth, I really just wanted it to be an
inline for an auth model.

//j.c.sackett

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



Re: Resize image if too large

2010-03-15 Thread ge...@aquarianhouse.com
well, something is missing, like

def save(self, *args, **kwargs):
#your code

but in our case the form class should do the validation...

On Mar 15, 5:07 pm, When ideas fail  wrote:
> Hello, I've been trying to create a save method which resizes an image
> if it is too large. Using pil this is what I have so far:
>
> class Photo(models.Model):
>
>     title = models.CharField(max_length=750)
>     photo = models.FileField(upload_to='full_size/')
>     alt = models.CharField(max_length=50, null=True, blank=True)
>
>    # Save the photo in less than or equal to 800x600
>
>         if image.size[0] > 800:
>             if image.size[1] > 600:
>                 #resize image if its too large
>                 MAX_SIZE = (800,600)
>                 if self.photo:
>                     filename = self.photo.path
>                     image = Image.open(filename)
>                     image.thumbnail(MAX_SIZE, Image.ANTIALIAS)
>                     image.save(filename)
>                 super(Photo, self).save()
>         else:
>             super(Photo, self).save()
>
> but it doesn't seem to work. It doesn't produce any errors but the
> images are the same size that they where before. Could someone tell me
> what i'm doing wrong? Thanks

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



Resize image if too large

2010-03-15 Thread When ideas fail
Hello, I've been trying to create a save method which resizes an image
if it is too large. Using pil this is what I have so far:

class Photo(models.Model):

title = models.CharField(max_length=750)
photo = models.FileField(upload_to='full_size/')
alt = models.CharField(max_length=50, null=True, blank=True)

   # Save the photo in less than or equal to 800x600

if image.size[0] > 800:
if image.size[1] > 600:
#resize image if its too large
MAX_SIZE = (800,600)
if self.photo:
filename = self.photo.path
image = Image.open(filename)
image.thumbnail(MAX_SIZE, Image.ANTIALIAS)
image.save(filename)
super(Photo, self).save()
else:
super(Photo, self).save()

but it doesn't seem to work. It doesn't produce any errors but the
images are the same size that they where before. Could someone tell me
what i'm doing wrong? Thanks

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



Re: Self Join

2010-03-15 Thread Karen Tracey
On Fri, Mar 12, 2010 at 5:54 PM, jrs  wrote:

> I'm trying, without a great deal of success, to perform a simple self
> join using the django orm.  I'm pretty sure the F() function is not
> the answer.  I believe this only allows you to compare two field
> within the same model instance, not to compare fields within 2
> instances of the same model.  I want to do this -
>
> Model-
>
> class Account(models.Model):
>name = models.CharField(max_length=255)
>parent_account = models.ForeignKey('self', default=None, blank=True)
>

First, you are going to need a null=True on that parent_account field.
Without it an attempt to save an Account with parent_account=None is going
to raise an IntegrityError.


> SQL-
>
> SELECT account.*, parent.*
> FROM account
> LEFT JOIN account parent ON
>   account.id = parent.parent_account
>
>
What are you trying to accomplish with this SQL? Given an account table
with:

mysql> select * from account;
++--+---+
| id | name | parent_account_id |
++--+---+
|  1 | A1   | 1 |
|  2 | A2   |  NULL |
|  3 | A3   | 2 |
|  4 | A4   | 2 |
++--+---+
4 rows in set (0.00 sec)

The query you show returns:

mysql> select account.*, parent.* from account left join account parent on
account.id = parent.parent_account_id;
++--+---+--+--+---+
| id | name | parent_account_id | id   | name | parent_account_id |
++--+---+--+--+---+
|  1 | A1   | 1 |1 | A1   | 1 |
|  2 | A2   |  NULL |3 | A3   | 2 |
|  2 | A2   |  NULL |4 | A4   | 2 |
|  3 | A3   | 2 | NULL | NULL |  NULL |
|  4 | A4   | 2 | NULL | NULL |  NULL |
++--+---+--+--+---+
5 rows in set (0.00 sec)

The right-side columns coming from the 'parent' table in that result would
more appropriately be labeled 'child', I think, so I'm not entirely sure
this query is doing what you wanted.

It is possible to get the Django ORM to issue a query that seems to match
the intent of how you named those tables in your query, via
Account.objects.select_related('parent_account'). You can check the sql in a
shell:

>>> from ttt.models import Account
>>> from django.db import connection
>>> Account.objects.select_related('parent_account')
[, , , ]
>>> len(connection.queries)
1
>>> connection.queries[-1]['sql']
u'SELECT `account`.`id`, `account`.`name`, `account`.`parent_account_id`,
T2.`id`, T2.`name`, T2.`parent_account_id` FROM `account` LEFT OUTER JOIN
`account` T2 ON (`account`.`parent_account_id` = T2.`id`) LIMIT 21'
>>>

The actual results of that query are:

mysql> select account.*, T2.* from account left outer join account T2 on
account.parent_account_id = T2.id;
++--+---+--+--+---+
| id | name | parent_account_id | id   | name | parent_account_id |
++--+---+--+--+---+
|  1 | A1   | 1 |1 | A1   | 1 |
|  2 | A2   |  NULL | NULL | NULL |  NULL |
|  3 | A3   | 2 |2 | A2   |  NULL |
|  4 | A4   | 2 |2 | A2   |  NULL |
++--+---+--+--+---+
4 rows in set (0.00 sec)

Those results seem to better match what your query was intended to produce
given how you named the alias, where the right-side columns have information
about the left-side's parent. Or were you really looking for the results of
the original query?

If you described what you were looking for in terms of the Account objects,
someone might be able to help more.

Karen

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



Re: Self Join

2010-03-15 Thread jrs
Thanks...

I'm perfectly comfortable with using foreign keys (and reverse) with
the django orm.  For basic joins this is fine.  For more advanced
queries involving complex aggregations (ie-reporting), the orm seems
to be pretty useless... looking at the generated sql shows this.  It's
It's quite easy to produce some nasty queries in loops.  I'm guessing
the if the simply query above can't be accomplished that I'm better
off trying straight sql or sql alchemy.

On Mar 15, 11:21 am, Daniel Roseman  wrote:
> On Mar 15, 1:40 pm, jrs  wrote:
>
> > I see nothing on this page that is in the slightest bit related to my
> > question... Does anyone know if there is a way in the django orm to
> > accomplish my query above?
>
> > Thanks.
>
> As I explained, there's nothing different in a self-join than with any
> other sort of join. And so as of course you'll know, because you've
> read the documentation, you can always access a related object via the
> ForeignKey field:
>   accountinstance = Account.objects.get(pk=whatever)
>   accountinstance.parent_account
>
> If (for performance reasons) you need to get both with a single query,
> use select_related():
>   accountinstance = Account.objects.select_related().get(pk=whatever)
> --
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Self Join

2010-03-15 Thread Daniel Roseman
On Mar 15, 1:40 pm, jrs  wrote:
> I see nothing on this page that is in the slightest bit related to my
> question... Does anyone know if there is a way in the django orm to
> accomplish my query above?
>
> Thanks.

As I explained, there's nothing different in a self-join than with any
other sort of join. And so as of course you'll know, because you've
read the documentation, you can always access a related object via the
ForeignKey field:
  accountinstance = Account.objects.get(pk=whatever)
  accountinstance.parent_account

If (for performance reasons) you need to get both with a single query,
use select_related():
  accountinstance = Account.objects.select_related().get(pk=whatever)
--
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Putting dictionary element according to another element's value

2010-03-15 Thread ge...@aquarianhouse.com
{% with o.id as key %}{{ dictionary.key }}{% endwith %}

would be better, as in comments mentioned

On Mar 15, 3:14 pm, "pjrhar...@gmail.com"  wrote:
> You'll need a custom template tag. Something like this will probably
> do:
>
> http://push.cx/2007/django-template-tag-for-dictionary-access
>
> Peter
>
> On Mar 12, 7:48 pm, Rishat Muhametshin  wrote:
>
> > Hello everyone,
>
> > I just can't solve a problem. I have an array of dictionaries each having
> > random fields, and those fields are referenced in another variable, like
> > this:
>
> > something = {
> >     "headers": [{"name": "first", "value": "From"}, {"name": "two", "value":
> > "To"}],
> >     "content": [{"first": "Alaska", "second": "Nebraska"}, {"first": "Iowa",
> > "second": "Texas"}]
>
> > }
>
> > So I need to iterate through something["headers"] (for item.name as name in
> > something["headers"]) and put relevant content like this:
> > something["content"][name].
>
> > The problem is that dictionary is sent to template, and I don't know how to
> > "select" an item from content where content[i].name is equal to the header's
> > name in iteration.
>
> > I tried this:
>
> > {% for header in something.headers %}
> >     {% for element in something.content %}
> >         element.header
> >     {% endfor %}
> > {% endfor %}
>
> > It tries to take element["header"], and it is not correct. How do I solve
> > this problem?
>
> > --
> > Best regards,
> > Rishat Muhametshin, technical writer
> > Co BIT “Master”, Izhevsk, Russiahttp://friendfeed.com/rishatmuhametshin

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



Re: Putting dictionary element according to another element's value

2010-03-15 Thread pjrhar...@gmail.com
You'll need a custom template tag. Something like this will probably
do:

http://push.cx/2007/django-template-tag-for-dictionary-access

Peter

On Mar 12, 7:48 pm, Rishat Muhametshin  wrote:
> Hello everyone,
>
> I just can't solve a problem. I have an array of dictionaries each having
> random fields, and those fields are referenced in another variable, like
> this:
>
> something = {
>     "headers": [{"name": "first", "value": "From"}, {"name": "two", "value":
> "To"}],
>     "content": [{"first": "Alaska", "second": "Nebraska"}, {"first": "Iowa",
> "second": "Texas"}]
>
> }
>
> So I need to iterate through something["headers"] (for item.name as name in
> something["headers"]) and put relevant content like this:
> something["content"][name].
>
> The problem is that dictionary is sent to template, and I don't know how to
> "select" an item from content where content[i].name is equal to the header's
> name in iteration.
>
> I tried this:
>
> {% for header in something.headers %}
>     {% for element in something.content %}
>         element.header
>     {% endfor %}
> {% endfor %}
>
> It tries to take element["header"], and it is not correct. How do I solve
> this problem?
>
> --
> Best regards,
> Rishat Muhametshin, technical writer
> Co BIT “Master”, Izhevsk, Russiahttp://friendfeed.com/rishatmuhametshin

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



Re: Handling upload, adding M2M relation before saving object in admin form

2010-03-15 Thread pjrhar...@gmail.com
On Mar 12, 12:42 pm, Henry A  wrote:
> Hi,
>
> For a client, I've got the following (simplified) models:
>
> class Document (models.Model):
>   file = models.FileField()
>
> class Publication (models.Model):
>   title = models.CharField()
>   ...
>   documents = models.ManyToManyField(Document)
>

Do you need a ManyToManyField here? I.E. can a document be in more
than one Publication? I suspect you actually want:

class Document (models.Model):
  file = models.FileField()
  publication = models.ForeignKey('Publication')

class Publication (models.Model):
  title = models.CharField()

Then you can use inline admin forms:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects

In 1.2 there is now a nifty jQuery interface so you can keep adding
documents.

Hope that helps

Peter

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



Re: REMOTE_ADDR

2010-03-15 Thread James Bennett
On Mon, Mar 15, 2010 at 8:45 AM, Ken Lacey  wrote:
> Using request.META['REMOTE_ADDR'] I get an error
>
> Exception Type: TemplateSyntaxError
> Exception Value: Could not parse the remainder: '['REMOTE_ADDR']' from
> 'request.METTA['REMOTE_ADDR']'
>
>
> How do I get over this?

The Django template documentation explains how to access elements of a
dictionary in a template; it might be a good idea to read through that
documentation, since if you missed that part you'll almost certainly
run into many more issues.


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

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



Re: REMOTE_ADDR

2010-03-15 Thread ge...@aquarianhouse.com
it seem to me, it's in the template.

when it should work like this:

{{ request.META.REMOTE_ADDR }}

btw:

> 'request.METTA['REMOTE_ADDR']' <--- in META is one T to much


On Mar 15, 2:45 pm, Ken Lacey  wrote:
> Hi
>
> I am trying to access the remote addr in a view.
>
> Using request.META['REMOTE_ADDR'] I get an error
>
> Exception Type: TemplateSyntaxError
> Exception Value: Could not parse the remainder: '['REMOTE_ADDR']' from
> 'request.METTA['REMOTE_ADDR']'
>
> How do I get over this?
>
> Thanks
>
> Ken

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



REMOTE_ADDR

2010-03-15 Thread Ken Lacey
Hi

I am trying to access the remote addr in a view.

Using request.META['REMOTE_ADDR'] I get an error

Exception Type: TemplateSyntaxError
Exception Value: Could not parse the remainder: '['REMOTE_ADDR']' from
'request.METTA['REMOTE_ADDR']'


How do I get over this?


Thanks

Ken

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



Re: Self Join

2010-03-15 Thread jrs
I see nothing on this page that is in the slightest bit related to my
question... Does anyone know if there is a way in the django orm to
accomplish my query above?

Thanks.

On Mar 13, 4:17 am, Daniel Roseman  wrote:
> On Mar 12, 10:54 pm, jrs  wrote:
>
>
>
> > I'm trying, without a great deal of success, to perform a simpleself
> >joinusing the django orm.  I'm pretty sure the F() function is not
> > the answer.  I believe this only allows you to compare two field
> > within the same model instance, not to compare fields within 2
> > instances of the same model.  I want to do this -
>
> > Model-
>
> > class Account(models.Model):
> >     name = models.CharField(max_length=255)
> >     parent_account = models.ForeignKey('self', default=None,
> > blank=True)
>
> > SQL-
>
> > SELECT account.*, parent.*
> > FROM account
> > LEFTJOINaccount parent ON
> >    account.id = parent.parent_account
>
> > This seems pretty basic, but I can't find any way to do it.
>
> > Thanks
>
> Accessing aselfjoinis no different from accessing any other related
> objects. Read this:http://docs.djangoproject.com/en/1.1/ref/models/relations/
>
> It helps not to think in terms of SQL, but in terms of objects, when
> using the ORM.
> --
> 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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Modelling question: TypeError at Post?

2010-03-15 Thread Karen Tracey
On Mon, Mar 15, 2010 at 6:07 AM, BobAalsma  wrote:

> I get a TypeError at Post from the admin interface and I suspect this
> is connected to my key definition, but couldn't find documentation on
> this.
>
> Any ideas?
>
> Error message:
> TypeError at /admin/LeadDeviceSysteem/vraagcomponentinhoud/add/
> coercing to Unicode: need string or buffer, VraagComponentModel found
> Request Method: POST
> Request URL:
> http://127.0.0.1:8000/admin/LeadDeviceSysteem/vraagcomponentinhoud/add/
> Exception Type: TypeError
> Exception Value:coercing to Unicode: need string or buffer,
> VraagComponentModel found
>
>
This coercing exception is almost always due to an incorrect __unicocde__
method definition. A __unicode__ method must return unicode (or string or
buffer, which can be coerced to unicode). Instead this one is returning a
VraagComponentModel:


[snip]
> class VraagComponentInhoud(models.Model):
>componentModel = models.ForeignKey(VraagComponentModel)
> [snip]
>def __unicode__(self):
>return self.componentModel
>
>
If you want to return the unicode representation of that ForeignKey, you
need to return unicode(self.componentModel).

Karen

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



register model on different App

2010-03-15 Thread Matias
Is there any way to register a model on a different app so that on the 
admin site I get it on a different "box"?


I've created a custom model, that I'd like to be shown on the "Auth" box 
instead of the default one (a box with my app's name).


Thanks!

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



Modelling question: TypeError at Post?

2010-03-15 Thread BobAalsma
I get a TypeError at Post from the admin interface and I suspect this
is connected to my key definition, but couldn't find documentation on
this.

Any ideas?

Error message:
TypeError at /admin/LeadDeviceSysteem/vraagcomponentinhoud/add/
coercing to Unicode: need string or buffer, VraagComponentModel found
Request Method: POST
Request URL:
http://127.0.0.1:8000/admin/LeadDeviceSysteem/vraagcomponentinhoud/add/
Exception Type: TypeError
Exception Value:coercing to Unicode: need string or buffer,
VraagComponentModel found

Variables:

VariableValue
componentAfstand1   u'1'
_save   u'Opslaan'
componentAfstand3   u'2'
componentAfstand2   u'1'
componentModel  u'1'
componentInhoud1u'a'
componentInhoud2u'b'
componentInhoud3u'c'
componentInhoud4u'd'

Definition:
class VraagComponentModel(models.Model):
naamKlant = models.ForeignKey(Klant, verbose_name = 'Firmanaam
van de klant')
componentGroepNummer = models.IntegerField(verbose_name =
'Nummer van componentgroep')
componentGroepOmschrijving = models.CharField(max_length=30,
verbose_name = 'Omschrijving van componentgroep' )
componentTypeNummer = models.IntegerField(verbose_name =
'Nummer van componenttype') # Componenten met nummer 0 gelden voor
hele klant; 1 t/m n zijn zoekopdrachten
componentTypeOmschrijving = models.CharField(max_length=30,
verbose_name = 'Omschrijving van componenttype' )
componentInsluiting = models.BooleanField(default = 'True',
verbose_name = 'Uitsluiten')# insluiten (T) of uitsluiten (F) van
deze component

def __unicode__(self):
return u'%s %s %s %s %s' % (self.naamKlant,
self.componentGroepNummer, self.componentGroepOmschrijving,
self.componentTypeNummer, self.componentTypeOmschrijving)

class Meta:
ordering =
['naamKlant','componentGroepNummer','componentTypeNummer']
unique_together = ("naamKlant",
"componentGroepNummer","componentTypeNummer")
verbose_name_plural = "vraagcomponentenmodel"

class VraagComponentInhoud(models.Model):
componentModel = models.ForeignKey(VraagComponentModel)
componentInhoud1 = models.TextField(verbose_name = 'Eerste
onderdeel')
componentAfstand1 = models.IntegerField(null = 'True',
verbose_name = 'Afstand in woorden tussen 1e en 2e onderdeel')
componentInhoud2 = models.CharField(null = 'True',
max_length=50, verbose_name = 'Tweede onderdeel')
componentAfstand2 = models.IntegerField(null = 'True',
verbose_name = 'Afstand in woorden tussen 2e en 3e onderdeel')
componentInhoud3 = models.CharField(null = 'True',
max_length=50, verbose_name = 'Derde onderdeel')
componentAfstand3 = models.IntegerField(null = 'True',
verbose_name = 'Afstand in woorden tussen 3e en 4e onderdeel')
componentInhoud4 = models.CharField(null = 'True',
max_length=50, verbose_name = 'Vierde onderdeel')

def __unicode__(self):
return self.componentModel

class Meta:
verbose_name_plural = "vraagcomponenteninhoud"


In SQLite:
sqlite> .indices LeadDeviceSysteem_vraagcomponentmodel
LeadDeviceSysteem_vraagcomponentmodel_naamKlant_id
sqlite_autoindex_LeadDeviceSysteem_vraagcomponentmodel_1

Regards,
Bob

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



Re: how to make radio buttion selected as form is loaded

2010-03-15 Thread Daniel Roseman
On Mar 15, 3:42 am, django_jedi  wrote:
> Hi All,
>
> Pardon a newbie.
>
> I'm building a form that will display workshop selections a person has
> made.  They'll be able to update their selections using this form.
>
> Selections are represented by radio buttons; I'm trying to make a
> radio button the "checked" option as I run through a loop, and nothing
> I try seems to work.  I'm using {% ifequal %} primarily:
>
> TEMPLATE:
> ---
> ...
> {% for object in workshops %}
>     object.id selections.groupA %} checked {% endifequal %}  />
> ...
> {% endfor %}
> ...
>
> VIEW:
> -
> ...
> workshops = [a queryset]
> selections = [a different queryset]
>
> return render_to_response('workshops/form.html',
>                 {
>                 ...
>                'selections': selections,
>                 'workshops': workshops,
>                 ...
>                 },
>                 context_instance=RequestContext(request))
>
> I can't seem to get the value of selections.groupA while inside the
> for loop; I can get it just fine anywhere else in the template.
>
> I may be barking up the wrong tree; I've scoured the Internet and the
> documentation to no avail.
>
> I would appreciate it if someone can point out what I'm missing and/or
> suggest an alternative.
>
> TIA

Assuming that 'groupA' is a model field, there's no such property as
'selections.groupA', because as you've stated, selections is a
queryset - ie a collection of model instances, not a single one.

However in general you'd be better off using Django's forms framework,
which outputs fields for you with all the correct attributes selected.
--
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-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



ANN: django-admin-tools 0.2.0 released

2010-03-15 Thread David Jean Louis

Hello,

I'm happy to announce the availability of the version 0.2.0 of 
django-admin-tools.


Django-admin-tools is a collection of extensions/tools for the default 
django administration interface, it includes:

 * a full featured and customizable dashboard,
 * a customizable menu bar,
 * tools to make admin theming easier.

Many bugs have been fixed and new cool features were added in this version:
http://pypi.python.org/pypi/django-admin-tools/

This version introduces some backwards incompatible changes:
- now, django-admin-tools stores menu and dashboard preferences in the 
database, so you'll need to run syncdb and to add the django-admin-tools 
urls to your urlconf.

  These steps are described in details in the documentation;
- You'll also need to add admin_tools to your INSTALLED_APPS for the 
locales to work (this was not documented in previous versions).


The project wiki (including screenshots), code and bugtracker are hosted 
on Bitbucket:

http://bitbucket.org/izi/django-admin-tools/

Django-admin-tools is generously documented, you can browse the 
documentation online here:

http://packages.python.org/django-admin-tools/0.2.0/

A good start is to read the quickstart guide:
http://packages.python.org/django-admin-tools/0.2.0/quickstart.html

Best regards,

--
David

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