Re: new user having trouble connecting django to postgres with psycopg2

2011-01-08 Thread Jeff Tchang
Can you try logging into the database and running:

SELECT * FROM pg_timezone_names;

Maybe try picking something from that list?

-Jeff

On Sat, Jan 8, 2011 at 8:19 PM, Mark Brazil  wrote:
> Same error
>
> Traceback (most recent call last):
>   File "manage.py", line 11, in 
>     execute_manager(settings)
>   File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py",
> line 438, in execute_manager
>     utility.execute()
>   File "/usr/lib/pymodules/python2.6/django/core/management/__init__.py",
> line 379, in execute
>     self.fetch_command(subcommand).run_from_argv(self.argv)
>   File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line
> 191, in run_from_argv
>     self.execute(*args, **options.__dict__)
>   File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line
> 220, in execute
>     output = self.handle(*args, **options)
>   File "/usr/lib/pymodules/python2.6/django/core/management/base.py", line
> 351, in handle
>     return self.handle_noargs(**options)
>   File
> "/usr/lib/pymodules/python2.6/django/core/management/commands/syncdb.py",
> line 52, in handle_noargs
>     cursor = connection.cursor()
>   File "/usr/lib/pymodules/python2.6/django/db/backends/__init__.py", line
> 75, in cursor
>     cursor = self._cursor()
>   File
> "/usr/lib/pymodules/python2.6/django/db/backends/postgresql_psycopg2/base.py",
> line 144, in _cursor
>     cursor.execute("SET TIME ZONE %s", [settings_dict['TIME_ZONE']])
> psycopg2.DataError: unrecognized time zone name: "Australia/NSW"
>
> or if its set to Sydney
> :
> :
> :
> psycopg2.DataError: unrecognized time zone name: "Australia/Sydney"
>
>
>
>
> On 07/01/11 17:43, Subhranath Chunder wrote:
>
> I guess you'll have to set it to 'Australia/ACT Australia/Canberra
> Australia/NSW Australia/Sydney' in your settings.py instead.
> Thanks,
> Subhranath Chunder.
>
> On Fri, Jan 7, 2011 at 6:22 AM, Mark Brazil  wrote:
>>
>> hi,
>>
>> I've been trying to find the answer to this for a bit, but haven't
>> found anything suitable.
>>
>> I have postgresql 9.01, django 1.2.3 psycopg2 on ubuntu10.10
>>
>> When I try to use syncdb i get an error as follows
>>
>> "psycopg2.DataError: unrecognized time zone name"
>>
>> I currently have my settings.py set to "Australia/Sydney".
>>
>> I logged into postgres and set the TZ variable to AEST and started the
>> database.
>>
>> But still get this.
>>
>> I'm guessing it is something simple, but cannot find the answer.
>>
>> Any ideas would be great,
>> Thanks,
>> Mark.
>>
>> --
>> 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.
>
> --
> 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: new user having trouble connecting django to postgres with psycopg2

2011-01-08 Thread Mark Brazil

Same error

Traceback (most recent call last):
  File "manage.py", line 11, in 
execute_manager(settings)
  File 
"/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 
438, in execute_manager

utility.execute()
  File 
"/usr/lib/pymodules/python2.6/django/core/management/__init__.py", line 
379, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/pymodules/python2.6/django/core/management/base.py", 
line 191, in run_from_argv

self.execute(*args, **options.__dict__)
  File "/usr/lib/pymodules/python2.6/django/core/management/base.py", 
line 220, in execute

output = self.handle(*args, **options)
  File "/usr/lib/pymodules/python2.6/django/core/management/base.py", 
line 351, in handle

return self.handle_noargs(**options)
  File 
"/usr/lib/pymodules/python2.6/django/core/management/commands/syncdb.py", line 
52, in handle_noargs

cursor = connection.cursor()
  File "/usr/lib/pymodules/python2.6/django/db/backends/__init__.py", 
line 75, in cursor

cursor = self._cursor()
  File 
"/usr/lib/pymodules/python2.6/django/db/backends/postgresql_psycopg2/base.py", 
line 144, in _cursor

cursor.execute("SET TIME ZONE %s", [settings_dict['TIME_ZONE']])
psycopg2.DataError: unrecognized time zone name: "Australia/NSW"

