group-objects-with-same-field-value

2012-05-14 Thread Panos Laganakos
Posted a question here: http://stackoverflow.com/questions/10583697/group-objects-with-same-field-value -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit

ANN: django-currencies 0.2.2

2010-12-03 Thread Panos Laganakos
Description: django-currencies allows you to define different currencies, and includes template tags/filters to allow easy conversion between them. Download: http://pypi.python.org/pypi/django-currencies/0.2.2 Documentation: http://packages.python.org/django-currencies/ Source Code:

ANN: django-currencies 0.2.1

2010-04-29 Thread Panos Laganakos
Description: django-currencies allows you to define different currencies, and includes template tags/filters to allow easy conversion between them. Download: http://pypi.python.org/pypi/django-currencies/0.2.1 Documentation: http://packages.python.org/django-currencies/ Source Code:

ANN: django-currencies 0.1

2009-06-13 Thread Panos Laganakos
http://code.google.com/p/django-currencies/ "django-currencies allows you to define different currencies, and includes template tags/filters to allow easy conversion between them." The package is registered on cheezeshop, you can give a try by `pip install django-currencies` (or easy_install).

Re: doctests in views.py

2008-05-23 Thread Panos Laganakos
You might wanna look into using the [1]Test Client. It allows you to build the request and see what the response is, pretty nice actually. [1] http://www.djangoproject.com/documentation/testing/#the-test-client On May 22, 9:31 pm, "Viktor Nagy" <[EMAIL PROTECTED]> wrote: > Hello, > > I've a

Re: 0.96.1 lighttpd + FastCGI

2008-05-07 Thread Panos Laganakos
=fastcgi+unhandled+exception#7455719663bebf05 On May 6, 9:05 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote: > This is the lighty setup: > > $HTTP["host"] == "manishop.solhost.org" { >    var.serverpath       = "/panos/manishop.solhost.org" >    server

0.96.1 lighttpd + FastCGI

