Re: Django administration page, created a Site -- now what?

2011-05-07 Thread Xavier Ordoquy

> Hello,
> 
> I have created a new Site in my "Django administration" page. How can I use 
> it now? If I visit the URL that this newly created Site points to, I get a 
> URLconf error. So what do I need to add to my project's urls.py file? A 
> newbie here. Please help me on this. Thanks.

Hi,

If you are looking for a CMS, Django in itself isn't one. However a couple of 
projects based on Django are. http://djangopackages.com/grids/g/cms/ will give 
you more information on that topic.

If you are rather looking for a web development framework, as Andy said, 
tutorial and then documentation are good places to start with.

Regards,
Xavier.

-- 
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: ANN : any2any, serializers & deserializers for Django

2011-05-07 Thread sebastien piquemal
Apparently there was a bug in my setup file on the release on pypi. It
is now fixed !

On May 6, 10:16 am, sebastien piquemal  wrote:
> Hi all !
>
> I am pleased to announce that I have finally released a piece of code
> I begun to write a while ago, ...
> It is a python library called any2any, which helps to write casts
> operations (from one python instance, to another of a different type).
>
> It all started with Django serializations and deserializations (I had
> very custom needs, in order to build some APIs), and then it went on
> with serializations and deserializations for ldap ... so I decided to
> abstract those operations in one library that would simplify writing
> casts from one Python type to another.
>
> And guess what !? It contains cool Django serializers/deserializers
> which :
>
>     - supports MTI nicely
>     - serializes/deserializes foreign keys and many2many fields nicely
>     - deep serialization and deserialization
>     - natural keys
>     - include/exclude a subset of fields
>     - virtual attributes
>     - very very easy to customize
>     - ...
>
> You can find the "docs" for Django here 
> :http://readthedocs.org/docs/any2any/en/latest/doc_pages/djangocast.html
> On pypi :http://pypi.python.org/pypi/any2any/0.1
>
> Of course, there is always more work to do to make it better and add
> missing features ... So any suggestion, any contribution, critics ...
> are very welcome !
>
> Cheers,
>
> Sébastien

-- 
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: Django administration page, created a Site -- now what?

2011-05-07 Thread Boštjan Mejak
Thank you for your answers. I'll go read the docs then. ;)

-- 
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: Get child model class

2011-05-07 Thread pbzRPA
Thank you, this is more or less what I am looking for. I don't however
want to make the CF class an abstract class as I want to have some
common fields in there. The Idea behind this is that I want to store
custom fields (CF) for various models that a user will be defining
themselves. I do not want to keep the data in a single table as I want
to be able to filter and do database actions on specific field types.
But in order recreate a dynamic form from all the CF fields belonging
to a document (Doc)  I want to be able to iterate over Doc.cf.all()
and add the specific CF field type to a form. I hope that makes
sense :)


-- 
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: Get child model class

2011-05-07 Thread pbzRPA
this is more or less what I found. I will have to see how I can
implement it on my side.

http://djangosnippets.org/snippets/1037/

-- 
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: Get child model class

2011-05-07 Thread pbzRPA
Ok this solution worked for me :):)

{{{
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.db.models.query import QuerySet

class SubclassingQuerySet(QuerySet):

def __getitem__(self, k):
result = super(SubclassingQuerySet, self).__getitem__(k)
if isinstance(result, models.Model) :
return result.as_leaf_class()
else :
return result
def __iter__(self):
for item in super(SubclassingQuerySet, self).__iter__():
yield item.as_leaf_class()

class CFManager(models.Manager):
def get_query_set(self):
return SubclassingQuerySet(self.model)

class CF(models.Model):
type = models.CharField(max_length = 40)
content_type =
models.ForeignKey(ContentType,editable=False,null=True)
objects = CFManager()

def save(self, *args, **kwargs):
if(not self.content_type):
self.content_type =
ContentType.objects.get_for_model(self.__class__)
super(CF, self).save(*args, **kwargs)

def as_leaf_class(self):
content_type = self.content_type
model = content_type.model_class()
if (model == CF):
return self
return model.objects.get(id=self.id)

class CFT(CF):
data = models.CharField(max_length=20)
objects = CFManager()

class CFI(CF):
data = models.IntegerField()
objects = CFManager()

class Doc(models.Model):
name = models.CharField(max_length = 40)
cf = models.ManyToManyField(CF, null = True)
}}}

now when I do:

In [12]: doc.cf.all()
Out[12]: [, ]

Thanks for all the suggestions and help.

-- 
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: how to use jquery for point of Sale

2011-05-07 Thread Javier Guerra Giraldez
On Sat, May 7, 2011 at 1:41 AM, GKR  wrote:
> still i was not able to get what Shawn replied "How to ask an actual
> question so maybe someone can answer it."
>
> please get me in a lil bit descriptive way.

first we would need some context to know where you're standing.

- What do you know? Have you used Django before? or at least done the tutorial?

- have you used any other web environment?  do you know the difference
between server code and client code?

- are you asking _how_ to do something, or _what_ to do?

- Is it a Django question, or just a JavaScript one?

- have you tried something? if so, what and what went wrong?


these are very basic questions, and for some people might sound even
offensive; but your questions are so wide that there's no way for
anybody to know if you're an experienced developer out of his zone of
comfort, or maybe a total newcomer to web programming.

-- 
Javier

-- 
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: how to use jquery for point of Sale

2011-05-07 Thread GKR
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-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: UML to Django - online generation service

2011-05-07 Thread gusheng
I'm thinking of something opposite..

Is it possible to draw uml base on my models?

or, how to draw or present my model-structure-data..


On May 4, 10:26 pm, jcabot  wrote:
> Hi everybody,
>
> You can now try for free a new online code-generation service that
> transforms plain UML class diagrams to Django models. 
> Checkhttp://modeling-languages.com/content/uml2python-full-code-generator-...
> for more info.
>
> Any feedback will be highly appreciated!
>
> Jordi

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



Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
Hi!

I'm having trouble figuring out what to do.
I have multiple models linked together using foreignkey, like the following:

# models.py
class Member(User):
  middle_name = models.CharField(max_length=20)

class Phone(models.Model):
  owner = models.ForeignKey(Member)
  areacode = models.CharField(max_length=5)
  number = models.CharField(max_length=12)

class Address(models.Model):
  owner = models.ForeignKey(Member)
  address = models.CharField(max_length=50)
  city = models.CharField(max_length=50)
  state = models.CharField(max_length=30)
  zip = models.CharField(max_length=20)

I want to be able to create the form that uses all three of the models in
the admin section, so I did this:

# admin.py
from django.contrib import admin
from django.contrib.auth.models import User
from models import Member, Address, Phone