or if its set to Sydney
:
:
:
psycopg2.DataError: unrecognized time zone name: "Australia/Sydney"




On 07/01/11 17:43, Subhranath Chunder wrote:
I guess you'll have to set it to 'Australia/ACT Australia/Canberra 
Australia/NSW Australia/Sydney' in your settings.py instead.


Thanks,
Subhranath Chunder.


On Fri, Jan 7, 2011 at 6:22 AM, Mark Brazil > wrote:


hi,

I've been trying to find the answer to this for a bit, but haven't
found anything suitable.

I have postgresql 9.01, django 1.2.3 psycopg2 on ubuntu10.10

When I try to use syncdb i get an error as follows

"psycopg2.DataError: unrecognized time zone name"

I currently have my settings.py set to "Australia/Sydney".

I logged into postgres and set the TZ variable to AEST and started the
database.

But still get this.

I'm guessing it is something simple, but cannot find the answer.

Any ideas would be great,
Thanks,
Mark.

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


--
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: Debugging Deeper Into Django

2011-01-08 Thread Russell Keith-Magee
On Sunday, January 9, 2011, octopusgrabbus  wrote:
> I would like to see more from Django on what it chooses to,
> specifically around the loading or not loading of pages. I am running
> Django on RHEL 5 WS, with mod_python. I want to stick with mod_python,
> despite the testimonies its replacement is better.

Slightly off topic, but:

"Better" isn't the issue. Mod_python has been deprecated by it's
authors. It is, for all practical intents and purposes, a dead
project. If you have a RHEL support contract, Redhat will continue to
provide support, but I'd be surprised if that support extended much
beyond critical security updates. If you are starting a new project,
you would be well advised to look at mod_wsgi, or another deployment
option.

> Are there switches I can set to get more granular (detailed) logging
> in Django, or will I have to tweak Apache's configuration to log more?

it's not entirely clear to me what it is you want to see logged.
Django's decision to load or not load a page is essentially just "just
the Regex pattern match", and success is logged as a page load in your
web server access log.

The version of Django currently in development (soon to be 1.3) has
some additional logging, but doesn't give any particular insight into
the URL loading process. Django Debug Toolbar can also give some
visibility to internals.

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.



Re: i18n django models

2011-01-08 Thread Mo J. Al-Mughrabi
Yes, I did that part,

How can I navigate transmeta source for that function? I used python
setup.py install,



Sent from my iPhone

On Jan 9, 2011, at 1:12 AM, Alessandro Pasotti  wrote:

2011/1/8 Mo Mughrabi 

> Transmeta is much nicer and much simpler. I just installed it and I already
> like the way it is designed,
>
> I just ran into a small problem with the ./manage.py sync_transmeta_db not
> working. Any idea how it can be solved?
>
> Am just getting an unknown command,
>
>
> Cheers,
>
>
>

I dont' know... did you add transmeta to the installed app in settings.py ?


-- 
Alessandro Pasotti
w3:   www.itopen.it

-- 
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: i18n django models

2011-01-08 Thread Alessandro Pasotti
2011/1/8 Mo Mughrabi 

> Transmeta is much nicer and much simpler. I just installed it and I already
> like the way it is designed,
>
> I just ran into a small problem with the ./manage.py sync_transmeta_db not
> working. Any idea how it can be solved?
>
> Am just getting an unknown command,
>
>
> Cheers,
>
>
>

I dont' know... did you add transmeta to the installed app in settings.py ?


-- 
Alessandro Pasotti
w3:   www.itopen.it

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



templating best practices in django

2011-01-08 Thread Mo Mughrabi
Hi,

I'm wondering what would be the best practice for templating in django. I
plan on having a single theme in which heads and footers will almost be the
same across my project,

1. Should I great an app only for this purpose, in the sense, an app will
host a header and footer functions (methods) along with their views. Is that
the best practice?

2. my second question, if I am going to host a header somewhere centered. Is
it possible that I include or exclude certain css or js from the main
header?

3. Is there a django module that help organizing my js and css in a way?


4. last, what is django_compressor used for, I don't get the idea, If am
going to specify the paths to my js. Why does it combine them all in a
single file? does that make the loading faster?

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: i18n django models

