+'.')
path = i18npath
if path[0] in ('"', "'") and path[-1] == path[0]:
return ConstantIncludeNode(path[1:-1])
return IncludeNode(bits[1])
register.tag('my18n_include')(do_i18n_include)
Note: there's no fallback yet to
Hi All,
I have an include tag to a file with context help information. My app is fully
i18n-ed, but I don't want to handle the bigger the helptext via i18n because of
its size. I want to end up with something like this:
myapp/customer_side.en.html.
The code snippet:
{% include "myapp/cu
Francis,
I'm not a designer but I start my global layout on paper or in my head and then
it's (x)html and CSS. The first thing that comes to mind on doing this
electronically is photoshop (and siblings ... CS3?). And the Gimp but that
would not be a good choice on OSX (gui handling wise).
Reg
The answer to the Q in the subject would be not to use the {% trans .. %} or {%
load i18n %} tags in your template .. :)
Armandas wrote:
> Hi,
>
> I am using internationalization on my project. Recently I found out
> that output from date filter is not in english. The point is, that I
> use thi
Armandas,
Not exactly sure what you mean ... imho: when working properly your date should
be not formatted in your template but before that. When you are working with
locales for instance.
You might want to look at templatetags, then you can use {% your_own_tag %} and
have it build a date-ish
rd,
> sorry but I don't understand your setup.
> Could you show us some sample code which does the actual navigation list?
>
> Thank you very much for your time
>
> On Tue, Sep 30, 2008 at 1:53 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Hi All,
>>
>
My personal favorite is "Editra"
Regards,
Gerard.
zjffdu wrote:
> I am a newbie of django, and want to know which IDE is suit for
> django?
>
> thank your
> >
--
urls = { 'fun': 'www.zonderbroodje.nl', 'tech': 'www.gp-net.nl' }
--~--~-~--~~~---~--~~
You
Fabio,
If you define de foreignkey in the license model, you can create persons
without a problem. The only requirement then for creating a license would be
that it needs an existing person. Something like this:
class Person(models.Model):
name = models.CharField(max_length=30)
clas
You can simply add this to your keywords in google (and thus use google):
site:www.djangosnippets.org
End result:
http://www.google.nl/search?q=site%3Awww.djangosnippets.org+state
Regards,
Gerard.
David Durham, Jr. wrote:
> The list navigation on djangosnippets is not so good. Take this pag
Dan,
I know a workaround which is this:
django_admin = __import__('django-admin', fromlist=['django.bin'])
But I'm not into Django's code enough to know how it is generally done.
Regards,
Gerard.
Dan Ellis wrote:
> On Oct 8, 11:22 am, Malcolm Tredinnick <[EMAIL PROTECTED]>
> wrote:
>
>> The
pro's only do a checkout of let's say the branch you're working on
instead of the 'full tree' with trunks, tags and branches?
Thanx again guys!!
Gerard.
Gerard Petersen wrote:
> Hi all,
>
> This might be somewhat off topic, but I'm moving my django p
Hi all,
This might be somewhat off topic, but I'm moving my django project into another
directory (svn branch).
It was here: /home/gerard/files/python/djapp/(myapp)
I want it here: /home/gerard/files/python/djapp/branches/0.1/(myapp)
When the project dir is named 0.1 instead of djapp I get a
per, I
can not offer more then testing and or writing docs.
Thanx again guys!
Regards,
Gerard.
Russell Keith-Magee wrote:
> On Fri, Oct 3, 2008 at 5:13 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> I examined the svn tree and the patches. It seems that the diffs are fo
not put it in
the source tree?
Is there (besides the source code ... ;-) any reading in regards to Django how
this is setup?
Thanx a lot!
Regards,
Gerard.
Russell Keith-Magee wrote:
> On Thu, Oct 2, 2008 at 7:00 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Hi all,
>
,
Gerard.
Russell Keith-Magee wrote:
> On Thu, Oct 2, 2008 at 7:00 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> I'm in need of the functionality of ticket #3672. I have de initial code
>> implemented. And there are some patches, but the
Hi all,
I'm in need of the functionality of ticket #3672. I have de initial code
implemented. And there are some patches, but they seem to be diffs on files in
the main svn trunk.
The question with the easiest solution for me would be, when is the code from
this ticket going to be merged wit
27;: _('Cancelled'),
'ordered': _('Ordered'),
'billed': _('Billed'),
'paid': _('Paid')
}
This way I can access the states as usual, and have the related translation
displayed.
Regards,
Gerard.
Carl Meyer w
stuff like
order.bill() and order.is_billed()
If not, please clearify.
Thanx a lot.
Regards,
Gerard.
Carl Meyer wrote:
> On Sep 30, 2:58 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> It is indeed stored, I'm using a state machine
>> (http://www.djangosnippets.org/snippets
d for control) also have a meaning to
the user displayed in the template. So I would want to translate them at the
last moment, and not store them as such.
Regards,
Gerard.
Kenneth Gonsalves wrote:
> On Tuesday 30 September 2008 10:40:15 am Gerard Petersen wrote:
>> #~ msgid "quoted&
e on how a datefield contents then would be correctly presented in a
form when the format deviates from how it's stored in a mySQL database?
Thanx!
Gerard.
Carl Meyer wrote:
> On Sep 30, 7:29 am, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> I get this trace:http://paste.pocoo.or
Hi all,
I've been trying to workout a solution on the following: I want to show the
translation of a string stored in the database in a template preferably with
the use of "|capfirst" .. yeah yeah I know .. ;-)
The translatable: order.state = 'billed' .. The term 'billed' is what needs to
be
Hi,
Using https://application.oursite.com/ would imho be the only simpel solution.
An SSL certificate is IP bound, and if you are to serve plain and secure on 1
domain name, you're in for an administrative nightmare.
https://www.oursite.com/application/ is possible but then you need to keep
t
Steven,
Sorry, I replied to the wrong message in this thread. Your setup is actually
quite charming.
Regards,
Gerard.
Steven Armstrong wrote:
> Alex Rades wrote on 09/30/08 09:03:
>> Hi,
>> what kind of pattern do you use to add a class attribute to the
>> current page being viewed?
>> I mean
Hi All,
I don't understand why it's needs to be so complicated. When using a 'double'
template inheritance, e.g: base > base_products > product_add
There's only one place where you have to maintain some navlist html/css code.
This is where the 'active' attribute is maintained. So with multiple
Hi all,
I'm trying to get my head around why the admin template breaks. I have a
properly setup datefield in a product model. When I want to see a product list
via the admin gui with the datefield name as part of the list_display
declaration like so:
class ProductAdmin(admin.ModelAdmin):
Nick,
I'm not a longtime Django user, but I would check de django docs on
"modelform". That covers all my needs.
Mvrgr,
Gerard.
Nick Lo wrote:
> Hello,
>
> I'm working on a series of forms that need to look something like the
> following with days of the month and a field or two for variou
John,
Looking at your exclude syntax, that might be the problem. This would be the
correct code (assuming modelform is used):
class OrderForm(ModelForm):
class Meta:
model = Order
exclude = ['number', 'state', 'state_since']
nb: The excluded fields have no null/blank/editab
Russel,
Replies inline ...
> The purpose of admin.autodiscover is to discover all the admin.py
> files in your project. Each admin.py file will then need to contain
> the ModelAdmin definitions and site.register() calls required.
Ok, so the autodiscover is a recursive functionality that gathers
-- snip--
{% for model in app.models %}
It safe to say the app_list contains nothing.
Thanx a lot for your effort.
Regards,
Gerard.
Russell Keith-Magee wrote:
> On Sat, Sep 27, 2008 at 9:54 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Russel,
>
s,
Gerard.
Malcolm Tredinnick wrote:
>
> On Sat, 2008-09-27 at 18:07 +0200, Gerard Petersen wrote:
>> Dear Django team,
>>
>> It seems, but since I'm human it could be me, that in a modelform with a
>> forms.DecimalField declaration the min_value is not picked u
Dear Django team,
It seems, but since I'm human it could be me, that in a modelform with a
forms.DecimalField declaration the min_value is not picked up when it has
decimals in it. The snippet:
per_price = forms.DecimalField(
label='Per Price',
gt; On Sat, Sep 27, 2008 at 3:26 AM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Hi all,
>>
>> When I run my test suite, commands like these 'admin.site.register(Product,
>> ProductAdmin)' in models.py break my tests with this error:
>>
>> djan
x_length=2,)
def __init__(self, *args, **kwargs):
super(ProductForm, self).__init__(*args, **kwargs)
# By this one!!!
self.fields['description'].max_length = 2
Still would like a regex based check in the declarative one. Anybody done this
before?
Thanx n gree
Hi All,
I have a not to exciting app (modelwise) with forms all based on modelform. Im
trying to figure out how to realize form field input validation. Went through
piles of text. But I'm still missing the point (or rather place).
This works for a date field in a defined modelform sub class:
Hi all,
When I run my test suite, commands like these 'admin.site.register(Product,
ProductAdmin)' in models.py break my tests with this error:
django.contrib.admin.sites.AlreadyRegistered: The model Product is already
registered
When I (temporarily) remove them the tests run properly.
What
Found an error in the model code. It should be this:
if isinstance(self.period_start_date, datetime):
Regards,
Gerard,
koenb wrote:
> On 26 sep, 16:00, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Getting closer. This works: product.period_start_date.strftime('%d
Anyway, thanx for the response.
Regards,
Gerard.
koenb wrote:
> On 26 sep, 16:00, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Getting closer. This works: product.period_start_date.strftime('%d-%m-%Y')
>>
>> But I definitely do not want this in all view handlers. I
Getting closer. This works: product.period_start_date.strftime('%d-%m-%Y')
But I definitely do not want this in all view handlers. It should go in the
model .. or the modelform.
Thanx again!
Gerard.
Gerard Petersen wrote:
> Hi all,
>
> I'm trying to have a
Hi all,
I'm trying to have a formfield filled with a correlctly formatted date value.
Validation is already in place. It only accepts "dd-mm-" on submitting but
when it gets the existing value from the model it shows it in the formfield
like "-mm-dd"
So the sequence is almost complete
Anurag,
In your case a simple CGI script (in python) might suffice, and will only take
you 'days' to build. If you choose to take on Django, it might take you
'weeks'. With Django on the otherhand there are loads of features that will
help you easily build complex web applications. But there's
Brian,
Now that I read it ... so obvious. I've come from a long history of procedural
coding. So I understand OOP but don't take full advantage of it yet ...
obviously .. :-)
Thanx and Greetz!
Gerard.
Brian Neal wrote:
> On Sep 25, 4:33 am, Gerard Petersen <[EMAIL PROTECTE
in the future I want to
be able to generate them in pdf or ms word as well. So doing the work in the
view seems like easier transition to those filetypes in the future.
Regards,
Gerard.
Daniel Roseman wrote:
> On Sep 25, 10:33 am, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Hi
Hi All,
I'm finding myself creating more and more fields in a model to keep my
templates clean. Since it's merely temporary calculated data, and not data to
store permanently it feels like the wrong place. An example:
I have a product model (child object of an order model). The product has a
a lot!!
Regards,
Gerard.
Norman Harman wrote:
> Gerard Petersen wrote:
>> Hi All,
>>
>> I'm trying to import a function. When adding this statement I get a Model
>> import error in a completely different place, not even related. I've added
>> the files from my
Hi All,
I'm trying to import a function. When adding this statement I get a Model
import error in a completely different place, not even related. I've added the
files from my app directory and their import statements below.
Are there any unauthorized imports being done?
Do I need to specify m
Chuck,
The Django tutorial should get you going:
http://docs.djangoproject.com/en/dev/intro/tutorial01/#intro-tutorial01
And an app. published earlier on this list:
http://code.google.com/p/django-todo/
Happy coding.
Gerard.
Chuck Bai wrote:
> Does anyone know a sample Django 1.0 applicatio
These are firefox add-ons but can definitely help finding problems in you pages:
Firebug: https://addons.mozilla.org/en-US/firefox/addon/1843
Web developer: https://addons.mozilla.org/en-US/firefox/addon/60
And there's a not so featuresk one for IE:
http://www.microsoft.com/downloads/details.asp
Daniel,
Thanx for the answer on code execution. As far as the import issue is
concerned. I'll have a look at importing specifics. I wouldn't want you to have
to dig through my code to find a syntactic typo ... :-)
Regards,
Gerard.
Daniel Roseman wrote:
> On Sep 16, 10:08 pm, Ge
to base
> actual judgements of Django on, (a) don't do that; watch the video to
> see the context and the smiles and do your own research and (b) here's
> some background information.
>
> I actually enjoyed the talk and I was the target of two of the jokes. It
> wasn
Sorry, couldn't help myself ... My 2 cents ...
> - Python sucks, especially significant whitespace (I agree heartily.
> Only Django keeps me using Python.)
Disagree!
> - Django could be a lot smarter about scaling the DB (sharding,
> denormalization, etc)
Questionable
> - Inefficient session hand
ld' the
BTW_CHOICES don't get executed in models.py and do get executed in the
myforms.py
Thanx again!
Regards,
Gerard.
Daniel Roseman wrote:
> On Sep 15, 9:34 pm, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Daniel,
>>
>> I'm building an invoice
0', '6%'),
('19.0', '19%'),
)
I hope this clearifies things.
Thanx a lot for your interest and help!
Regards,
Gerard.
Daniel Roseman wrote:
> On Sep 13, 10:56 am, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Daniel,
>>
>
Daniel,
> If you want a field that's populated with values from another model,
> you should use a ForeignKey.
Is it then still possible to use filters and such, and keep it in the model
logic?
Because the Meta model has these fields: 'attribute', 'value', 'display',
'description'
And it's mor
Hi All,
I need to create a field with a choice set that looks like this:
BTW_CHOICES = (
('0.0', '0%'),
('6.0', '6%'),
('19.0', '19%'),
)
This works as expected when using dropdown lists in a form. But it needs to be
build from data in another model. When needed
Hi Oliver,
This feels completely off topic for a Django post, nevertheless ..
I don't see the problem. If your webserver contacts the application server via
port 80 or 443 then you should have your firewall between DMZ 1 and 2 allow
those ports. And allow only the source IP of the webserver to
Jonknee,
That cleared up major! Thanx for your teachings.
Regards,
Gerard.
jonknee wrote:
>> I read that Django knows the difference between a new and a updated record,
>> but it replicates the customer if I don't set the customer_id before a
>> customer.save. Would somebody please shoot at
Hi all,
I read that Django knows the difference between a new and a updated record, but
it replicates the customer if I don't set the customer_id before a
customer.save. Would somebody please shoot at my code and tell me where the
room for improvement is hiding?
def customer_edit(request, cus
Dear Django Team.
Congratz on the 1.0 release
Into Django for a few weeks, and already have a robust application. Keep up the
great work!
Kind regards,
Gerard.
James Bennett wrote:
> The Django team is pleased to announce the release of Django 1.0 this evening:
>
> Download: http://www.
Hi All,
Im *still* :-( trying to get the date format from -mm-dd to dd-mm-
After a major dig into mysql, it seems that the date format in it's tables is
always -mm-dd. Normally, depending on your locale, date and/or time stamps
are formatted on the fly.
I changed all the date rel
trivial to crate your
> own ModelForm and assign it to your admin.
>
> As to a tutorial, there's the newforms-admin HOWTO, that may be of use:
> http://code.djangoproject.com/wiki/NewformsHOWTO
>
>
>
> On Aug 28, 2008, at 7:13 AM, Gerard Petersen wrote:
>
>&
Hi All,
Im trying to get the date format to european (dd-mm-). I configured the
timezone in settings.py. Since I use modelforms, should this field format be
set in the model?
Currently the error on the form field is "Enter a valid date". Is this due to
the model or the form field definiti
A reguler download would be appreciated.
Regards,
Gerard.
DavidY wrote:
> Here is a two page, concise, example-based cheat sheet for
> forms.Forms
>
> http://www.scribd.com/doc/5224358/cheatsheet-of-formsForm-for-django
>
> download is available on the page somewhere
> have a good time web de
Hi All,
I exclude a field in modelform because the info is known. It's a Customer >
1-to-n > Project model setup.
I get the following (1048, "Column 'customer_id' cannot be null") on a
form.save() which is correct. But how do I put that customer_id back in the
request.POST querydict?
I'm mes
ue, Aug 26, 2008 at 8:16 PM, Gerard Petersen <[EMAIL PROTECTED]> wrote:
>> Nice work!
>>
>> So well, shouldn't you put that on a regular page somewhere for quick cut
>> and paste access instead of on scribd?
>>
>> Regards,
>>
>> Gerard.
>&
Hi all,
I would like some of the admin (date/time) widgets in the application I'm
building. Is this even possible in combination with the use of modelforms or do
i need to build more stuff by hand?
And are there any noobish howto's out there on how to do this?
Diggin' through source code does
erard.
Gerard Petersen wrote:
> Hi All,
>
> I'm trying to preset a dropdown list in a template. On a customer detail page
> I have a link to add a project. I got as far that the customer_id is already
> in the project_add method. What do I pass on to the template so that t
Hi All,
I'm trying to preset a dropdown list in a template. On a customer detail page I
have a link to add a project. I got as far that the customer_id is already in
the project_add method. What do I pass on to the template so that the dropdown
list (with customers) has the customer with the r
Nice work!
So well, shouldn't you put that on a regular page somewhere for quick cut and
paste access instead of on scribd?
Regards,
Gerard.
DavidY wrote:
> Hi, I am doing a series of cheat sheets, this is on models. It is a
> two page concise, example based demonstration of how to use
> mode
Possibly not the cleanest of solutions, but you could put a sticky bit on the
parent directory to force this.
Regards,
Gerard.
Malcolm Tredinnick wrote:
>
> On Mon, 2008-08-25 at 22:44 -0700, Julien Phalip wrote:
>> Hi,
>>
>> I'm using the FileSystem storage to save uploaded files, in a very
True, but it took me some figuring out and there's still some 'spaghetti'.
The import of models was needed on more then one place (next to views.py)
because of the meta class.
myforms.py:
from models import *
class CustomerForm(ModelForm):
class Meta:
model = Customer
Regards,
G
.
>
> def __unicode__(self):
> return '%s %s' % (self.first_name, self.last_name)
>
>
> On 24.08.2008, at 15:22, Gerard Petersen wrote:
>
>> Hi All,
>>
>> With some relational models in place I use droplists in the admin
>> interface
Hi All,
With some relational models in place I use droplists in the admin interface to
fill my fields. There's a 1-to-n relation between customer and project that the
admin module respects with a droplist.
The problem is that the droplist shows "customer object" for all entries
instead of a n
yForm
>
> myview(request):
> if request.method == 'POST':
> form = MyForm(request.POST)
> ...
>
> That's assuming that views.py and forms.py are at the same level.
>
> Cheers,
>
> Julien
>
> On Aug 23, 11:25 pm, Gerard Petersen
Julien/Russell,
Thanx for the info. Working around the name class would simply be resolved by a
'myforms.py' (or something). One thing is still missing in my brain though. If
I put it in a myforms.py. How does Django (or my code if you will) knows where
to find this class. There should be an i
Hi All,
Im working on forms, going through this book:
http://www.djangobook.com/en/1.0/chapter07/
I need to place a form class like this somewhere:
class ContactForm(forms.Form):
topic = forms.ChoiceField(choices=TOPIC_CHOICES)
message = forms.CharField(widget=forms.Textarea())
sen
Frantisek,
It was, I just couldn't get it there because the print statement was in a view
that was never invoked .. :-/
Thanx a lot.
Regards,
Gerard.
Frantisek Malina wrote:
> When using the development server,
> print output is right in the terminal.
> >
--~--~-~--~~--
76 matches
Mail list logo