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
https://groups.google.com/d/msg/django-users/-/fdG
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: https://launc
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: https://launc
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).
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 ver
Compile Django templates, to static HTML.
I wrote this for a friend designer, who wanted to learn django
templating without having to set up a project/app etc.
It's as simple as doing:
1. sleepy.py --startproject=projname
2. "write the templates :)"
3. sleepy.py --make
So this is intended mostl
mp;q=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"
> se
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 +
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 M
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 ma
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 multip
iables or the request session, 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 Laga
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
s
ing for. I 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 change
contextvar']
}
Is this normal, 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
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
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 mess
onathan Buchanan" <[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 '
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', (), {
'slug':
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):
http://yml-blog.blogspot.com/search/label/I
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
>
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']
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']
ROTECTED]>
wrote:
> On Sun, 2008-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:", &
, 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
> I will take a look at it to see if there are any errors there. Also
> just double check the source of the code and make sure the errors are
> being hidden in the markup.
>
> On Mar 1, 10:24 am, Panos Laganakos <[EMAIL PROTECTED]> wrote:
>
> > I've started u
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 processor
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 beca
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
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:
> &
st* way 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: i
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
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 the
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 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 l
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]> w
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,
> slu
ulting 404 page:
Using the URLconf defined in myproj.urls, Django tried these URL
patterns, in this order:
^news/ ^/(?P[a-zA-Z0-9-_]+)/?$
^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 po
e
> named it in your RegEx:
>
> '^/(?P[-\w]+)/?$'
>
> So you want:
>
> (r'^/(?P[-\w]+)/?$', 'object_detail', dict(news_list_info,
> slug_field='slug')),
>
> or, conversely:
>
> (r'^/(?P[-\w]+)/?$', 'object_d
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:
/templates/news/
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
must 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
>
> >
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 [appname],
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]>
wro
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 %}
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]
I've defined them 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:
&g
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 = {
'queryset
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.*)$', django.views.static.serve'
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 ser
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 design
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
> 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
> I'd also recommend the snippetsemu plugin as well but that's because I
> wrote it.http://www.vim.org/scripts/script.php?script_id=1318
> There's tips for it on the django
> wiki:http://code.djangoproject.com/wiki/UsingVimWithDjango
Vim and snippetsEmu for me too. Its really easy to use Snip to
citly.
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 Laganak
> 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 activated/de
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 Adm
Great Job mate,
thanks for releasing.
--~--~-~--~~~---~--~~
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 em
Hello,
The project I've been working is going to be used only internally in a
company.
So far I've been working only on modifying the admin interface for
actual usage, as I haven't felt an outside view is needed.
Though the more things I need to do, the more I find myself modifying
the admin te
>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 D
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)
21
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 Company(
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]
F
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
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, wha
I don't have any firewall enabled while I'm trying this though.
I'll dig into a bit more and report back,
Thanks.
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 stil
67 matches
Mail list logo