2011-01-08 Thread Mo Mughrabi
Transmeta is much nicer and much simpler. I just installed it and I already
like the way it is designed,

I just ran into a small problem with the ./manage.py sync_transmeta_db not
working. Any idea how it can be solved?

Am just getting an unknown command,


Cheers,


On Sat, Jan 8, 2011 at 4:23 PM, Alessandro Pasotti wrote:

> 2011/1/8 Mo Mughrabi 
>
> This is not exactly what I need.
>>
>> this library is not done as per the common best practices for i18nlizing
>> data.
>>
>> All you have to do is declare an object (field) as an i18n field and the
>> engine takes care of the rest. This example you can see in java struct and
>> php symphony, when executing the equivalent for syncdb it will generate an
>> additional table which holds the i18n languages instead of creating columns
>> with prefixes and suffixes.
>>
>
> Hi,
>
> I've been using transmeta for a big project, I had to slightly adapt it to
> suit my needs but it works well and I found it an elegant solution.
>
> http://code.google.com/p/django-transmeta/
>
> some migration/maintenance commands are also available within the lib.
>
> --
> Alessandro Pasotti
> w3:   www.itopen.it
>
>  --
> 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: Filtering related objects in template

2011-01-08 Thread +shaun
>From Stackoverflow - How do I perform query filtering in django 
>templates
:

You can't do this, which is by design. The Django framework authors intended 
a strict separation of presentation code from data logic. Filtering models 
is data logic, and outputting HTML is presentation logic.

So you have several options. The easiest is to do the filtering, then pass 
the result to render_to_response. Or you could write a method in your model 
so that you can say {% for object in data.filtered_set %}. Finally, you 
could write your own template tag, although in this specific case I would 
advise against that.

-- 
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: Can I add custom field to ModelForm?

2011-01-08 Thread Brian Neal
On Jan 7, 8:55 am, robos85  wrote:
> Is it possible to add field (I want it to be visible in generated form and
> after post) to form which is not included in Model? I need it to make a
> check after form.is_valid(), but this field won't go to DB.
>
> If yes - how can I do that?

It is possible. Google for django dynamic forms. The same techniques
can be used for model forms, but you'll have to decide what to do with
the extra fields.

Some links to get you started:
http://jacobian.org/writing/dynamic-form-generation/
http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/
http://www.hindsightlabs.com/blog/2010/02/11/adding-extra-fields-to-a-model-form-in-djangos-admin/

Best regards,
BN

-- 
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: Debugging Deeper Into Django

2011-01-08 Thread vikalp sahni
for custom logging you can always your python logging module, which is just
like
log4j.

Also if you need any specifics regarding db queries etc. you can try out.
Django Debug Toolbar:
https://github.com/robhudson/django-debug-toolbar

Hope it helps.

Regards,
//Vikalp


On Sun, Jan 9, 2011 at 12:21 AM, octopusgrabbus
wrote:

> I would like to see more from Django on what it chooses to,
> specifically around the loading or not loading of pages. I am running
> Django on RHEL 5 WS, with mod_python. I want to stick with mod_python,
> despite the testimonies its replacement is better.
>
> Are there switches I can set to get more granular (detailed) logging
> in Django, or will I have to tweak Apache's configuration to log more?
>
> Thanks.
> cmn
>
> --
> 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.



Filtering related objects in template

2011-01-08 Thread BigBlogMaker
Can I filtering of related objects in a template? Explained:
Now I make so

{% for image in product.image_set.all %}
{% if image.image_type.id == 777 %}

{% endif %}
{% endfor %}

And I would like to:

{% for image in product.image_set.all | image_type.id : 777 %}

{% endfor %}

--
(sorry for my English %))

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



Debugging Deeper Into Django

2011-01-08 Thread octopusgrabbus
I would like to see more from Django on what it chooses to,
specifically around the loading or not loading of pages. I am running
Django on RHEL 5 WS, with mod_python. I want to stick with mod_python,
despite the testimonies its replacement is better.

Are there switches I can set to get more granular (detailed) logging
in Django, or will I have to tweak Apache's configuration to log more?

Thanks.
cmn

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



Translation files are not generated

2011-01-08 Thread Roel Veldhuizen
When I run "manage.py makemessages -l en" a LC_MESSAGES dir is created for
the language "en" but no files are created.