class PhoneInline(admin.StackedInline):
  model = Phone
  can_delete = True
  extra = 0

class AddressInline(admin.StackedInline):
  model = Address
  can_delete = True
  extra = 0

class MemberAdmin(admin.ModelAdmin):
  inlines = [ PhoneInline, AddressInline ]
  fieldsets = (
(None, {
'fields': ( 'first_name', 'middle_name', 'last_name', 'areacode',
'number' )
}),
('Address', {
   'fields': ( 'address', 'state', 'city', 'state', 'zip' )
})
   )

admin.site.register(Member, MemberAdmin)

When I runserver, it throws the following error:

ImproperlyConfigured at /admin

'MemberAdmin.fields' refers to field 'areacode' that is missing from the form.


If I take out 'areacode', 'number' from the None fieldset and remove
the 'Address' fieldset, leaving only

'first_name', 'middle_name', and 'last_name', it works fine. So, how
can I access the fields that are linked by foreign key?

This is driving me crazy!!!


Thanks!

Eiji

-- 
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: Froms new line in forms.py

2011-05-07 Thread GKR
Please Help

-- 
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: Froms new line in forms.py

2011-05-07 Thread Oleg Lomaka
Do you mean an internet browser by "output screen"?

Did you try to mark string as safe by calling mark_safe as I suggested?

On Sat, May 7, 2011 at 9:37 AM, GKR  wrote:

