Re: When I set DEBUG=False, my 404.html doesn't appear

2012-12-31 Thread carlos
you need read this
https://docs.djangoproject.com/en/dev/topics/http/views/#the-404-page-not-found-view

Cheers


On Sat, Dec 29, 2012 at 12:43 PM, nimesh ghelani wrote:

> Can you post the shell output when 404 occurs along with the TEMPLATE_DIRS
> part of settings.py?
>
>
> On Saturday, December 29, 2012 9:29:11 PM UTC+5:30, Dae_James wrote:
>>
>>  I put my 404.html into root of the directory specified in
>> TEMPLATE_DIRS. However, when I visit an inexisting page, the browser's
>> 404.html appears rather than my own 404.html page.
>> What's wrong with me ?
>> PS: I've set the DEBUG variable in settings.py to False.
>>
>> --
>> Dae James
>>
>  --
> 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/-/gHqHfu2BGzoJ.
>
> 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-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.



Re: alternate way for nested inline in django admin

2012-12-31 Thread carlos
it no posible nested inline in django !!


On Sat, Dec 29, 2012 at 10:36 AM, Nikhil Verma wrote:

> Hi All
>
> Can somebody explain me the workaround for this ticket 9025. I want to
> nested inlines in my django admin
> explained below.
>
> Thanks in advance
>
> On Fri, Dec 28, 2012 at 10:54 PM, Nikhil Verma 
> wrote:
>
>> Hi Guys
>>
>> Here are my models :-
>>
>> class Blog(models.Model):
>> """
>> This model represents information that is stored about a blog.
>> """
>>
>> seo_tag = models.CharField(max_length=100)
>> title = models.CharField(max_length=100, unique=True)
>> description = models.TextField(verbose_name="content")
>> meta_description = models.TextField(max_length=5000)
>> image = models.ImageField(upload_to="blogs/images/", blank=True)
>> video = models.FileField(upload_to="blogs/videos/", blank=True)
>>   and so on 
>>
>> class BlogSidebarTitle(models.Model):
>> """
>> Describes the related title and sublinks inside
>> the custom sidebar
>> """
>>
>> associated_blog = models.ForeignKey(Blog)
>> title = models.CharField(max_length=255,null=True,blank=True)
>> title_sequence = models.IntegerField(null=True,blank=True)
>>
>> def __unicode__(self):
>> return self.title
>>
>> #---
>>
>> class BlogSidebarSubtitle(models.Model):
>> """
>> Subtitle within the sidebar
>> """
>> associated_blog = models.ForeignKey(Blog)
>> title = models.ForeignKey(BlogSidebarTitle)
>> sublink_title = models.CharField(max_length=255,null=True,blank=True)
>> sublink_title_sequence = models.IntegerField(null=True,blank=True)
>> sublink_title_url = models.URLField(blank=True,null=True)
>>
>> def __unicode__(self):
>> return self.sublink_title
>>
>>
>>
>> Now i want that if i go to add blog page in admin i can add multiple
>> subtitle  for a single title
>>
>> Like this :-
>>
>> Add blog Page :-
>> After blog fields in admin
>> # I want that it should be Tabularline
>> Fieldset Blog Sidebar title
>> Title Title sequence
>> # after this is should be having
>>Sublink_title sublink_title_sequence
>> sublink _title_url
>># then is hould be able to add more subtitle to single title
>>+ Add another Sublink title
>>
>> So i wrote the admin like this :-
>>
>>
>> #---
>> class BlogSidebarSubtitleInline(admin.TabularInline):
>> """
>> """
>>
>> models = BlogSidebarSubtitle
>> extra = 1
>>
>> #---
>> class BlogSidebarTitleInline(admin.TabularInline):
>> """
>> Making it appear on blog screen
>> """
>>
>> model = BlogSidebarTitle
>> extra = 1
>>
>> #---
>> class BlogSidebarTitleAdmin(admin.ModelAdmin):
>> inlines = [BlogSidebarSubtitleInline,]
>> extra = 1
>>
>> class BlogAdmin(admin.ModelAdmin):
>> """
>> Finally the layout of it.
>> """
>>
>> # For tags
>> filter_horizontal = ('tags',)
>>
>> # Calling the Editor
>> class Media:
>> js = (
>>   '/static/tinymce/jscripts/tiny_mce/tiny_mce.js',
>>   '/static/js/textarea.js',
>>   )
>> # Finally diving the page into fieldsets
>> fieldsets = [
>> ('Blog',{'fields': ['seo_tag', 'title','meta_description',
>> 'description',
>> 'category', 'image','video', 'save_as_draft',
>> 'featured', 'tags']})]
>> #readonly_fields = ['seo_tag',]
>>
>> inlines = [BlogSidebarButtonsInline, BlogSidebarTitleInline]
>>
>>
>> But still the BlogSidebarSubtitle class fields are not appearing in admin
>> and i am not able to have nested inlines.
>>
>> Can anybody tell the appropriate way to do this and if not where i am
>> doing wrong in the above code.
>>
>> Thanks  .
>> --
>> Regards
>> Nikhil Verma
>> +91-958-273-3156
>>
>
>
>
> --
> Regards
> Nikhil Verma
> +91-958-273-3156
>
> --
> 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-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-use