One of the files that should contain a translation looks like:

{% load i18n %}

{% trans "Profile" %}

In the settings the USE_I18N is set to true and added
'django.middleware.locale.LocaleMiddleware', to the middleware classes. The
templates are shown when i enter the address of the django server so i
conclude that the template directory is set correct.

Thanks in advance
-- 
Vriendelijke groeten / Kind regards

Ing. Roel Veldhuizen
Phone: +31 630 531 040
Skype: dhrroel
Company: http://www.paston.nl
Web: http://harx.nl 
Book.me: http://roelveldhuizen.youcanbook.me/
Linked-in: http://nl.linkedin.com/in/roelveldhuizen
Twitter: http://twitter.com/roelveldhuizen

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



Creating a image gallery form model

2011-01-08 Thread Simon W
Hi,

I have a 'project' model. Each project can have a gallery (im using the
photologue-app as model).

Now, when I want to let my users edit his project I want to show him all the
photos in the gallery and for each photo he can tick a "Remove"-checkbox
and/or check a radio button that says "Use as image cover".

I guess I need to make a custom form/widget model but Im not quite sure how
to approach it (first time I user forms in Django) but I'd like it to
something like this in the html template:

{% for photofield in form.gallery %}
   {{ photofield.radio_button }} Use as image cover
   {{ photofield.remove_checkbox }} Remove image
   
{% endfor %}


Could you tell me what's the best practice to achieve this?

Cheers!

-- 
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: slugify override

2011-01-08 Thread Andy Mikhailenko
> How can I override slugify function globally? I want to add some other
> letters actions especially form my language.

You can try django-autoslug for your own code. Existing code can be
(?) fixed via monkey-patching but that's not a good idea.

-- 
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: A few beginner questions

2011-01-08 Thread Mike Ramirez
On Saturday, January 08, 2011 02:07:22 am Ondřej Mirtes wrote:
> Thank you all for your responses.
> 
> I have one more question - what is the purpose of "apps" in
> "projects" (when I create new app in a project via manage.py
> startapp)? Are they something like sections of a web (articles, forum,
> user administration?) or are they rather something like modules,
> reusable across projects? How big should be an app?
> 


They are really both, see django-registration, djangobb, pinax, and many other 
django-apps (search google code and github).

> How should I solve typical scenario when my site consists of a small
> frontend presentation and a complex API service?
> 

This is really a question best left upto you to answer. Looking at existing 
apps, some are small providing specific functionality (django-email-
notifiation iirc is another), others really huge providing a whole slew of 
things (see djangobb and pinax). Others have made apps that just hold template 
tags, to one app for the whole site (which most new django developers do).

My suggestion to you is to build it the way that makes it easy to maintain the 
site, for you and developers after you. If some functionality that you come up 
with can be of use to others, then it's worthwhile to make it it's own app and 
release it into the wild via your fav license.

Mike



-- 
Death comes on every passing breeze,
He lurks in every flower;
Each season has its own disease,
Its peril -- every hour.
--Reginald Heber

-- 
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: i18n django models

2011-01-08 Thread Alessandro Pasotti
2011/1/8 Mo Mughrabi 

> This is not exactly what I need.
>
> this library is not done as per the common best practices for i18nlizing
> data.
>
> All you have to do is declare an object (field) as an i18n field and the
> engine takes care of the rest. This example you can see in java struct and
> php symphony, when executing the equivalent for syncdb it will generate an
> additional table which holds the i18n languages instead of creating columns
> with prefixes and suffixes.
>

Hi,

I've been using transmeta for a big project, I had to slightly adapt it to
suit my needs but it works well and I found it an elegant solution.

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

some migration/maintenance commands are also available within the lib.

-- 
Alessandro Pasotti
w3:   www.itopen.it

-- 
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: i18n django models

2011-01-08 Thread Mo Mughrabi
This is not exactly what I need.

this library is not done as per the common best practices for i18nlizing
data.

All you have to do is declare an object (field) as an i18n field and the
engine takes care of the rest. This example you can see in java struct and
php symphony, when executing the equivalent for syncdb it will generate an
additional table which holds the i18n languages instead of creating columns
with prefixes and suffixes.

