Re: Do you code django with Komodo?

2008-06-24 Thread Jökull

What OS are you running? I'm on Windows and use e-texteditor which has
support for TextMate bundles. You can get some pretty nice Django
bundles which will do a lot of autocompleting and such tasks.

Komodo seems to have a couple of nice things going for it - mainly SVN
support. In my setup I'm doing everything off a development Linux
server with an SSH mount - so I've got a Putty window open to do all
my SVN tasks. Works for me and e-texteditor is the best I've seen on
any platform.

On Jun 24, 9:56 am, ristretto.rb <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Do you code python/django in Komodo?  Care to share your bookmarks?
> And tips on how to set it up to get the most out of Komodo for django
> dev?  Do you use the Editor or the IDE?
>
> I'm new to django and python, and based on some research on this site,
> I started looking into the Komodo Editor.   I'm considering buying a
> license for the IDE.
> I hate to have to ask this here, but I'm finding the Komodo
> documentation hard to find.  I'm seeing code completion to be buggy.
> And, there doesn't seem to be much Django specific about it, other
> than syntax coloring for django templates.
>
> If Komodo isn't the right choice, feel free to suggest something else.
>  Is it the best?
>
> Thank You
>
> p.s.  django is a killer framework on top of a super-cool language.
> big thanks to all of you that make it available.  (I hope to get clued
> up enough to contribute at some point.)
--~--~-~--~~~---~--~~
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: Sorting

2008-01-01 Thread Jökull

I'll suggest the sortable  in ui.jquery.com for front end. On
ordering you may want to run some serialize function in JavaScript and
submit with AJAX to a function that writes the order. Another flavor
is to simple put move_up and move_down functions to your model. There
is an example of this on djangosnippets.org. You could bridge the
sortable UI component by just submitting how many places to move a
particular row down/up. This would scale better as you're only posting
two values (object id and positions up/down) and not a huge array that
triggers a SQL for every row. You may want to think about pagination
as well. I'm not sure how I would accomplish sortable lists with very
large datasets. The solution depends on the scale I suppose.

On Jan 1, 10:42 pm, hedronist <[EMAIL PROTECTED]> wrote:
> > Would a separate model be appropriate to accomplish this?
>
> Perhaps. You didn't say how large the data set is. If there is only
> one ordering, then simply having an additional integer field on the
> model might be more useful. That way you can do something like:
>
>    objs = mymodel.objects.order_by('my_ordering_field')
>    for obj in objs:
>       
>
> As far as ordering things (again, assuming that things fit on one web
> page), you might look at:
>
> http://interface.eyecon.ro/docs/sort
> orhttp://tool-man.org/examples/sorting.html
>
> Both of which do javascripty things with lists. When done, just ship
> the final ordering back to the server.
>
> Good Luck
--~--~-~--~~~---~--~~
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: Outputting MS word-friendly format

2007-12-19 Thread Jökull

A quick google returned this:
http://pyrtf.sourceforge.net/

On Dec 19, 3:13 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Like the title says, I'd like to output a word-friendly format.
> Obviously plain text is trivial, but I'd like to have a doc or at
> least rtf format. Can anyone point me in the right direction?
--~--~-~--~~~---~--~~
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: sending >500 emails using send_email in a for loop

2007-12-19 Thread Jökull

You may want to have a look at http://groups.google.com/group/django-mailer

It seems to have died halfway complete but there is a bit of
discussion and at least some code you could look at.

Jökull

On Dec 18, 9:18 pm, "Peter Baumgartner" <[EMAIL PROTECTED]> wrote:
> I've built a newsletter app that currently cycles through 500+ emails
> and I'd like to have it scale to handle more.
>
> Currently I just have code like this in my view:
>
> for recipient in email_list:
> msg = EmailMultiAlternatives(email.subject, email.message_text,
> email.sender, [recipient])
> msg.attach_alternative(email.message_html, 'text/html')
> msg.send()
>
> it seems to hang up the browser for quite a while with even just a few
> emails. What is the best way to do this and give the user confirmation
> that the email has been sent to everyone?
>
> Should I fork off a new process? If so, how can I be sure it finishes
> successfully?
>
> --
> Pete
--~--~-~--~~~---~--~~
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: Scaling architecture question: separate media server