2008-05-06 Thread Panos Laganakos
This is the lighty setup: $HTTP["host"] == "manishop.solhost.org" { var.serverpath = "/panos/manishop.solhost.org" server.document-root = basedir + serverpath + "/manigifts/static" server.errorlog = basedir + serverpath + "/logs/server.log" accesslog.filename = basedir +

Re: Translated DB

2008-05-03 Thread Panos Laganakos
Two projects exist: http://code.google.com/p/django-multilingual/ http://code.google.com/p/transdb/ DM uses an inner class on the model, to define the translatable fields. TransDB uses custom field types. Hopefully they'll be merged at some point or work on a new uniform way to do this. On

model_to_dict including foreign key's fields

2008-04-15 Thread Panos Laganakos
I am using 0.96.1, but I wanted to prepopulate a form from a model. So I grabbed `model_to_dict` from trunk. It works (I just had to replace `pk` with `id`), but, I need to be able to get data from a foreign key field. The model is a profile, which has a ForeignKey to `User`. Is it possible to

Re: Is middleware appropriate for this?

2008-04-11 Thread Panos Laganakos
Thanks for the link Chris, but this is not what I'm trying to do. I'm not worried about the way the price look, but the price currency itself. Since the user is allowed to select that per session. If there's a way for a filter to access the session variables I would be OK, since instead of

Re: Is middleware appropriate for this?

2008-04-11 Thread Panos Laganakos
sion, I am wondering if middleware is the answer here. But I have no prior middleware experience :) Maybe a template tag would do it, not sure if it gets access to the request. On Apr 11, 2:55 pm, Dan Ellis <[EMAIL PROTECTED]> wrote: > On Apr 11, 11:37 am, Panos Laganakos <[EMAIL PROTECTE

Is middleware appropriate for this?

2008-04-11 Thread Panos Laganakos
I've written a currency filter that takes the 3 letter code of a currency and gives you the price. {{ product.price|currency:"EUR" }} There's a context variable called CURRENCY which specifies the current session's currency. I'm not able to pass that variable in the filter itself instead of a

Re: inclusion tags and RequestContext

2008-04-04 Thread Panos Laganakos
thought that just by declaring context in the def, the template itself got access to all the context variables. On Apr 2, 11:03 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Apr 1, 3:40 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > > > > I changed the d

Re: inclusion tags and RequestContext

2008-04-01 Thread Panos Laganakos
, or am I supposed to get access to all of them once I include context as my first param? On Apr 1, 3:26 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote: > OK, I (think!) understand that. > > But what if the inclusion tag requires an argument, that's not always > in the same contex

Re: inclusion tags and RequestContext

2008-04-01 Thread Panos Laganakos
OK, I (think!) understand that. But what if the inclusion tag requires an argument, that's not always in the same context? On Apr 1, 3:12 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-04-01 at 04:58 -0700, Panos Laganakos wrote: > > Is there some way to have

inclusion tags and RequestContext

2008-04-01 Thread Panos Laganakos
Is there some way to have inclusion tags pick up on the variables available from REQUEST_CONTEXT_PROCESSORS? I've read about `takes_context` option, but I couldn't figure out if I could use it to get access to the above. --~--~-~--~~~---~--~~ You received this

Re: permalink decorator

2008-03-31 Thread Panos Laganakos
t; <[EMAIL PROTECTED]> wrote: > On Mon, Mar 31, 2008 at 12:35 PM, Panos Laganakos > > > > <[EMAIL PROTECTED]> wrote: > > >  I've switched my code from: > >         def get_absolute_url(self): > >                 return '/store/products/%s' % self.slu

permalink decorator

2008-03-31 Thread Panos Laganakos
I've switched my code from: def get_absolute_url(self): return '/store/products/%s' % self.slug to: @models.permalink def get_absolute_url(self): return ('django.views.generic.list_detail.object_detail', (), {

Re: Language code as part of URL

2008-03-31 Thread Panos Laganakos
We had some discussion about this on django-multilingual. Take a look here: http://groups.google.com/group/django-multilingual/browse_thread/thread/c394d3aed317a19a/b25464fa1f2aea4e#b25464fa1f2aea4e and yml's implementation (which is actually usuable):

Re: newforms 0.96.1 custom validation

2008-03-07 Thread Panos Laganakos
Thanks Malcolm, that was it! Newforms are starting to feel fun :) On Mar 6, 7:03 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-03-06 at 08:45 -0800, Panos Laganakos wrote: > > Trying to add custom validation for a customer creation form, but when >

newforms 0.96.1 custom validation

2008-03-06 Thread Panos Laganakos
Trying to add custom validation for a customer creation form, but when I add: def clean_username(self): try: user = User.objects.get(username__exact=self.cleaned_data['username']) except User.DoesNotExist: return self.cleaned_data['username']

newforms 0.96.1 custom validation

2008-03-06 Thread Panos Laganakos
Trying to add custom validation for a customer creation form, but when I add: def clean_username(self): try: user = User.objects.get(username__exact=self.cleaned_data['username']) except User.DoesNotExist: return self.cleaned_data['username']

Re: newforms 0.96.1 error list display

2008-03-02 Thread Panos Laganakos
008-03-02 at 02:24 -0800, Panos Laganakos wrote: > > I am used to doing things like: > >    label for="id_title">Title: {{ form.title }} > >    {% if form.username.errors %} > >            {{ form.username.errors|join:", " }} > >    {% endif

Re: newforms 0.96.1 error list display

2008-03-02 Thread Panos Laganakos
OST), it should display the errors by itself. On Mar 2, 12:15 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-03-02 at 02:04 -0800, Panos Laganakos wrote: > > It seems weird, true. It might be my mistake, but I can't seem to > > figure it out. Here it is: >

Re: how to deal with inherited template context variables?

2007-12-29 Thread Panos Laganakos
Check out Django Template Utils[1], it will probably fit your needs. [1] http://code.google.com/p/django-template-utils/ On Dec 29, 5:42 pm, Sam Lai <[EMAIL PROTECTED]> wrote: > Thanks Alex and hedronist. I'm leaning towards creating a generic > template tag that loads template context

make-messages