Having columns mapped to a specific language means modifying your table in
the future if you need additional languages. Meanwhile, if creating a one to
many relation with a specific table that holds only the variable in
different languages means you can add as many language support as you need,

Plus, when I went through polyglot it does override a lot
of crucial functions, adding up such plugin into a critical
production environment can be risky with very little information about it.


Any other solutions?



On Fri, Jan 7, 2011 at 6:25 PM, Marcos Moyano wrote:

> I've worked on/with this app
> https://github.com/Anue/django-polyglot/
>
> Hope it helps.
> Rgds,
> Marcos
>
> On Fri, Jan 7, 2011 at 12:20 PM, Mo Mughrabi wrote:
>
>> Hello,
>>
>> in my design there are some models where I need to store certain fields in
>> different languages. I was wondering if anyone has done it before? I saw
>> some django modules that help do model translations but some of them did not
>> work properly.
>>
>> Any best practices out there? below is my code
>>
>> *my model.py*
>>
>> class Lookup_I18n(models.Model):
>> i18n_code = models.CharField(max_length=5,
>> default=settings.LANGUAGE_CODE)
>> value = models.CharField(max_length=300)
>>
>> class Lookup(models.Model):
>>
>> purpose = models.CharField(max_length=10)
>> key = models.CharField(max_length=10)
>> value_i18n = models.ForeignKey(Lookup_I18n)
>> value = models.Field()
>>
>> class Meta:
>> unique_together = (('purpose', 'key'),)
>>
>>  --
>> 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.
>>
>
>
>
> --
> Some people, when confronted with a problem, think “I know, I'll use
> regular expressions.” Now they have two problems.
>
> Jamie Zawinski, in comp.emacs.xemacs
>
> --
> 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: ImproperlyConfigured: 'SentAdmin.fields' refers to field 'dateSent' that is missing from the form.

2011-01-08 Thread gintare
I did not understand what was the a reason, but i changed order of
items in admin.py fields to be similar to items order in the model.
Maybe mistake was some mistyping. Anyway error disappeared.

regards,
gintare

On Jan 2, 6:47 pm, Ramiro Morales  wrote:
> On Sun, Jan 2, 2011 at 12:49 PM,gintare wrote:
> > I was changing models many times and deleting tables inbetween.
> > New tables were generated to improved models and admin site worked
> > perfectly.
> > Now smth happened that i am getting error:
>
> > ImproperlyConfigured: 'SentAdmin.fields' refers to field 'dateSent'
> > that is missing from the form.
>
> > 'dateSent' is in the model and correctly described in admin.py
>
> > I did not added this field before generating new tables. It was
> > previously.
> > If i comment other fields gives the same error.
>
> > What can be the solution?
> > Should i make new project or there is a way to update forms (for
> > field 'dateSent' and orher fields that are missing from the form
> > according Django) ??
>
> Post only the definitions of the model containing dateSent and
> its ModelAdmin.
>
> Also:
>  Are you using dateSent somethwere else in the dmin.py?
>  Remove the admin.pyc file.
>
> --
> Ramiro Morales

-- 
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: A few beginner questions

2011-01-08 Thread Mike Thon
I've had this question too, when I'm designing a project.  So far, I have 
dumped all of my own code into the one app that I create for the project and 
then add external apps that can be found on the internet to extend my 
project's functionality.  For example, I needed to download articles from 
RSS feeds so I added feedjack to my project.  I don't use any of that app's 
templates or views, but I use the admin interface to manage the feeds, and I 
access the model objects from my own app.  I also use the included command 
line script to update the feeds. For the next project I start, I will think 
about the features that I plan, and whether or not those features could ever 
be reused in some other project.  If so, then I'll try to put those features 
into separate apps.  I believe there are some additional steps to take to 
make an app reusable outside of the project in which it is created.  

-- 
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: A few beginner questions

2011-01-08 Thread Ondřej Mirtes
Thank you all for your responses.

I have one more question - what is the purpose of "apps" in
"projects" (when I create new app in a project via manage.py
startapp)? Are they something like sections of a web (articles, forum,
user administration?) or are they rather something like modules,
reusable across projects? How big should be an app?

How should I solve typical scenario when my site consists of a small
frontend presentation and a complex API service?

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.