Tuesday, April 2, 2013

Re: Admin Site appending letter "s" to end of each model\table name

Thank a lot for the solution, i'm a spanish user and that do the trick too. Very very thanks!

Long Life to Django!!

El lunes, 12 de septiembre de 2011 07:26:24 UTC-6, Casey escribió:
I did not realize that my email client had not grabbed new mail from
today and this was 2 days old.  Sorry for the reply ad nauseum.

Casey

On 09/12/2011 09:24 AM, Casey Greene wrote:
> http://www.the-dig.com/blog/post/customize-plural-name-django-admin/
>
> Casey
>
> On 09/10/2011 05:40 PM, Gillwill wrote:
>> Apparently the Django default is to append the letter "s" to the end
>> of the model name for each listed under a given application on the
>> Site Administration page. (It does this in the tutorial sample site as
>> well - e.g. naming "poll" "polls", etc...)
>>
>> Is there any way to get rid of that?
>>
>> I would think there would be, but I've yet to find in the default
>> admin templates or code where it is doing this.
>>
>> Any help appreciated.
>>
>> -Gil
>>
>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Monday, April 1, 2013

Re: Django 1.5 tutorial error: 'module' has no attribute 'StackedInLine'

Thanks for the useful replies!

On Wednesday, March 27, 2013 6:32:06 PM UTC+3, +Emmanuel wrote:
Hello there,

I am working through the django tutorial at djangoproject.com. So far everything works out fine until Section 2.4.6 (customizing the admin form). Django throws an error:  'module' has no attribute 'StackedInLine'. I checked around and this seems to work:
if you use import to include a module, make sure you don't have a file named just the same as the module you are trying to include in current directory. It seems python takes preference for local files over modules thus import fails.
Problem is, how now do I call the Poll admin module if it's name has been changed to say admin2.py since naming it admin.py conflicts with the main django admin.
I hope this makes sense!
Thanks.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Django 1.5 tutorial error: 'module' has no attribute 'StackedInLine'

Thanks Karen! That fixed the problem :-)

On Wednesday, March 27, 2013 6:48:18 PM UTC+3, Karen Tracey wrote:
On Wed, Mar 27, 2013 at 11:32 AM, +Emmanuel <elus...@gmail.com> wrote:
Hello there,

I am working through the django tutorial at djangoproject.com. So far everything works out fine until Section 2.4.6 (customizing the admin form). Django throws an error:  'module' has no attribute 'StackedInLine'.

Right, the L in StackedInLine should NOT be capitalized, it should be just an initial capital letter on Inline: StackedInline

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: django+virtualenv+git(hub)

Here's a link to a setup I found useful and have been using since then:
http://www.jeffknupp.com/blog/2012/10/24/starting-a-django-14-project-the-right-way/

On Saturday, March 30, 2013 10:56:37 AM UTC+3, Martin wrote:
Hi list,

I'm a Django newbie and have been reading of usefulness of using it with
virtualenv+git. I'm not clear however how to set it up in terms of
structure/hierarchy.

Say I've got my ~/projects/django-projects where I want to create my
projects so I'd initialise git inside ~/projects/django-projects. Then
I'd create separate virtual environments inside that adjusting
.gitignore to ignore things like:

*.pyc
.*swp

# Django files
include
lib
local
man
share
Scripts
.Python
*.pyc
*~
*.db


# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
 
# Installer logs
 pip-log.txt



Is that a recommended setup/logic?

Thank you

John

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: url tag: "'str' object has no attribute 'regex'"

Hi,

I got the same issue.  And I solved it doing this:

urlpatterns= patterns('',
    (r'^login/$', 'django.contrib.auth.views.login'),   <-----Remove the last comma in the patterns()
)

Hope this helps

On Friday, May 18, 2012 5:58:28 AM UTC+8, refreegrata wrote:
Hello list

I know, this question has been posted and resolved before, but the solutions don't work in my situation. I don't know why.

When I try to use the "url" tag in any template an exception is raised:
"'str' object has no attribute 'regex'"

for example, with this I got the error:
------------------------------------
urls.py (main)
-------------------------------------
from django.conf.urls import patterns, include, url

urlpatterns= patterns('',
    (r'^registration/', include('apps.registration.urls')),
    (r'', 'django.contrib.auth.views.login'),
)
-------------------------------------

urls.py (registration)
-----------------------------------------
from django.conf.urls import patterns, include, url

urlpatterns= patterns('',
    (r'^login/$', 'django.contrib.auth.views.login'),
)
-----------------------------------------

login.html (in templates/registration)
-------------------------------------------------------------
{{ form }}
{% url "django.contrib.auth.views.login" %} <---here is the problem. It's just an stupid test for the problem
-------------------------------------------------------------

Fail with:
 - {% url django.contrib.auth.views.login %}
 - {% url 'django.contrib.auth.views.login' %}
 - {% url "django.contrib.auth.views.login" %}

I add this at the end of the file "settings.py":
----------------------------------------------------------
import django.template
django.template.add_to_builtins('django.templatetags.future')
----------------------------------------------------------
Including or excluding the last lines doesn't matter. The problem appear in the both cases.

I'm using Django 1.4, and Python 2.6 over Centos 6.2. Maybe I must to include something else in the settings?

Thanks for read and sorry for my bad english.












--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: Using Django docs to find widget readonly specification

On Sunday, 31 March 2013 22:42:12 UTC+1, AJP wrote:
I'm new to learning Django.  I want to find the documentation regarding the readonly attribute you can set for admin widgets.  For example, from an admin.py:

class SourceForm(forms.ModelForm):
  data = forms.CharField(widget=TextInput(attrs={'readonly': True, 'class': 'averageField'}))

  class Meta:
    model = Source


class SourceAdmin(admin.ModelAdmin):
  form = SourceForm

admin.site.register(Source, SourceAdmin)

I've search for readonly on https://docs.djangoproject.com/search/?q=readonly&release=7 but did not found anything.  Also searching manually in https://docs.djangoproject.com/en/dev/ref/forms/widgets/ didn't bring anything up.  Can someone tell me where I'm going wrong please.

This is not documented on the Django site because it has nothing to do with Django. As the docs do explain, the `attrs` are used to set any HTML attributes on the rendered widget. `readonly` is an attribute belonging to the HTML input and select elements.
--
DR.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Re: djano user registration form and login(full example)

Al 01/04/13 21:11, En/na sachin ha escrit:
> Hello,
>
> I'm just starting with Django. I want to create a user registration form
> which will take input like username, password, first and last name,
> email, address etc.
> using the same information I want to send a conformation mail to user
> and authenticate her/him.

Hi sachin,
I'd suggest you to take a look at django-registration. It does what
you're asking for.

https://bitbucket.org/ubernostrum/django-registration
http://docs.b-list.org/django-registration/0.8/


HTH

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.