Re: Happy new year

2012-12-31 Thread yati sagade
Thanks all :) Here's India wishing a very happy, healthy and prosperous new
year to all Djangonauts around the world :)


On Tue, Jan 1, 2013 at 10:43 AM, JOSE LUIS FABREGA wrote:

> Feliz año nuevo, desde venezuela
>
> ¡Le deseamos lo mejor !
>
> --
> 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.
>



-- 
Yati Sagade

Software Engineer at mquotient 


Twitter: @yati_itay  | Github:
yati-sagade

Organizing member of TEDx EasternMetropolitanBypass
http://www.ted.com/tedx/events/4933
https://www.facebook.com/pages/TEDx-EasternMetropolitanBypass/337763226244869

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



Re: Creating a project error

2012-12-31 Thread Mike Dewhirst

On 1/01/2013 4:06pm, shaggy0n wrote:

Hi

i'm totally newby django user.
When i trydjango-admin.py startproject mysite command i've got this
error: .
...lib/python3.1/site-packages/django/utils/functional.py", line 349, in



If you want to use Python 3.x you want Django 1.5.x and then you need to 
check which version of Python 3.x it needs.


If you are using Django 1.4.3 (which I think is the latest stable 
release) you should be using Python 2.x


hth

Mike


 from functools import total_ordering
ImportError: cannot import name total_ordering

what should i do? i use virtualenv.

regards...


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



RE: Happy new year

2012-12-31 Thread JOSE LUIS FABREGA
Feliz año  nuevo, desde venezuela 

¡Le deseamos  lo mejor !

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



Creating a project error

2012-12-31 Thread shaggy0n
Hi

i'm totally newby django user.
When i try django-admin.py startproject mysite command i've got this error: 
.
...lib/python3.1/site-packages/django/utils/functional.py", line 349, in 

from functools import total_ordering
ImportError: cannot import name total_ordering

what should i do? i use virtualenv.

regards...


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



Re: Happy new year

2012-12-31 Thread Rodrigo Morgado
Happy New Year to all of you from Santiago, Chile!
El 31/12/2012 21:28, "Victor Manuel Quiñones Victor" <
quinonesvic...@gmail.com> escribió:

> Happy New Year!! Have a good year to all you.
>
> Cheers
>
> On Mon, Dec 31, 2012 at 9:10 PM, Raphael wrote:
>
>> **
>> Happy New Year from Austria to all of you! You are awesome guys and girls!
>>
>>
>>   --
>>
>> Raphaelhttp://develissimo.com
>>
>>
>>
>>
>>  --
>> 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.
>>
>
>
>
> --
> Quiñones Victor Manuel
> Tel: +54 0362 15 4 880839
> Resistencia - 3500
> Argentina
>
> --
> 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-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.



Re: Happy new year

2012-12-31 Thread Raphael
Happy New Year from Austria to all of you! You are awesome guys and
girls!


-- 

Raphael
http://develissimo.com




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



Re: Happy new year

2012-12-31 Thread Rodrigo Martins
Happy new year to all of Django users worldwide.


 --
* Atenciosamente*
___
Rodrigo Martins
www.rrmartins.com 