2007-11-28 Thread Panos Laganakos
I store my templates outside the project dir, but `make-messages` only looks inside from the dir I execute it. I tried symlinking (ln -s) the templates dir in the project dir, but it doesn't "follow". Any ideas? --~--~-~--~~~---~--~~ You received this message

Re: Django deployment à lá Capistrano

2007-11-11 Thread Panos Laganakos
I've put up the script I use for deploying our apps, on our internal work server. It's pretty ugly, but It could be extended/improved *alot*. It doesn't check about anything _at all_, it just works or doesn't. :) http://code.google.com/p/djdeliver Anyone who feels like contributing, just let me

Re: Generic/Views implementation decision

2007-10-03 Thread Panos Laganakos
efficient though, I'll try it out. On Oct 2, 6:51 pm, Lemuel Formacil <[EMAIL PROTECTED]> wrote: > On Sep 29, 2007, at 6:14 PM, Panos Laganakos wrote: > > > > > > > On Sep 28, 12:18 pm, Panos Laganakos <[EMAIL PROTECTED]> > > wrote: > >&g

Re: Generic/Views implementation decision

2007-09-29 Thread Panos Laganakos
to do it. On Sep 28, 12:18 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote: > Having two different models, ie: Toy, ToyPicture. > > ToyPicture, has a ForeignKey to Toy, so you can define many pictures, > that relate to a specific toy. > > The question is this: in which wa

Generic/Views implementation decision

2007-09-28 Thread Panos Laganakos
Having two different models, ie: Toy, ToyPicture. ToyPicture, has a ForeignKey to Toy, so you can define many pictures, that relate to a specific toy. The question is this: in which way should I make the data available for viewing? 1. Create list/detail generic views for Toy? That would mean I

Best Practice for translating db-stored values

2007-07-14 Thread Panos Laganakos
Using gettext_lazy, is the way to go, for marking models and fields for translation. 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

Re: Difference between a model's field and it's translated version - admin

2007-07-14 Thread Panos Laganakos
Thanks for pointing this out for me mate. I can't afford to switch to the trunk right now, but it's good to know that it has been taken care of. On Jul 14, 6:44 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2007-07-13 at 16:19 +0000, Panos Laganakos wrote: > > If I

Difference between a model's field and it's translated version - admin

2007-07-13 Thread Panos Laganakos
If I have the model specified as: class Candy(models.Model): name = models.CharField(_('name'), maxlength=25) The admin section, displays the field as, 'Name', while the translated version will appear as 'onoma', ie, the first letter isn't capitalized. The translated word is specified all

Re: Where did you put your homepage view?

2007-05-30 Thread Panos Laganakos
direct_to_template sounds like a nice way to handle the index page serving. But how can it be fed the dynamic content of one or more apps to display? Not sure how it's supposed to be done through "template tags" as Michel mentioned. On May 24, 5:42 pm, Michel Thadeu Sabchuk <[EMAIL PROTECTED]>

Re: URLPattern - can't fetch a detail page

2007-05-21 Thread Panos Laganakos
s the case, the you have to change the patterns in your include > urls.py and remove the "^" part of the pattern: > > urlpatterns = patterns > ( 'django.views.generic.list_detail' > , (r(?P[a-zA-Z0-9-_]+)/?$', 'object_detail', dict(news_list_info, > slug_field='slug')) >

Re: URLPattern - can't fetch a detail page

2007-05-21 Thread Panos Laganakos
-_]+)/?$ ^news/ ^/?$ ^admin/ The current URL, /news/hello/, didn't match any of these. On May 19, 9:57 am, Tyson Tate <[EMAIL PROTECTED]> wrote: > Can you post a stack trace and more details from your url.py file? > > -Tyson > > On May 18, 2007, at 1:05 PM, Panos Laganako

Re: URLPattern - can't fetch a detail page

2007-05-18 Thread Panos Laganakos
t; > '^/(?P[-\w]+)/?$' > > So you want: > > (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, > slug_field='slug')), > > or, conversely: > > (r'^/(?P[-\w]+)/?$', 'object_detail', dict > (news_list_info, slug_field='news_entry')), > > Regards, > Tyso