2007-10-30 Thread Jökull

Maybe a SFTP mount or some sort of rsync will suffice?

On Oct 29, 4:18 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On 10/29/07, Jökull <[EMAIL PROTECTED]> wrote:
>
> > There is a lively discussion on an interesting upcoming feature of
> > Django called FileStorage. This will allow any sort of file storage
> > mechanism to plug into FileFields and process uploads. A good example
> > would be Amazon's S3 where a FileStorage module would handle the
> > authentication and HTTP's for S3 and supply callables like
> > get_FIELD_filename to Django. Awesome stuff and I hope my
> > understanding is correct : )
>
> Yes, your understanding of that proposal is correct. I can't really
> speak to the rest of your questions about NFS, and I'm certainly no
> expert there. However, keep an eye out once the filestorage stuff goes
> in, because that will enable me to release the AudioField that I've
> been working on for a while. It basically uses Mutagen[1] to retrieve
> title, duration and bitrate from an audio file and populate model
> fields, just like how ImageField populates width and height fields.
>
> Sorry, folks, most of this was a bit off-topic.
>
> -Gul


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Scaling architecture question: separate media server

2007-10-29 Thread Jökull

I am in the planning stage of creating a Django media player. It is
intended for a small group of users, but still anticipating a lot of
bandwidth usage both upload and download as this is an MP3 repository
with a web frontend.

There is a lively discussion on an interesting upcoming feature of
Django called FileStorage. This will allow any sort of file storage
mechanism to plug into FileFields and process uploads. A good example
would be Amazon's S3 where a FileStorage module would handle the
authentication and HTTP's for S3 and supply callables like
get_FIELD_filename to Django. Awesome stuff and I hope my
understanding is correct : )

In the Django book the author mentions NFS as a solution for separate
media servers. This is a quick and easy method where you mount a magic
directory which pipes everything to a separate server running nignx or
a smilar purpose built environment. I'll be hosting the file server on
a home fiber optics cable with decent upload and the Django app will
be on a slice host optimized for Django. Are there limitations to NFS
and/or is it recommended for local mapping only? I've read that NFS is
an ancient standard and not very good or suited for these purposes.
Has anyone used SSH mappings between servers for such uses?
Paramiko[1] looks like a very nice and secure framework for SSH
connections within Python apps. Could Paramiko be a stone's throw away
from an SSH FileField in Django once we have the FileStorage framework
to play with?

A bit vague here I know. As I said just gathering a feeling for what's
being done in other Django projects to reach these ends.

1: http://www.lag.net/paramiko/


--~--~-~--~~~---~--~~
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: newforms __init__

2007-08-30 Thread Jökull

Awesome. Thanks!

BTW it's right there in the documentation. Apologies.

http://www.djangoproject.com/documentation/newforms/#using-a-subset-of-fields-on-the-form

On Aug 30, 3:40 pm, daev <[EMAIL PROTECTED]> wrote:
> То remove fields from from you don't need to use __init__
> form_for_model, form_for_instance function has _fields_ parameter
> where you can specify all the fields you need/ Example:
>
> Form  = form_for_model( Article, fields = ( "title", "text",
> "tags" ) )
>
> Creates form with this three fields of model.


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



newforms __init__

2007-08-30 Thread Jökull

Does anyone have a code example of __init__ where you modify a
form_for_inst/model to remove some fields? I'm trying to build an edit
form but don't want to expose all fields of the model. Maybe I missed
it but I didn't see this scenario covered in the newforms
documentation.