tel: (28) 9882-6202
  (27) 9601-9573
  (21) 9942-2016


My profiles: [image: Facebook]  [image:
Twitter] 
Contact me: [image: Google Talk/] rodr...@rrmartins.com [image:
Skype/]rr_martinsj [image:
MSN/] rodr...@rrmartins.com



2012/12/31 Nevio Vesic 

> Happy New Year to all Django group users from Croatia!

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



Re: Happy new year

2012-12-31 Thread Nevio Vesic
Happy New Year to all Django group users from Croatia!

May 2013 be for you the year of happiness, joy and personal as professional
success!


On Mon, Dec 31, 2012 at 11:02 PM, Mário Neto  wrote:

> Happy new year from Brasil to all djangonautics of the world.
> Many django projects for all!
>
> Best regards.
>
>
> 2012/12/31 Ariel Calzada 
>
>> Happy new year from Colombia
>> El 31/12/2012 16:42,  escribió:
>>
>> Happy new year from spain to all django lovers.
>>> I wish you a new year with tons of django projects.
>>>
>>> Cheers
>>> Cingusoft
>>> BlackBerry de movistar, allí donde estés está tu oficin@
>>>
>>> --
>>> 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-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.
>>
>
>
>
> --
> Att. *Mário Araújo Chaves Neto*
> *Programmer, Designer and U.I. Engineer*
> *
> *
> *MBA in Design Digital* - 2008 - FIC
> *Analysis and Systems Development* - 2011 - Estácio
> *D**esign and Implementation of Internet Environments* - 2003 - FIC
>
> --
> 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.
>



-- 
*Nevio Vesić*
Web Application Developer @ TelTech Systems, Inc.
*
*
*http://www.neviovesic.com/*

http://www.facebook.com/noxten
http://twitter.com/vesicnevio
http://hr.linkedin.com/in/neviovesic
*
*
*Skype:*
nevio.vesic

*Mobile:*
*(Croatia) **00385 91-525-6970 *
*(US)**001 (732) 908-7445*

--
WARNING !!! This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information. Any
unauthorized review; use, disclosure or distribution is prohibited, and
could result in criminal prosecution. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message. This message is private and is considered a
confidential exchange - public disclosure of this electronic message or its
contents are prohibited.

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



Re: Happy new year

2012-12-31 Thread Mário Neto
Happy new year from Brasil to all djangonautics of the world.
Many django projects for all!

Best regards.


2012/12/31 Ariel Calzada 

> Happy new year from Colombia
> El 31/12/2012 16:42,  escribió:
>
> Happy new year from spain to all django lovers.
>> I wish you a new year with tons of django projects.
>>
>> Cheers
>> Cingusoft
>> BlackBerry de movistar, allí donde estés está tu oficin@
>>
>> --
>> 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-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.
>



-- 
Att. *Mário Araújo Chaves Neto*
*Programmer, Designer and U.I. Engineer*
*
*
*MBA in Design Digital* - 2008 - FIC
*Analysis and Systems Development* - 2011 - Estácio
*D**esign and Implementation of Internet Environments* - 2003 - FIC

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



Re: Happy new year

2012-12-31 Thread Ariel Calzada
Happy new year from Colombia
El 31/12/2012 16:42,  escribió:

> Happy new year from spain to all django lovers.
> I wish you a new year with tons of django projects.
>
> Cheers
> Cingusoft
> BlackBerry de movistar, allí donde estés está tu oficin@
>
> --
> 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-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.



Happy new year

2012-12-31 Thread cingusoft
Happy new year from spain to all django lovers.
I wish you a new year with tons of django projects.

Cheers
Cingusoft
BlackBerry de movistar, allí donde estés está tu oficin@

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



Re: l10n not loaded from base.html template

2012-12-31 Thread Tomas Neme
each template needs to {% load %} every templatetag library it uses, this
is normal behavior


On Mon, Dec 31, 2012 at 8:31 AM, bikeridercz  wrote:

> Dears,
>
> strange thing happens to me, {% load l10n %} is not loaded in my base.html
> template, all other things like css works well.
>
> Thus I'm forced to {% load l10n %} in every template. I'm using formating
> numbers  usings{% localize on %} and {% endlocalize %} tags.
>
> Can You help to solve this small but annoying issue ?
>
> Thanks.
>
> --
> 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/-/N4uIBo_UnjkJ.
> 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.
>