URLPattern - can't fetch a detail page

2007-05-18 Thread Panos Laganakos
I've set up the url pattern as: (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info, slug_field='news_entry')), The news_list_info: news_list_info = { 'queryset': Entry.objects.all(), 'allow_empty': True, } and both list and detail templates are in:

Re: SQLite - unsupported file format

2007-05-16 Thread Panos Laganakos
For reference purposes: http://jtauber.com/blog/2006/11/25/incompatible_sqlite_in_os_x_and_python On May 15, 9:17 pm, Panos Laganakos <[EMAIL PROTECTED]> wrote: > I haven't installed any pysqlite versions since I moved to 2.5 (from > OS X's default 2.3) Python, as sqlite3 is include

Re: SQLite - unsupported file format

2007-05-15 Thread Panos Laganakos
be a type mismatch? I'll if I can an updated binary of SQLite3 > 3.1.3 for OS X. On May 15, 1:47 pm, Lars Stavholm <[EMAIL PROTECTED]> wrote: > Panos Laganakos wrote: > > OS: Mac OS X - 10.4 > > SQLite: 3.1.3 > > Django: 0.96 > > Python: 2.5 > > > I've set the

SQLite - unsupported file format

2007-05-15 Thread Panos Laganakos
OS: Mac OS X - 10.4 SQLite: 3.1.3 Django: 0.96 Python: 2.5 I've set the DATABASE_ENGINE to 'sqlite3', and the db gets created when I call $manage.py syncdb And the project/apps all work fine. When I try to connect to it from the commandline 'sqlite3' tool, or pipe manage.py clearsql

Re: field model from external app, won't show up

2007-03-13 Thread Panos Laganakos
I came across, http://code.google.com/p/django-tagging/ which looks pretty interesting. I will be trying that out. Nonetheless, I'd still like to know what am I (if I am), doing wrong on my own implementation. On Mar 13, 6:11 pm, "Panos Laganakos" <[EMAIL PROTECTED]> wrote

field model from external app, won't show up

2007-03-13 Thread Panos Laganakos
I've created an app 'meta', which defines a 'Tag' model from the 'blog' app I do: from mysite.meta.models import Tag class Post(models.Model): ... tags = models.ManyToManyField(Tag, blank=True, null=True) ... then in the template file I try to: {% for tag in object.get_tag_list

Re: Generic Views - problem with template missing

2007-01-26 Thread Panos Laganakos
I've added the allow_future option, and indeed it worked. Thanks alot! Though, not sure what "in the future" means. a matter of the date not being the same in the db and the server or something? Care to explain? On Jan 26, 1:08 am, "James Bennett" <[EMAIL PROTECTED]>

Re: Generic Views - problem with template missing