Is this maybe not the right way to go about this kind of scenario. I
thought of building a custom form that closely mirrors the model and
then tying it into an instance at the end before saving.

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: Admin Look

2007-08-23 Thread Jökull

Have a look at the CSS file the admin pages use. You can include it in
your projects.

For a login see other threads - this is already documented.

On Aug 23, 1:03 pm, eyscooby <[EMAIL PROTECTED]> wrote:
> Hello
> I was wondering, if it is possible to have the look/feel of the django
> admin page as part of the main application page.  I like the colors
> and style used for the admin page and would like to have the app page
> look something like that.
> Also, is it possible to use/create a login page, similar to the admin
> page has, when someone enters the application.  I have really enjoyed
> learning python and django, still a beginner, but very excited about
> what I am learning.
>
> thanks so much


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



Re: django app for managing sending email to users...

2007-08-07 Thread Jökull

I have an implementation of a mass mailing functionality. Basically a
"campaign" is constructed in the admin interface. There is a preview
field and if filled it short-circuits the save functionality. If the
preview is left blank users and a campaign id are put into a
"dispatch" table where each entry is marked as "not-sent". There is a
cronjob on my box that runs a standalone Django script that sends off
batches of x emails at y interval from the "not-sent" entries in the
dispatch table. I've also written code so that admins can follow the
progress of the dispatches (in percentages). I also have a simple sign-
up and unsubscribe feature that ties in.

Some other features I'd like to incorporate:
Fexibility with templates of emails. Maybe pick from a drop-down.
A "mailbug" feature. This is a hidden .gif in each email. When
downloaded it hits a counter on the server with a hash that
corresponds to that dispatch and marks it as read. Of course this is
only when images are downloaded but a good indicator of the emails
"success" if you want.
Optional verification of email addresses.

If anyone is interested in this code I'll happily contribute!


--~--~-~--~~~---~--~~
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: Best Practice for translating db-stored values

2007-07-15 Thread Jökull

Have you looked at django-multilingual?

http://code.google.com/p/django-multilingual/

I'm about to have a go at implementing this. It looks great for
multilingual content sites.

On Jul 14, 5:27 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote:
> Using gettext_lazy, is the way to go, for marking models and fields
> fortranslation.
>
> Is there some general suggestion we're to follow, for translating
> values stored in the db?
>
> ie, let's say it's a model:
>
> class Furniture(models.Model):
> name = models.CharField(_('name'), maxlength=25)
>
> If the app supports more than one language, how are we to get the
> translated versions of a value, ie:
>
> >>> furniture = Furniture.objects.get(id=1)
> >>> car.name
> >>> 'chair'
>
> should I define atranslationvariable so I'll be able to get the
> translated version from the template?
>
> Adding a new field just for name_another_lang, sounds like overkill,
> not extendable.


--~--~-~--~~~---~--~~
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: syncdb building freaky database

2007-07-12 Thread Jökull

Thank you all for quick responses. I feel a bit silly trying to put
unique=true for a boolean.

What I was trying to accomplish though: Only one value can have the
boolean set to "true".

Also (here I am taking the whole hand when you guys have offered a
finger) ... have any of you implemented some kind of custom position/
order element into an object accessible from the admin interface?