-- 
"The whole of Japan is pure invention. There is no such country, there are
no such people" --Oscar Wilde

|_|0|_|
|_|_|0|
|0|0|0|

(\__/)
(='.'=)This is Bunny. Copy and paste bunny
(")_(") to help him gain world domination.

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



django git repository management app

2012-12-31 Thread Sven
Hi Guys,

a while ago i was looking for a django app that allows me to manage git 
repositories like gitosis, gitweb or at least github. But simple and well 
integrated with django. Finally i found nothing. 

Then the idea for gitana was born. A git repository management applicaiton for 
django integrated with admin app. 

Now i'm happy to announce version 1.0.0  it is opensource and you can find it 
on github  https://github.com/lubico-business/django-gitana

I very appreciate all comments, suggestions and all kind of feedback.

happy new year!

BR Sven

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



django_nose failing to discover tests

2012-12-31 Thread Joe Legner
I am trying to get django_nose to discover tests in my project.  I watched 
this video which seems to indicate that my project/app/tests/__init__.py 
should be able to be empty (not contain a bunch of import * statements):

http://pyvideo.org/video/1406/djangos-nasal-passage

The goal is to have django_nose find my tests by name so I do not have to 
have import * from ... statements within my tests/__init__.py for every 
app.  My project is set up like this:

/myproject
/accounts
__init__.py
/tests
__init__.py
test_account.py

The __init__.py file is empty.  The test_account.py file contains an 
AccountTest class derived from unittest.TestCase.

When I run ./manage.py test accounts (with an empty __init__.py), the 
result is "Ran 0 tests in 0.000s"

Now, if I make accounts/tests/__init__.py contain the line from 
test_account import *, it works correctly; therefore, I believe I do have 
django_nose (version 1.1 and nose 1.2.1) installed and working.

I Googled all morning to solve the problem but have failed.  If you have 
any insight, please reply.  Thank you.

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



Multiple model inheritance

2012-12-31 Thread Mattias Linnap
Hi all,

I would like to define multiple abstract base models with small set of
fields each. The "real" models inherit from multiple mixins to add the
fields.

For example:
class Taggable(?):
tag = models.CharField()
class Visible(?):
visible = models.BooleanField()
class SomeFullModel(?, Taggable, Visible):
otherfield = models.CharField()

With this use case:
* should the abstract models inherit from models.Model, or be a plain
Python class inheriting from object?
* should all or any of the abstract models have a class Meta with
abstract=True?
* should the final real model inherit from models.Model (probably
required if all the mixins are plain classes), or inherit from the
first mixin that is an abstract model?
* does the order of the base classes in SomeFullModel matter?

Thanks,

Mattias

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



Re: The method all() in overrided models.Manager doesn't works as expected

2012-12-31 Thread akaariai
Interesting approach :)

Some pointers:
  - The Page object has an automatic primary key. You should probably
change the path to be the primary key.
  - .all() should not return a list of objects, instead it should
return a QuerySet which returns a list of objects when iterated.

You might be better of using just a regular FileField. Store the
objects in the DB, remove the path field and store the content in a
FileField. That is the way this is supposed to be done in Django. You
can likely make your approach work but it wont be easy.

 - Anssi

On 31 joulu, 04:52, Shuge Lee  wrote:
> I'm writing a simple CMS, it stores page file data on local file system
> instead of SQL server.
>
> I do overrides the model Page's Manager, but it not works as expected,
> problems
>
>    - PageManager.all(it calls PageQuerySet?) doesn't works
>    - I can create Page object in Admin, but can't view it or delete it
>
> Source code is herehttps://github.com/shuge/mcms/blob/master/pages/models.py
>
> I have read Django Manager 
> docs a
> couple of times, but it doesn't help.
>
> Thanks for reply.

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



l10n not loaded from base.html template

2012-12-31 Thread bikeridercz
Dears,

strange thing happens to me, {% load l10n %} is not loaded in my base.html 
template, all other things like css works well.

Thus I'm forced to {% load l10n %} in every template. I'm using formating 
numbers  usings{% localize on %} and {% endlocalize %} tags.