2007-01-20 Thread Panos Laganakos
hem in the template? > G > > On 1/20/07, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > > > > I'm using Django 0.95 release. > > > I've got a simple blog, which I wanna move to generic views. > > > in settings.py: > > TEMPLATE_DIRS = ( >

Generic Views - problem with template missing

2007-01-20 Thread Panos Laganakos
I'm using Django 0.95 release. I've got a simple blog, which I wanna move to generic views. in settings.py: TEMPLATE_DIRS = ( '/home/panos/projects/panos/templates', ) in ./blog/urls.py: from django.conf.urls.defaults import * from panos.blog.models import Post info_dict = {

ImageField on admin

2006-11-03 Thread Panos Laganakos
Defined a simple Image model: class Image(models.Model): image = models.ImageField(upload_to='mockups/%Y/%m/%d') settings.py: MEDIA_ROOT = '/home/panos/web-projects/media/panosart/' MEDIA_URL = 'http://10.0.0.5:8000/site_media/' urls.py: (r^site_media/(?P.*)$',

Storing images in the db

2006-10-31 Thread Panos Laganakos
I'm going to work a small photo managment app for an LAN site here, and I wanted to hear some opinions. >From what I've seen people tend to store images outside the db and just keep their location field to grab em. What are the advantages/disadvantages of doing so? That way the httpd gets to

Re: Dojo vs Mochikit for Django dev?

2006-10-17 Thread Panos Laganakos
You might wanna give a look at http://script.aculo.us/ I've used it outside of Django and was pretty satisfied. On Oct 18, 3:18 am, João Cruz Morais <[EMAIL PROTECTED]> wrote: > I suggest using prototype or the smaller/limited version, mooflex. > > João > > Wilson Miner wrote: > > Dojo is

Django Project Manager for Vim

2006-10-10 Thread Panos Laganakos
I've written a suggestion, about creating a vim plugin that will aid in the django development process for the Vim users. Read the suggestion on django's wiki: http://code.djangoproject.com/wiki/UsingVimWithDjango I don't 'speak' Ex/Exim, so if a django user is familar with it and would like to

Re: No table colums, except id

2006-10-09 Thread Panos Laganakos
> There are a few corner cases for objects that only have an implicit > primary key field like this. Working with them in the admin interface is > one of the areas that may or may not work. It's not really worth us > putting in an enormous amount of time to get all of this ironed out, > since you

Re: No table colums, except id

2006-10-09 Thread Panos Laganakos
. So, I'll try specifying an explicit a primary key to it. But it would be great to iron these little issues out at some point till 1.0 Thanks for the tip too :) On Oct 9, 3:54 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2006-10-08 at 14:52 -0700, Panos Laganakos wrote:

Re: No table colums, except id

2006-10-08 Thread Panos Laganakos
> Try using the same pattern you' ve used with the Dvd class with the > inner Admin class, > like this: > > class Dvd(models.Model): > pass > > class Admin: > pass > > That should solve both problems (that really are of the same issue, when > an admin view has been

No table colums, except id

2006-10-08 Thread Panos Laganakos
What I'm doing is this: class Dvd(models.Model): pass class File(models.Model): #... dvd = models.ForeignKey('Dvd', blank=True, null=True) I'm using blank and null, 'cause the file might not be backed up to a DVD yet. Problem is, I'm not sure how to define something to 'class

Re: Integrity Error, regarding NULL values

2006-03-13 Thread Panos Laganakos
>From the http://code.djangoproject.com/wiki/NewbieMistakes Problem ¶ When you have a Field: current_zip = meta.IntegerField(maxlength=5,blank=True) django will create a not nullable field in the DB. However leaving the field blank (in admin/web) django will try and insert a NULL value in the

Re: Integrity Error, regarding NULL values

2006-03-13 Thread Panos Laganakos
Hey Tim, Yeah, I understand what you mean, but I thought that django used "" by default and not NULL. That's why I defined in my model to allow blank, and not include null=True. Part of the model is this: class Factor(meta.Model): 20 first_name = meta.CharField(maxlength=25)

Integrity Error, regarding NULL values

2006-03-13 Thread Panos Laganakos
Hello, I am getting an IntegrityError: ERROR: null value in column "factor_id" violates not-null constraint INSERT INTO "products_companies" ("name","phone","factor_id") VALUES ('test','',NULL) Although I have specified in its model, that I want to allow the factor_id to be blank: class

Re: Adding new properties post sql build

2006-03-13 Thread Panos Laganakos
Thanks guys. --~--~-~--~~~---~--~~ 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]

Adding new properties post sql build

2006-03-13 Thread Panos Laganakos
Hello, I have an item_type table which allows the user to add new types of items himself. Problem is that except the basic properties that are included in the item table, he might need to define item specific ones (properties). I discussed it a bit with a friend and talked about adding an extra

Model Subclassing and some questions

2006-03-12 Thread Panos Laganakos
Hello, I am defining a Product class that gets inherited by various products, so I am defining in it all the base attributes that exist on all child products. I want to know if its possible to forbid changing the actual "products" table unless you add one of the actual child products. Also,

Making Django Development server available to local network.

2006-02-05 Thread Panos Laganakos
Hello, I am using a local server for all web development stuff. So I set up django on it and started the tutorial. Thing is, that when I try '$ python manage runserver 10.0.0.3:8000' to start the server, it won't make it available to the network. I tried doing it with admin privileges, but