On Jul 12, 11:43 pm, oggie rob <[EMAIL PROTECTED]> wrote:
> The statements seem fine, just that your models don't reflect what you
> are after.
>
> 1. if you set null=True, the database lines would read "NULL" instead
> of "NOT NULL". blank=True refers to whether the value can be empty
> (i.e. NULL is not equal to ''). However for most CharFields you will
> want to keep it saying "NOT NULL".
> 2. the field "front" is a boolean field, but also is unique. You can't
> have more than two entries (and obviously one has to be True, one
> False), but you are seeing it after only one entry because both the
> first and second records are False.
>
>  -rob
>
> On Jul 12, 3:22 pm, Jökull <[EMAIL PROTECTED]> wrote:
>
> > 1. All fields have 'NOT NULL' and are required - this does not reflect
> > my model
> > 2. I get strange errors in the admin when adding a second item of
> > anything : IntegrityError at /admin/portfolio/work/add/ (1062,
> > "Duplicate entry '0' for key 2")
>
> > portfolio/models.py
> > ---
>
> > from django.db import models
> > import datetime
> > import os
>
> > # Create your models here.
>
> > class Tag(models.Model):
> > title = models.CharField('Titill',maxlength=100,unique=True)
> > slug = models.SlugField(prepopulate_from=('title',))
>
> > def __unicode__(self):
> > return self.title
> > class Admin:
> > pass
>
> > class Portfolio(models.Model):
> > created_date = models.DateTimeField(auto_now_add=True)
> > title = models.CharField('Titill',maxlength=100)
> > slug =
> > models.SlugField(prepopulate_from=('title',),unique_for_date='created_date',)
> > hidden = models.BooleanField('Fela',default=False)
>
> > def __unicode__(self):
> > return self.title
> > class Admin:
> > pass
>
> > class Work(models.Model):
> > created_date = models.DateTimeField(auto_now_add=True)
> > image = models.ImageField('Mynd',upload_to='upload/images/
> > work/',help_text='Aðeins uploada JPEG myndum (með .jpg endingu)')
> > title = models.CharField('Titill',maxlength=100)
> > subtitle = models.CharField('Undirtitill',maxlength=100,blank=True)
> > description = models.TextField('Lýsing',blank=True)
> > hidden = models.BooleanField('Fela',default=False)
> > front = models.BooleanField('Á forsíðu',default=False,unique=True)
> > tags = models.ManyToManyField(Tag,blank=True,verbose_name='Flokkar')
> > portfolio = models.ForeignKey(Portfolio)
>
> > def __unicode__(self):
> > return '%s - %s' % (self.title,self.portfolio)
> > def thumbnail(self):
> > file_path = self.get_image_url()
> > file, ext = os.path.splitext(file_path)
> > file = file + "_thumb_128x128.jpg"
> > if(file_path):
> > return ' > />' %
> > (file_path, file)
> > thumbnail.short_description = 'Mynd'
> > thumbnail.allow_tags = True
> > class Admin:
> > list_display = ('__unicode__','portfolio','thumbnail')
> > class Meta:
> > ordering = ['title']
>
> > class Event(models.Model):
> > created_date = models.DateTimeField(auto_now_add=True)
> > start_date = models.DateField('Opnunardagur')
> > end_date = models.DateField('Lokunardagur')
> > title = models.CharField('Titill',maxlength=100)
> > slug =
> > models.SlugField(prepopulate_from=('title',),unique_for_month='created_date')
> > portfolios = models.ManyToManyField(Portfolio,blank=True)
> > description = models.TextField('Lýsing',blank=True)
> > hidden = models.BooleanField('Fela',default=False)
>
> > def __unicode__(self):
> > return self.title
> > def publish_status(self):
> > if (self.end_date >= datetime.date.today()) & 

syncdb building freaky database

2007-07-12 Thread Jökull

1. All fields have 'NOT NULL' and are required - this does not reflect
my model
2. I get strange errors in the admin when adding a second item of
anything : IntegrityError at /admin/portfolio/work/add/ (1062,
"Duplicate entry '0' for key 2")


portfolio/models.py
---

from django.db import models
import datetime
import os

# Create your models here.

class Tag(models.Model):
title = models.CharField('Titill',maxlength=100,unique=True)
slug = models.SlugField(prepopulate_from=('title',))

def __unicode__(self):
return self.title
class Admin:
pass

class Portfolio(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
title = models.CharField('Titill',maxlength=100)
slug =
models.SlugField(prepopulate_from=('title',),unique_for_date='created_date',)
hidden = models.BooleanField('Fela',default=False)

def __unicode__(self):
return self.title
class Admin:
pass

class Work(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
image = models.ImageField('Mynd',upload_to='upload/images/
work/',help_text='Aðeins uploada JPEG myndum (með .jpg endingu)')
title = models.CharField('Titill',maxlength=100)
subtitle = models.CharField('Undirtitill',maxlength=100,blank=True)
description = models.TextField('Lýsing',blank=True)
hidden = models.BooleanField('Fela',default=False)
front = models.BooleanField('Á forsíðu',default=False,unique=True)
tags = models.ManyToManyField(Tag,blank=True,verbose_name='Flokkar')
portfolio = models.ForeignKey(Portfolio)

def __unicode__(self):
return '%s - %s' % (self.title,self.portfolio)
def thumbnail(self):
file_path = self.get_image_url()
file, ext = os.path.splitext(file_path)
file = file + "_thumb_128x128.jpg"
if(file_path):
return '' %
(file_path, file)
thumbnail.short_description = 'Mynd'
thumbnail.allow_tags = True
class Admin:
list_display = ('__unicode__','portfolio','thumbnail')
class Meta:
ordering = ['title']

class Event(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
start_date = models.DateField('Opnunardagur')
end_date = models.DateField('Lokunardagur')
title = models.CharField('Titill',maxlength=100)
slug =
models.SlugField(prepopulate_from=('title',),unique_for_month='created_date')
portfolios = models.ManyToManyField(Portfolio,blank=True)
description = models.TextField('Lýsing',blank=True)
hidden = models.BooleanField('Fela',default=False)

def __unicode__(self):
return self.title
def publish_status(self):
if (self.end_date >= datetime.date.today()) & (self.start_date 
<=
datetime.date.today()):
return 'Sýning í gangi'
elif (self.start_date > datetime.date.today()):
return 'Sýning ekki farin í gang'
elif (self.end_date < datetime.date.today()):
return 'Sýning búin'
publish_status.short_description = 'Tímasetning'
publish_status.allow_tags = True
def duration(self):
return self.end_date - self.start_date
duration.short_description = 'Tímalengd'
class Meta:
ordering = ['-start_date']
class Admin:
list_display =
('__unicode__','start_date','end_date','duration','publish_status')

class Artist(models.Model):
created_date = models.DateTimeField(auto_now_add=True)
name = models.CharField('Nafn',maxlength=100)
slug = models.SlugField(prepopulate_from=('name',),unique=True)
file = models.ImageField('CV',upload_to='upload/images/
artist/',help_text='Aðeins uploada JPEG myndum (með .jpg endingu)')
email = models.EmailField()
portfolios = models.ManyToManyField(Portfolio,blank=True)

def __unicode__(self):
return self.name
class Meta:
ordering = ['name']
class Admin:
pass



$ python manage.py sql portfolio
---

BEGIN;
CREATE TABLE `portfolio_work` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`created_date` datetime NOT NULL,
`image` varchar(100) NOT NULL,
`title` varchar(100) NOT NULL,
`subtitle` varchar(100) NOT NULL,
`description` longtext NOT NULL,
`hidden` bool NOT NULL,
`front` bool NOT NULL UNIQUE,
`portfolio_id` integer NOT NULL
)
;
CREATE TABLE `portfolio_portfolio` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`created_date` datetime NOT NULL,
`title` varchar(100) NOT NULL,

Re: Django + newforms + jQuery

2007-07-12 Thread Jökull

What do you mean? Perhaps you should go to the jQuery-EN group and
look for examples of form manipulation there.

J

On Jul 12, 7:42 am, Przemek Gawronski <[EMAIL PROTECTED]>
wrote:
> Hi, any one willing to share some examples of django newforms with
> jQuery?
>
> Thanks in advance!
>
> Przemek
> --
> AIKIDO TANREN DOJO  -   Poland - Warsaw - Mokotow - Ursynow - Natolin
> info:http://www.tanren.pl/phone: +4850151 email: [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
-~--~~~~--~~--~--~---