Can You help to solve this small but annoying issue ?

Thanks.

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



Re: Unable to get an object value using get method in Django

2012-12-31 Thread Babatunde Akinyanmi
Hi coded,
You didn't say what the new error is. Anyway, in your view, `name` is not
in the namespace. Its just like doing this:

Python 2.7.3 (default, Aug  1 2012, 05:16:07)
[GCC 4.6.3] on linux2
>>>a = 1
>>>a + a
2
>>>a + b
Traceback (most recent call last):
  File "", line 1, in 
NameError: name 'b' is not defined

which is exactly what you are doing with this line:

mall=Fin.objects.get(name)

In your situation, you are supposed to supply the name argument (and also
the user argument. The primary key would be much better since it is unique
for each record) so assuming in your form the client chose say 'Galleria'
(and assuming you have a Fin object with a field name 'Galleria'), you
should do something like:

mall = Fin.objects.get(name='Galleria', user=user)

Don't forget that .get() will throw an error if multiple objects fit the
arguments supplied and if no object fits the arguments supplied. That said,
it will be better if you supply a primary key as an argument since its very
possible to have multiple Fin objects with exactly the same data contained
in its fields.

Meanwhile, I can't find anywhere on your form definition that seems to be
collecting 'name' for Fin.

On Mon, Dec 31, 2012 at 3:13 AM, coded kid  wrote:

> Yeah, its a name of a field in my form.  I want to the value
> automatically since I don't know the name of the place the user will
> choose. I tried adding your correction but i'm getting error.
>
> On Dec 31, 2:33 am, Bill Freeman  wrote:
> > On Sun, Dec 30, 2012 at 7:11 PM, coded kid 
> wrote:
> > > I want to get an object value from a model. After trying the get()
> > > method, I've been unable to make it work.And I'm getting the below
> > > error. I have a page that display the name of a place to users, so if
> > > a user see a place he likes, he will go ahead and fill the form.And in
> > > the form, I want to get the name of the place automatically from
> > > another model, I don't want users to fill the name of the place. Below
> > > are my codes
> >
> > > NameError at /welcome/
> >
> > >global name 'name' is not defined
> >
> > > Models
> >
> > >  class Fin(models.Model):
> > >   user=models.ForeignKey(User)
> > >   name=models.CharField(max_length=100)
> >
> > >   def __unicode__(self):
> > >   return self.user
> >
> > >  class Place(models.Model):
> > >   user=models.ForeignKey(User)
> > >   mall=models.ForeignKey(Fin)
> > >   full_name=models.CharField(max_length=100)
> > >   e_mail=models.EmailField(max_length=100)
> > >   phone_no=models.CharField(max_length=100)
> > >   pub_date=models.DateTimeField()
> >
> > >   def __unicode__(self):
> > >   return self.full_name
> > >   class Meta:
> > >  ordering=['-pub_date']
> >
> > >   class PlaceForm(ModelForm):
> > >class Meta:
> > >  model=Place
> > >  fields=('full_name','e_mail','phone_no')
> > >  exclude=('user','pub_date','mall')
> >
> > > Views:
> >
> > >def place_me(request):
> > >if request.method=="POST":
> > >   form=PlaceForm(request.POST)
> > >   if form.is_valid():
> > >  data=form.cleaned_data
> > >  newbooks=Place(
> > >  user=request.user,
> > >  pub_date=datetime.datetime.now(),
> > >  mall=Fin.objects.get(name),
> > >  full_name=data['full_name'],
> > >  e_mail=data['e_mail'],
> > >  phone_no=data['phone_no'])
> > >  newbooks.save()
> > >  return HttpResponse('Thanks for choosing themall, we will
> > > contact you as soon as possible.')
> > >  else:
> > > return HttpResponse('Some fields are not filled
> > > correctly')
> > >  else:
> > > return render_to_response('buuk.html',
> > > {'PlaceForm':PlaceForm},context_instance=RequestContext(request))
> >
> > > Perhaps you want:
> >
> >mail=Fin.objects.get(name="something")
> >
> > Where I'm not sure what "something" is.  A field from your form, perhaps?
> >
> > Bill
>
> --
> 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-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.