> actually i wanted the output as
>
> ..already exists.
>  [DEMO_
>
> not
>
>  ..already exists.  [DEMO_
>
> in the output screen.
>
>

-- 
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: Froms new line in forms.py

2011-05-07 Thread GKR
Yes It gave the output displaying  within the strings.

-- 
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: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Oleg Lomaka
Move fields from ModelAdmin to appropriate InlineModelAdmin

#admin.py
from models import Member, Address, Phone

class PhoneInline(admin.StackedInline):
model = Phone
can_delete = True
extra = 0
fields = ('areacode', 'number')

class AddressInline(admin.StackedInline):
model = Address
can_delete = True
extra = 0
fields = ('address', 'city', 'state', 'zip')

class MemberAdmin(admin.ModelAdmin):
inlines = [ PhoneInline, AddressInline ]
fieldsets = (
(None, {
'fields': ( 'username', 'first_name', 'middle_name',
'last_name')
}),
)

admin.site.register(Member, MemberAdmin)


On Sat, May 7, 2011 at 10:44 AM, Eiji Kobayashi wrote:

> Hi!
>
> I'm having trouble figuring out what to do.
> I have multiple models linked together using foreignkey, like the
> following:
>
> # models.py
> class Member(User):
>   middle_name = models.CharField(max_length=20)
>
> class Phone(models.Model):
>   owner = models.ForeignKey(Member)
>   areacode = models.CharField(max_length=5)
>   number = models.CharField(max_length=12)
>
> class Address(models.Model):
>   owner = models.ForeignKey(Member)
>   address = models.CharField(max_length=50)
>   city = models.CharField(max_length=50)
>   state = models.CharField(max_length=30)
>   zip = models.CharField(max_length=20)
>
> I want to be able to create the form that uses all three of the models in
> the admin section, so I did this:
>
> # admin.py
> from django.contrib import admin
> from django.contrib.auth.models import User
> from models import Member, Address, Phone
>
> class PhoneInline(admin.StackedInline):
>   model = Phone
>   can_delete = True
>   extra = 0
>
> class AddressInline(admin.StackedInline):
>   model = Address
>   can_delete = True
>   extra = 0
>
> class MemberAdmin(admin.ModelAdmin):
>   inlines = [ PhoneInline, AddressInline ]
>   fieldsets = (
> (None, {
> 'fields': ( 'first_name', 'middle_name', 'last_name', 'areacode',
> 'number' )
> }),
> ('Address', {
>'fields': ( 'address', 'state', 'city', 'state', 'zip' )
> })
>)
>
> admin.site.register(Member, MemberAdmin)
>
> When I runserver, it throws the following error:
>
> ImproperlyConfigured at /admin
>
> 'MemberAdmin.fields' refers to field 'areacode' that is missing from the form.
>
>
> If I take out 'areacode', 'number' from the None fieldset and remove the 
> 'Address' fieldset, leaving only
>
> 'first_name', 'middle_name', and 'last_name', it works fine. So, how can I 
> access the fields that are linked by foreign key?
>
> This is driving me crazy!!!
>
>
> Thanks!
>
> Eiji
>
>  --
> 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: Froms new line in forms.py

2011-05-07 Thread Oleg Lomaka
You didn't answer first question. What do you mean by "output screen". You
see those "" in console by printing the string, or you see it in the
browser?

On Sat, May 7, 2011 at 5:09 PM, GKR  wrote:

> Yes It gave the output displaying  within the strings.
>
>  --
> 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: how to use jquery for point of Sale

2011-05-07 Thread Derek
On May 7, 3:42 pm, GKR  wrote:
> thanks 

If, as you say, you want to work with a table and input text, and add
the item onto the table (I assume dynamically), then you'll need to
understand:

(a) how to work with Django form - see:
http://docs.djangoproject.com/en/dev/intro/tutorial04/?from=olddocs
http://www.djangobook.com/en/2.0/chapter07/
http://docs.djangoproject.com/en/1.3/topics/forms/

(b) how to work with jQuery forms - see:
http://uswaretech.com/blog/2010/01/doing-things-with-django-forms/
http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/

Obviously if you really unfamiliar with either Django or jQuery you'll
need to grasp at least the basics of both... but fortunately there is
a lot of information online!

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



Senior Web Apps Developer Position - Python-Django-Pasadena, CA Area

2011-05-07 Thread AceGerard
Senior Web Application Developer - Major Parts Distribution –
Pasadena, CA Area

Experience at a high traffic web property preferred (100,000+ page
views a day – Pricegrabber, eHarmony, Disney, MySpace, Google, Yahoo,
etc.)  Experience in more than one area at said high traffic site
preferred.

Languages / Frameworks

Experience with Python (Django Framework), JavaScript UI (Dojo
Toolkit) preferred.  Some experience with PHP is a plus.  Experience
with any open source scripting language for web development (Perl,
PHP, Python, Ruby) considered.  No candidates who have worked
*exclusively* with Java or .NET, and haven’t touched open source at
all.

Data Awareness

Experience working with data heavy applications required.  Strong
knowledge of MySQL or PostgreSQL databases highly desired.

Environment

High level of comfort in Linux or UNIX operating systems required.

Other Requirements

Some experience with some other kind of open source technology:
memcached, beanstalkd, Lucerne / Apache Solr, Sphinx Search, MongoDB,
CouchDB, watir, Selenium, nginx, Cassandra, Infobright, Greenplum,
anything else …  Experience with Subversion (SVN) or git preferred.

1.  What high-traffic websites have you worked on, and for how long?
2.  How extensive is your open-source web development in skills like
LAMP and Python?
3. What's your most significant website development achievement in the
past 5 years?

Jerry Witt | Technical Recruiter | netPolarity
office: 408-971-4555   mobile: 303-915-9667
Toll Free 1-866-971-6911 x303
jer...@netpolarity.com | www.netpolarity.com

www.linkedin.com/in/jerrywwitt

-- 
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: Froms new line in forms.py

2011-05-07 Thread GKR
sorry  for that

I am seeing it in browser

-- 
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: how to use jquery for point of Sale

2011-05-07 Thread GKR
thanks Derek

-- 
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: Froms new line in forms.py

2011-05-07 Thread Oleg Lomaka
Then you incorrectly use mark_safe function. Again, here is a form example:

from django.utils.safestring import mark_safe

class MyModelForm(forms.ModelForm):
class Meta:
model = MyModel

def clean_myfield(self):
raise forms.ValidationError(mark_safe("Errorhere"))

This  won't be escaped in browser. If you still have it escaped, then
share your forms.py and template somewhere.


On Sat, May 7, 2011 at 5:45 PM, GKR  wrote:
>
> I am seeing it in browser

-- 
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: Django password reset modification

2011-05-07 Thread Andy McKay

On 2011-05-05, at 9:36 PM, Phui-Hock wrote:

> On May 6, 4:22 am, Shawn Milochik  wrote:
>> This is a bad idea for multiple reasons. Don't do it.
> 
> Huh, care to explain, please?

Because it means you are storing passwords in plain text. There are multiple 
posts on the internet about this. Here's a couple:

http://blog.moertel.com/articles/2006/12/15/never-store-passwords-in-a-database
http://www.codinghorror.com/blog/2007/09/youre-probably-storing-passwords-incorrectly.html

--
  Andy McKay
  a...@clearwind.ca
  twitter: @andymckay
 

-- 
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: Problem in Configuring the database

2011-05-07 Thread rahul raj
On Fri, May 6, 2011 at 11:21 PM, Stuart MacKay <
smac...@flagstonesoftware.com> wrote:

> If you search for the error code 2002 the most likely cause is that the
> MySQL server is not running. However you also mention that you are running
> VMWare - I presume this is where the database server is running. Are you
> trying to connect to the database from another system, i.e. windows ?
>
> I use VirtualBox and the default setup for networking is such that the
> localhost cannot talk to the virtual server without explicitly setting up
> network bridging. So if VMWare is similar this is also a possible cause for
> your problems.
>
> As usual as much information about your setup and what options you have
> tried would make it easier to identify the problem.
>
>
> Regards,
>
> Stuart MacKay
> Lisboa, Portugal
>

Sir Stuart Mackay, Thank you for the reply..
Let me start like this...
"I wanted to develop a forum like application, i run WinXP, b'coz of very
less HDD space.. i couldn't install linux on my machine, so i opted for
VMWare & got OpenSUSE installed.. I downloaded Django and installed as
instructed in documentation,
Every thing worked fine till the step.."python manage.py runserver" after
this i got that "welcome page 'Congrats' page"
After this i wanted to install database.. as mentioned in documentation, i
did install mysql using YaST in OpenSUSE.. when i typed "mysql" in terminal
it showed an error -- " Can't connect to local
MySQL server through socket '/var/run/mysql/mysql.sock' (2)") "

I tried to check the error and correct what had gone wrong..
I Google 'd  though i found info like.. there r different versions of
"MySQL" for python and all... i even reinstalled it.. gave me the same
error... unable to proceed further...
That's when i found this group and mailed my problem...

The Django Documentation gives a clear info of Sqllite 2/3 usage but not
MySQL.. So what would u recommend me to install and work on..?
Can u please explain me the Procedure ?

Thank You..

-- 
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: Django password reset modification

2011-05-07 Thread Amanjeev Sethi
I second that. Email is the 'postcard' of the internet world. I wouldn't
send plain text password through email(s) even while running HTTPS web based
email services.



On Sat, May 7, 2011 at 11:27 AM, Andy McKay  wrote:

>
> On 2011-05-05, at 9:36 PM, Phui-Hock wrote:
>
> On May 6, 4:22 am, Shawn Milochik  wrote:
>
> This is a bad idea for multiple reasons. Don't do it.
>
>
> Huh, care to explain, please?
>
>
> Because it means you are storing passwords in plain text. There are
> multiple posts on the internet about this. Here's a couple:
>
>
> http://blog.moertel.com/articles/2006/12/15/never-store-passwords-in-a-database
>
> http://www.codinghorror.com/blog/2007/09/youre-probably-storing-passwords-incorrectly.html
>
>
> 
> --
>   Andy McKay
>   a...@clearwind.ca
>   twitter: @andymckay
>
>
>  --
> 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.
>



-- 
AJ

-- 
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: UML to Django - online generation service

2011-05-07 Thread Juan Hernandez
django-extensions does something similar

On Sat, May 7, 2011 at 3:04 AM, gusheng  wrote:

> I'm thinking of something opposite..
>
> Is it possible to draw uml base on my models?
>
> or, how to draw or present my model-structure-data..
>
>
> On May 4, 10:26 pm, jcabot  wrote:
> > Hi everybody,
> >
> > You can now try for free a new online code-generation service that
> > transforms plain UML class diagrams to Django models. Checkhttp://
> modeling-languages.com/content/uml2python-full-code-generator-...
> > for more info.
> >
> > Any feedback will be highly appreciated!
> >
> > Jordi
>
> --
> 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.



testing a model that uses stored procedures

2011-05-07 Thread Viktor Kojouharov
Hello,

I have a model that uses a stored procedure + a column outside of django's 
control for specialized selects. My problem is that I don't see a good way 
of testing my related python code for that model. 

Since I need to execute some SQL code at the beginning of each test, right 
after the fixtures are applied, I can always get a db cursor, and execute it 
in the setUp method. However, that would make the whole test a bit more 
unreadable, and harder to maintain.

What I want is to give the test an sql file, much like a fixture is given. 
Is there something like this?

-- 
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: Froms new line in forms.py

2011-05-07 Thread GKR
Thanks yu hepled me to resolve the problem..

The problem was 

i used it earlier as

raise forms.ValidationError("Item Code [" + fieldrec.barcode_id + "] already 
exists." + mark_safe("Errorhere") + fieldrec.i_name + " -- " + 
str(fieldrec.i_size) + "(ml) -- Rs." + str(fieldrec.i_price) + " -- Last 
Updated On: " + lud.strftime("%d/%m/%Y") +"]")

which didnt work

later i gave it as

raise forms.ValidationError(mark_safe("Item Code [" + 
fieldrec.barcode_id + "] already exists." + "Errorhere"+ 
fieldrec.i_name + " -- " + str(fieldrec.i_size) + "(ml) -- Rs." + 
str(fieldrec.i_price) + " -- Last Updated On: " + lud.strftime("%d/%m/%Y") 
+"]"  ) )


thanks a lot

-- 
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: Froms new line in forms.py

2011-05-07 Thread GKR
Thanks yu hepled me to resolve the problem..

The problem was 

i used it earlier as

raise forms.ValidationError("Item Code [" + fieldrec.barcode_id + "] already 
exists." + mark_safe("Errorhere") + fieldrec.i_name + " -- " + 
str(fieldrec.i_size) + "(ml) -- Rs." + str(fieldrec.i_price) + " -- Last 
Updated On: " + lud.strftime("%d/%m/%Y") +"]")

which didnt work

later i gave it as

raise forms.ValidationError(mark_safe("Item Code [" + fieldrec.barcode_id + 
"] already exists." + "Errorhere"+ fieldrec.i_name + " -- " + 
str(fieldrec.i_size) + "(ml) -- Rs." + str(fieldrec.i_price) + " -- Last 
Updated On: " + lud.strftime("%d/%m/%Y") +"]"  ) )


thanks a lot

-- 
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: Help! Database is locked! Windows developing envrionment, sqlite3, djcelery and djkombu

2011-05-07 Thread Jirka Vejrazka
Or any other database that you would be familiar with or could easily
get help for. SQLite3 is great for single-process tasks and simple
development. It can't however handle simultaneous writes (other
databases supported by Django can handle simultaneous writes)

  As you use multiple threads/processes, it's very likely that
processes try to write to database at the same time, which causes the
erorr you're getting.

   HTH

 Jirka

On 07/05/2011, Andy McKay  wrote:
>
> On 2011-05-06, at 7:01 PM, Robert Ray wrote:
>
>> I''im using Django 1.3 with Djcelery and Djkombu on Windows7. When I'm
>
>> Can anyone give me any help? Thanks in advance!
>
>
> You are using sqlite? Don't use that, use postgresql instead.
> --
>   Andy McKay
>   a...@clearwind.ca
>   twitter: @andymckay
>
>
> --
> 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: UML to Django - online generation service

2011-05-07 Thread Javier Guerra Giraldez
On Sat, May 7, 2011 at 11:21 AM, Juan Hernandez  wrote:
> django-extensions does something similar

second that

typically i start developing an app by drafting the models.  i keep a
window with the output of django-extensions updated automatically
every time i save.  makes it so easy to keep the big picture on sight

of course, it's not UML

-- 
Javier

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



ajax select box

2011-05-07 Thread pankaj sharma
hello everybody...

i want to have an advanced search option...

i have a college database.. which has city state and other things ..

now i want to provide a search system to user such that they can
search colleges by city and states and names



i have given select box for states and city..


now the problem is
  if somebody has selected a state .. then i want to show onlky those
cities {in selectbox for city} which are in that state.

so please tell me how to do 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-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: ajax select box

2011-05-07 Thread delegbede
Google jquery or ajax for related select boxes. I'm sure you'd get good written 
codes to tweak for your purpose. 

All the best. 
Sent from my BlackBerry wireless device from MTN

-Original Message-
From: pankaj sharma 
Sender: django-users@googlegroups.com
Date: Sat, 7 May 2011 12:05:00 
To: Django users
Reply-To: django-users@googlegroups.com
Subject: ajax select box

hello everybody...

i want to have an advanced search option...

i have a college database.. which has city state and other things ..

now i want to provide a search system to user such that they can
search colleges by city and states and names



i have given select box for states and city..


now the problem is
  if somebody has selected a state .. then i want to show onlky those
cities {in selectbox for city} which are in that state.

so please tell me how to do 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-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: ajax select box

2011-05-07 Thread Shawn Milochik

You'll need to write JavaScript.

Specifically:

Write a function that uses AJAX to pass the state to a Django view 
and receive the city list, then populate the city drop-down.


Bind that function to the change event of your state drop-down box.

This isn't a Django question, though. If you have trouble doing that try 
a JavaScript mailing list.


I recommend using jQuery's .ajax() function for this.

Shawn





--
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: Error (EXTERNAL IP): /add_comment/10/

2011-05-07 Thread Aragorn
Hi,
this is code for mail send:

def save(self, *args, **kwargs):
"""Email when a comment is added."""
if "notify" in kwargs and kwargs["notify"] == True:
message = "Comment was was added to '%s' by '%s': \n\n%s"
% (self.post, self.author,
 
self.body)
from_addr = "m...@noxfarm.com"
recipient_list = ["mass...@noxfarm.com.com"]
send_mail("New comment added", message, from_addr,
recipient_list)

if "notify" in kwargs: del kwargs["notify"]
super(Comment, self).save(*args, **kwargs)

On 4 Mag, 15:30, Xavier Ordoquy  wrote:
> Hi,
>
> Have you tried the development server (runserver) on the computer that runs 
> the wsgy ?
> What LANG does apache declares (/etc/apache/envvars) ?
> How much of the body do you change in the save function ?
>
> Xavier.
>
> Le 4 mai 2011 à 15:16, Massimo a écrit :
>
>
>
>
>
>
>
> > Yes, I get an email when someone writes a
> > comment. (Sorry but I do not speak English). If I run with "python 
> > manage.py runserver" the email arrives well, if run with apache wsgy  the 
> > result is the error !
>
> > 2011/5/4 Xavier Ordoquy 
>
> > Le 4 mai 2011 à 13:44, Aragorn a écrit :
>
> > > HI,
>
> > > I can not understand where is the error. when you insert a
> > > blog comment I receive an email, but this'
> > > the email I receive !
>
> > Hi,
>
> > I noticed you have overridden the save method. Could you tell us more about 
> > what you are doing the that method ?
> > I suspect you try to send a mail telling you you have a new comment, don't 
> > you ?
>
> > Regards,
> > Xavier.
>
> > --
> > 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 
> > athttp://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 
> > athttp://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: Error (EXTERNAL IP): /add_comment/10/

2011-05-07 Thread Aragorn
Hello,
I tried it runserver on the production server and does not work!
I made some mistakes in copying the code?

On 4 Mag, 15:30, Xavier Ordoquy  wrote:
> Hi,
>
> Have you tried the development server (runserver) on the computer that runs 
> the wsgy ?
> What LANG does apache declares (/etc/apache/envvars) ?
> How much of the body do you change in the save function ?
>
> Xavier.
>
> Le 4 mai 2011 à 15:16, Massimo a écrit :
>
>
>
>
>
>
>
> > Yes, I get an email when someone writes a
> > comment. (Sorry but I do not speak English). If I run with "python 
> > manage.py runserver" the email arrives well, if run with apache wsgy  the 
> > result is the error !
>
> > 2011/5/4 Xavier Ordoquy 
>
> > Le 4 mai 2011 à 13:44, Aragorn a écrit :
>
> > > HI,
>
> > > I can not understand where is the error. when you insert a
> > > blog comment I receive an email, but this'
> > > the email I receive !
>
> > Hi,
>
> > I noticed you have overridden the save method. Could you tell us more about 
> > what you are doing the that method ?
> > I suspect you try to send a mail telling you you have a new comment, don't 
> > you ?
>
> > Regards,
> > Xavier.
>
> > --
> > 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 
> > athttp://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 
> > athttp://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: Error (EXTERNAL IP): /add_comment/10/

2011-05-07 Thread Aragorn

Hi,
this is code for mail send:
def save(self, *args, **kwargs):
"""Email when a comment is added."""
if "notify" in kwargs and kwargs["notify"] == True:
message = "Comment was was added to '%s' by '%s': \n\n%s"
% (self.post, self.author,
self.body)
from_addr = "m...@pippo.it"
recipient_list = ["m...@pippo.it"]
send_mail("New comment added", message, from_addr,
recipient_list)
if "notify" in kwargs: del kwargs["notify"]
super(Comment, self).save(*args, **kwargs)



On 4 Mag, 15:30, Xavier Ordoquy  wrote:
> Hi,
>
> Have you tried the development server (runserver) on the computer that runs 
> the wsgy ?
> What LANG does apache declares (/etc/apache/envvars) ?
> How much of the body do you change in the save function ?
>
> Xavier.
>
> Le 4 mai 2011 à 15:16, Massimo a écrit :
>
>
>
>
>
>
>
> > Yes, I get an email when someone writes a
> > comment. (Sorry but I do not speak English). If I run with "python 
> > manage.py runserver" the email arrives well, if run with apache wsgy  the 
> > result is the error !
>
> > 2011/5/4 Xavier Ordoquy 
>
> > Le 4 mai 2011 à 13:44, Aragorn a écrit :
>
> > > HI,
>
> > > I can not understand where is the error. when you insert a
> > > blog comment I receive an email, but this'
> > > the email I receive !
>
> > Hi,
>
> > I noticed you have overridden the save method. Could you tell us more about 
> > what you are doing the that method ?
> > I suspect you try to send a mail telling you you have a new comment, don't 
> > you ?
>
> > Regards,
> > Xavier.
>
> > --
> > 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 
> > athttp://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 
> > athttp://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: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
This doesn't do anything. I still get the same error.

I'd like to be able to access the fields from the Phone and Address
model from
the MemberAdmin model. I still cannot do this. Any other way?

Eiji

On May 7, 7:22 am, Oleg Lomaka  wrote:
> Move fields from ModelAdmin to appropriate InlineModelAdmin
>
> #admin.py
> from models import Member, Address, Phone
>
> class PhoneInline(admin.StackedInline):
>     model = Phone
>     can_delete = True
>     extra = 0
>     fields = ('areacode', 'number')
>
> class AddressInline(admin.StackedInline):
>     model = Address
>     can_delete = True
>     extra = 0
>     fields = ('address', 'city', 'state', 'zip')
>
> class MemberAdmin(admin.ModelAdmin):
>     inlines = [ PhoneInline, AddressInline ]
>     fieldsets = (
>         (None, {
>                 'fields': ( 'username', 'first_name', 'middle_name',
> 'last_name')
>                 }),
>         )
>
> admin.site.register(Member, MemberAdmin)
>
> On Sat, May 7, 2011 at 10:44 AM, Eiji Kobayashi wrote:
>
>
>
>
>
>
>
> > Hi!
>
> > I'm having trouble figuring out what to do.
> > I have multiple models linked together using foreignkey, like the
> > following:
>
> > # models.py
> > class Member(User):
> >   middle_name = models.CharField(max_length=20)
>
> > class Phone(models.Model):
> >   owner = models.ForeignKey(Member)
> >   areacode = models.CharField(max_length=5)
> >   number = models.CharField(max_length=12)
>
> > class Address(models.Model):
> >   owner = models.ForeignKey(Member)
> >   address = models.CharField(max_length=50)
> >   city = models.CharField(max_length=50)
> >   state = models.CharField(max_length=30)
> >   zip = models.CharField(max_length=20)
>
> > I want to be able to create the form that uses all three of the models in
> > the admin section, so I did this:
>
> > # admin.py
> > from django.contrib import admin
> > from django.contrib.auth.models import User
> > from models import Member, Address, Phone
>
> > class PhoneInline(admin.StackedInline):
> >   model = Phone
> >   can_delete = True
> >   extra = 0
>
> > class AddressInline(admin.StackedInline):
> >   model = Address
> >   can_delete = True
> >   extra = 0
>
> > class MemberAdmin(admin.ModelAdmin):
> >   inlines = [ PhoneInline, AddressInline ]
> >   fieldsets = (
> >     (None, {
> >         'fields': ( 'first_name', 'middle_name', 'last_name', 'areacode',
> > 'number' )
> >     }),
> >     ('Address', {
> >        'fields': ( 'address', 'state', 'city', 'state', 'zip' )
> >     })
> >    )
>
> > admin.site.register(Member, MemberAdmin)
>
> > When I runserver, it throws the following error:
>
> > ImproperlyConfigured at /admin
>
> > 'MemberAdmin.fields' refers to field 'areacode' that is missing from the 
> > form.
>
> > If I take out 'areacode', 'number' from the None fieldset and remove the 
> > 'Address' fieldset, leaving only
>
> > 'first_name', 'middle_name', and 'last_name', it works fine. So, how can I 
> > access the fields that are linked by foreign key?
>
> > This is driving me crazy!!!
>
> > Thanks!
>
> > Eiji
>
> >  --
> > 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: Error (EXTERNAL IP): /add_comment/10/

2011-05-07 Thread Aragorn
...views.py

def add_comment(request, pk):
"""Add a new comment."""
p = request.POST

if p.has_key("body") and p["body"]:
author = "Anonymous"
if p["author"]: author = p["author"]
comment = Comment(post=Post.objects.get(pk=pk))

# save comment form
cf = CommentForm(p, instance=comment)
cf.fields["author"].required = False
comment = cf.save(commit=False)

# save comment instance
comment.author = author
notify = True
if request.user.username == "ak": notify = False
comment.save(notify=notify)
return HttpResponseRedirect(reverse("dbe.blog.views.post",
args=[pk]))



On 7 Mag, 22:03, Aragorn  wrote:
> Hello,
> I tried it runserver on the production server and does not work!
> I made some mistakes in copying the code?
>
> On 4 Mag, 15:30, Xavier Ordoquy  wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > Have you tried the development server (runserver) on the computer that runs 
> > the wsgy ?
> > What LANG does apache declares (/etc/apache/envvars) ?
> > How much of the body do you change in the save function ?
>
> > Xavier.
>
> > Le 4 mai 2011 à 15:16, Massimo a écrit :
>
> > > Yes, I get an email when someone writes a
> > > comment. (Sorry but I do not speak English). If I run with "python 
> > > manage.py runserver" the email arrives well, if run with apache wsgy  the 
> > > result is the error !
>
> > > 2011/5/4 Xavier Ordoquy 
>
> > > Le 4 mai 2011 à 13:44, Aragorn a écrit :
>
> > > > HI,
>
> > > > I can not understand where is the error. when you insert a
> > > > blog comment I receive an email, but this'
> > > > the email I receive !
>
> > > Hi,
>
> > > I noticed you have overridden the save method. Could you tell us more 
> > > about what you are doing the that method ?
> > > I suspect you try to send a mail telling you you have a new comment, 
> > > don't you ?
>
> > > Regards,
> > > Xavier.
>
> > > --
> > > 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 
> > > athttp://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 
> > > athttp://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: [Django] Error (EXTERNAL IP): /add_comment/10/

2011-05-07 Thread Andy McKay

On 2011-05-04, at 4:44 AM, Aragorn wrote:
> File "/home/max/public_html/examplesite.com/django/dbe/blog/
> models.py", line 44, in save
>   self.body)

You told us lots of stuff, including the save method, but since we don't know 
line numbers, which one is line 44?

> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position
> 41: ordinal not in range(128)

There's some helpful information on this error from Google, here's one of them:

http://wiki.python.org/moin/UnicodeDecodeError
--
  Andy McKay
  a...@clearwind.ca
  twitter: @andymckay
 

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



my models are remembering old fields that I have since deleted

2011-05-07 Thread Dug_the_Math_Guy
HI I'm new to Django and just getting some models going. I started
with a more complex model and got errors so I scaled back to a more
minimalist model to see if I could get that working. I flushed my
database to get rid of any old info and synched the DB to create the
new more minimal models. When I go to the admin page to make some
instatiations of my models I get a DB integrity error that says that
the model I'm entering requires a field that used to be required in
the more complicated original model, but is currently not in my models
or code anywhere. I thought that the flush command would get rid of
everything and it shouldn't even remember the name of this old field,
none the less require it in my simplified model. Anybody know what
could be going on? Is there another way to completely clean out my
database?
Doug

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



Loading project to alwaysdata

2011-05-07 Thread ruler501
I have made a project and now want to put it on the internet. How do I
get it on alwaysdata. I have registered a domain name already and have
an account.

I do not know much about how internet stuff works. my knowledge stops
at how to code the websites(and not too much here yet). so If you
could explain it like how you'd explain it to someone who knows almost
nothing so I could understand 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-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: my models are remembering old fields that I have since deleted

2011-05-07 Thread Nick Arnett
On Sat, May 7, 2011 at 6:05 PM, Dug_the_Math_Guy wrote:

> HI I'm new to Django and just getting some models going. I started
> with a more complex model and got errors so I scaled back to a more
> minimalist model to see if I could get that working. I flushed my
> database to get rid of any old info and synched the DB to create the
> new more minimal models.


Syncing the database doesn't delete anything, ever.  Probably the simplest
way to deal with this is to rename (in the database) the tables that you
have changed, then run syncdb to create your new tables, then copy the old
data into the new tables and delete the old tables.

If by "flushed" you mean you deleted the old tables (or the whole database),
then something else is going on.

Nick

-- 
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: my models are remembering old fields that I have since deleted

2011-05-07 Thread George Silva
Just drop the old tables and run syncdb again!

Cheers

On Sat, May 7, 2011 at 10:45 PM, Nick Arnett  wrote:

>
>
> On Sat, May 7, 2011 at 6:05 PM, Dug_the_Math_Guy 
> wrote:
>
>> HI I'm new to Django and just getting some models going. I started
>> with a more complex model and got errors so I scaled back to a more
>> minimalist model to see if I could get that working. I flushed my
>> database to get rid of any old info and synched the DB to create the
>> new more minimal models.
>
>
> Syncing the database doesn't delete anything, ever.  Probably the simplest
> way to deal with this is to rename (in the database) the tables that you
> have changed, then run syncdb to create your new tables, then copy the old
> data into the new tables and delete the old tables.
>
> If by "flushed" you mean you deleted the old tables (or the whole
> database), then something else is going on.
>
> Nick
>
> --
> 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.
>



-- 
George R. C. Silva

Desenvolvimento em GIS
http://geoprocessamento.net
http://blog.geoprocessamento.net

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

2011-05-07 Thread hersh
Hi to all,

I am new. I want to apply Django to develop an E-commerce project. I
am looking for a good reference to start. I 'd like to add that I have
to do the project in less than one month. I need a quick reference to
understand the basics of Django and start my project. If there are
some sample project it could be really helpful. Let describe myself: I
am quit familiar with programming. I have done lots of programming in
C/C++. But I am beginner in Python and have heard of Django yesterday.

Please guide me and help me find the way. If you have any TUTORIALS
and REFERENCES

Thanks in advance
/ Rahim

-- 
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 Blog Engines that Run on GAE

2011-05-07 Thread Mark Curphey
I am looking for some base code to start a side-project without having to 
re-invent the wheel. 

Are there any good Django Blog Engines that are open source (non GPL) and work 
(or can easily be hacked to work) on the Google App Engine (i.e. non-rel)?

Most the GitHub projects look stale or inert.

Cheers!

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.



Re: my models are remembering old fields that I have since deleted

2011-05-07 Thread Nick Arnett
On Sat, May 7, 2011 at 6:50 PM, George Silva wrote:

> Just drop the old tables and run syncdb again!


I didn't think it was safe to assume that he wanted to throw away all of his
data...

Nick

-- 
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: Django Bigener

2011-05-07 Thread Anoop Thomas Mathew
Hi Rahim,

try docs.djangoproject.com
and do the tutorial yourself. This would help you very much.

regards,
atm

On 08/05/2011, hersh  wrote:
> Hi to all,
>
> I am new. I want to apply Django to develop an E-commerce project. I
> am looking for a good reference to start. I 'd like to add that I have
> to do the project in less than one month. I need a quick reference to
> understand the basics of Django and start my project. If there are
> some sample project it could be really helpful. Let describe myself: I
> am quit familiar with programming. I have done lots of programming in
> C/C++. But I am beginner in Python and have heard of Django yesterday.
>
> Please guide me and help me find the way. If you have any TUTORIALS
> and REFERENCES
>
> Thanks in advance
> / Rahim
>
> --
> 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.
>
>


-- 
atm
___
Life is short, Live it hard.

-- 
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: Loading project to alwaysdata

2011-05-07 Thread Anoop Thomas Mathew
Can you elaborate a little. is it that you want to set up a django
project or just to display an html from web space??

if your aim is 1,
you can find help here..
docs.djangoproject.com/en/dev/howto/deployment/

if your aim is 2,
you'd better go to some basic web hosting forums.

regards,


On 08/05/2011, ruler501  wrote:
> I have made a project and now want to put it on the internet. How do I
> get it on alwaysdata. I have registered a domain name already and have
> an account.
>
> I do not know much about how internet stuff works. my knowledge stops
> at how to code the websites(and not too much here yet). so If you
> could explain it like how you'd explain it to someone who knows almost
> nothing so I could understand 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-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.
>
>


-- 
atm
___
Life is short, Live it hard.

-- 
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: Loading project to alwaysdata

2011-05-07 Thread ruler501
I want to deploy it. I don't know how they run django there. I don't
read french.

On May 7, 9:56 pm, Anoop Thomas Mathew  wrote:
> Can you elaborate a little. is it that you want to set up a django
> project or just to display an html from web space??
>
> if your aim is 1,
> you can find help here..
> docs.djangoproject.com/en/dev/howto/deployment/
>
> if your aim is 2,
> you'd better go to some basic web hosting forums.
>
> regards,
>
> On 08/05/2011, ruler501  wrote:
>
>
>
>
>
>
>
>
>
> > I have made a project and now want to put it on the internet. How do I
> > get it on alwaysdata. I have registered a domain name already and have
> > an account.
>
> > I do not know much about how internet stuff works. my knowledge stops
> > at how to code the websites(and not too much here yet). so If you
> > could explain it like how you'd explain it to someone who knows almost
> > nothing so I could understand 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-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.
>
> --
> atm
> ___
> Life is short, Live it hard.

-- 
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: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Oleg Lomaka
If you get the same error, the you have missed something. Show me your
current admin.py once more.

As to "I'd like to be able to access the fields from the Phone and
Address model from the MemberAdmin model". You can access fields from Phone
and Address from the InlineAdminModel. That is in case you want to access
them on change/add view. As shown in my previous example.

And if you want to access those fields from list view, then you can create a
function in your Member model to format phone fields into string and include
it in a list_display. Example

# models.py
class Member(User):
  middle_name = models.CharField(max_length=20)

  def all_phones(self):
return ", ".join(["(%s) %s" % (p.areacode, p.number) for p in
self.phone_set.all()])

# admin.py
class MemberAdmin(admin.ModelAdmin):
  list_display = ('first_name', 'middle_name', 'last_name', 'all_phones')

On Sat, May 7, 2011 at 11:59 PM, Eiji Kobayashi wrote:

> This doesn't do anything. I still get the same error.
>
> I'd like to be able to access the fields from the Phone and Address
> model from
> the MemberAdmin model. I still cannot do this. Any other way?
>
> Eiji
>
> On May 7, 7:22 am, Oleg Lomaka  wrote:
> > Move fields from ModelAdmin to appropriate InlineModelAdmin
> >
> > #admin.py
> > from models import Member, Address, Phone
> >
> > class PhoneInline(admin.StackedInline):
> > model = Phone
> > can_delete = True
> > extra = 0
> > fields = ('areacode', 'number')
> >
> > class AddressInline(admin.StackedInline):
> > model = Address
> > can_delete = True
> > extra = 0
> > fields = ('address', 'city', 'state', 'zip')
> >
> > class MemberAdmin(admin.ModelAdmin):
> > inlines = [ PhoneInline, AddressInline ]
> > fieldsets = (
> > (None, {
> > 'fields': ( 'username', 'first_name', 'middle_name',
> > 'last_name')
> > }),
> > )
> >
> > admin.site.register(Member, MemberAdmin)
> >
> > On Sat, May 7, 2011 at 10:44 AM, Eiji Kobayashi  >wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Hi!
> >
> > > I'm having trouble figuring out what to do.
> > > I have multiple models linked together using foreignkey, like the
> > > following:
> >
> > > # models.py
> > > class Member(User):
> > >   middle_name = models.CharField(max_length=20)
> >
> > > class Phone(models.Model):
> > >   owner = models.ForeignKey(Member)
> > >   areacode = models.CharField(max_length=5)
> > >   number = models.CharField(max_length=12)
> >
> > > class Address(models.Model):
> > >   owner = models.ForeignKey(Member)
> > >   address = models.CharField(max_length=50)
> > >   city = models.CharField(max_length=50)
> > >   state = models.CharField(max_length=30)
> > >   zip = models.CharField(max_length=20)
> >
> > > I want to be able to create the form that uses all three of the models
> in
> > > the admin section, so I did this:
> >
> > > # admin.py
> > > from django.contrib import admin
> > > from django.contrib.auth.models import User
> > > from models import Member, Address, Phone
> >
> > > class PhoneInline(admin.StackedInline):
> > >   model = Phone
> > >   can_delete = True
> > >   extra = 0
> >
> > > class AddressInline(admin.StackedInline):
> > >   model = Address
> > >   can_delete = True
> > >   extra = 0
> >
> > > class MemberAdmin(admin.ModelAdmin):
> > >   inlines = [ PhoneInline, AddressInline ]
> > >   fieldsets = (
> > > (None, {
> > > 'fields': ( 'first_name', 'middle_name', 'last_name',
> 'areacode',
> > > 'number' )
> > > }),
> > > ('Address', {
> > >'fields': ( 'address', 'state', 'city', 'state', 'zip' )
> > > })
> > >)
> >
> > > admin.site.register(Member, MemberAdmin)
> >
> > > When I runserver, it throws the following error:
> >
> > > ImproperlyConfigured at /admin
> >
> > > 'MemberAdmin.fields' refers to field 'areacode' that is missing from
> the form.
> >
> > > If I take out 'areacode', 'number' from the None fieldset and remove
> the 'Address' fieldset, leaving only
> >
> > > 'first_name', 'middle_name', and 'last_name', it works fine. So, how
> can I access the fields that are linked by foreign key?
> >
> > > This is driving me crazy!!!
> >
> > > Thanks!
> >
> > > Eiji
> >
> > >  --
> > > 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.
>
>

-- 
You received th

Re: Using fields from multiple models (connected by foreign key) in the ModelAdmin

2011-05-07 Thread Eiji Kobayashi
Hi Oleg,

Thanks for your patience. I'm pretty sure I DID miss something like
you said. Here's my admin.py, with the modifications you suggested:

# admin.py
from django.contrib import admin
from django.contrib.auth.models import User
from models import Member, Address, Phone

class PhoneInline(admin.StackedInline):
  model = Phone
  can_delete = True
  extra = 0
  fields = ( 'areacode', 'number')

class AddressInline(admin.StackedInline):
  model = Address
  can_delete = True
  extra = 0
  fields = ( 'addresstype', 'address', 'city', 'state', 'postal_code')

class MemberAdmin(admin.ModelAdmin):
  inlines = [ PhoneInline, AddressInline ]
  fieldsets = (
(None, {
'fields': ( 'first_name', 'middle_name', 'last_name',
'areacode', 'number' )
})
   )

admin.site.register(Member, MemberAdmin)

The actual error I get is:

ImproperlyConfigured at /admin/
'MemberAdmin.fieldsets[0][1]['fields']' refers to field 'areacode'
that is missing from the form.

When I add the all_phones function in the models.py and define the
list_display like you suggested, I get this error:

TemplateSyntaxError at /admin/account/member/
Caught OperationalError while rendering: (1054, "Unknown column
'account_phone.areacode' in 'field list'")

There must be a simpler way to just edit the primary model and its
related models in the admin, no?
Thanks!

Eiji



On May 7, 8:32 pm, Oleg Lomaka  wrote:
> If you get the same error, the you have missed something. Show me your
> current admin.py once more.
>
> As to "I'd like to be able to access the fields from the Phone and
> Address model from the MemberAdmin model". You can access fields from Phone
> and Address from the InlineAdminModel. That is in case you want to access
> them on change/add view. As shown in my previous example.
>
> And if you want to access those fields from list view, then you can create a
> function in your Member model to format phone fields into string and include
> it in a list_display. Example
>
> # models.py
> class Member(User):
>   middle_name = models.CharField(max_length=20)
>
>   def all_phones(self):
>     return ", ".join(["(%s) %s" % (p.areacode, p.number) for p in
> self.phone_set.all()])
>
> # admin.py
> class MemberAdmin(admin.ModelAdmin):
>   list_display = ('first_name', 'middle_name', 'last_name', 'all_phones')
>
> On Sat, May 7, 2011 at 11:59 PM, Eiji Kobayashi wrote:
>
>
>
>
>
>
>
> > This doesn't do anything. I still get the same error.
>
> > I'd like to be able to access the fields from the Phone and Address
> > model from
> > the MemberAdmin model. I still cannot do this. Any other way?
>
> > Eiji
>
> > On May 7, 7:22 am, Oleg Lomaka  wrote:
> > > Move fields from ModelAdmin to appropriate InlineModelAdmin
>
> > > #admin.py
> > > from models import Member, Address, Phone
>
> > > class PhoneInline(admin.StackedInline):
> > >     model = Phone
> > >     can_delete = True
> > >     extra = 0
> > >     fields = ('areacode', 'number')
>
> > > class AddressInline(admin.StackedInline):
> > >     model = Address
> > >     can_delete = True
> > >     extra = 0
> > >     fields = ('address', 'city', 'state', 'zip')
>
> > > class MemberAdmin(admin.ModelAdmin):
> > >     inlines = [ PhoneInline, AddressInline ]
> > >     fieldsets = (
> > >         (None, {
> > >                 'fields': ( 'username', 'first_name', 'middle_name',
> > > 'last_name')
> > >                 }),
> > >         )
>
> > > admin.site.register(Member, MemberAdmin)
>
> > > On Sat, May 7, 2011 at 10:44 AM, Eiji Kobayashi  > >wrote:
>
> > > > Hi!
>
> > > > I'm having trouble figuring out what to do.
> > > > I have multiple models linked together using foreignkey, like the
> > > > following:
>
> > > > # models.py
> > > > class Member(User):
> > > >   middle_name = models.CharField(max_length=20)
>
> > > > class Phone(models.Model):
> > > >   owner = models.ForeignKey(Member)
> > > >   areacode = models.CharField(max_length=5)
> > > >   number = models.CharField(max_length=12)
>
> > > > class Address(models.Model):
> > > >   owner = models.ForeignKey(Member)
> > > >   address = models.CharField(max_length=50)
> > > >   city = models.CharField(max_length=50)
> > > >   state = models.CharField(max_length=30)
> > > >   zip = models.CharField(max_length=20)
>
> > > > I want to be able to create the form that uses all three of the models
> > in
> > > > the admin section, so I did this:
>
> > > > # admin.py
> > > > from django.contrib import admin
> > > > from django.contrib.auth.models import User
> > > > from models import Member, Address, Phone
>
> > > > class PhoneInline(admin.StackedInline):
> > > >   model = Phone
> > > >   can_delete = True
> > > >   extra = 0
>
> > > > class AddressInline(admin.StackedInline):
> > > >   model = Address
> > > >   can_delete = True
> > > >   extra = 0
>
> > > > class MemberAdmin(admin.ModelAdmin):
> > > >   inlines = [ PhoneInline, AddressInline ]
> > > >   fieldsets = (
> > > >     (None, {
> > > >         'fields': ( 'first_name', 'middle

Re: Django Bigener

2011-05-07 Thread delegbede
Welcome Rahim. 

Start with the django tutorials. 
Second, look through the django book. These two would give you the needed 
basics. 

What counts here is the zeal and it seems you have it. 

All the best. 
Sent from my BlackBerry wireless device from MTN

-Original Message-
From: hersh 
Sender: django-users@googlegroups.com
Date: Sat, 7 May 2011 12:13:11 
To: Django users
Reply-To: django-users@googlegroups.com
Subject: Django Bigener

Hi to all,

I am new. I want to apply Django to develop an E-commerce project. I
am looking for a good reference to start. I 'd like to add that I have
to do the project in less than one month. I need a quick reference to
understand the basics of Django and start my project. If there are
some sample project it could be really helpful. Let describe myself: I
am quit familiar with programming. I have done lots of programming in
C/C++. But I am beginner in Python and have heard of Django yesterday.

Please guide me and help me find the way. If you have any TUTORIALS
and REFERENCES

Thanks in advance
/ Rahim

-- 
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: Django Bigener

2011-05-07 Thread Ryan Osborn
The django tutorial that the others have mentioned is the best place to 
learn the basics.  There is also a book on E-Commerce in django: 
http://www.amazon.co.uk/Beginning-Django--Commerce-Experts-Development/dp/1430225351/ref=sr_1_9?s=books&ie=UTF8&qid=1304834462&sr=1-9

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