Re: ANN: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-27 Thread Russell Keith-Magee
On Thu, Sep 27, 2012 at 3:10 PM, M.-A. Lemburg  wrote:
> Russell Keith-Magee wrote:
>> On Wed, Sep 26, 2012 at 8:11 PM, winniehell  wrote:
>>> We had a little private discussion about this. Is this list meant to be
>>> for product announcements? I personally don't like to get product
>>> announcements on mailing lists because I'm in most cases not interested
>>> in the offered products.
>>
>> We don't prohibit commercial announcements, but they need to be on
>> topic, and the poster needs to show some moderation -- we don't mind
>> an occasional major announcement, but a weekly point release
>> notification would be excessive.
>
> Does Django have an announcement list that we could use for
> announcements like these ?

We have an announcements list, but it's for official Django
announcements, and we don't want other commercial material on that
list because when we post to it, we *need* people to pay attention
(for security updates, and so on).

As for a 'django community announcements' list: I can see how that
might be useful, but I can also see that it introduces a whole bunch
of new headaches. We have enough problems getting people to post to
the right list when there is only two (django-users and django-dev);
adding a third has the potential to just confuse things more...

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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.



IntegrityError at /add/ PRIMARY KEY must be unique

2012-09-27 Thread enemybass
 http://wklej.org/id/837631/ - models, traceback, urls, views, database 
structure


After adding data to database I have error (data is added correctly but 
displays an error):



Exception Type: IntegrityError at /add/Exception Value: PRIMARY KEY must be 
unique


def add(request):
if request.user.is_authenticated():
user = request.user
b = Product.objects.get(id=3)
e = b.basket_set.create(name='basket_name', owner=user)
e.save(force_insert=True)

return render_to_response('basket.html')


How to fix it?

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



Unable to Store Decimal values to DecimalField

2012-09-27 Thread Laxmikant Gurnalkar
Hi ,

   While storing decimal values to database I have following error.

Exception in storeFormatMetadataTraceback (most recent call last):
  File "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118, in 
storePricing
book.save()
  File "/var/opt/igp_acfs/acfs/models.py", line 529, in save
super(BookProductFormat, self).save()
  File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line 
458, in save
self.save_base(using=using, force_insert=force_insert, 
force_update=force_update)
  File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line 
524, in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
  File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line 
502, in _update
return query.get_compiler(self.db).execute_sql(None)
  File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", 
line 866, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
  File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", 
line 722, in execute_sql
sql, params = self.as_sql()
  File "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", 
line 831, in as_sql
val = field.get_db_prep_save(val, connection=self.connection)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", 
line 28, in inner
return func(*args, **kwargs)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", 
line 28, in inner
return func(*args, **kwargs)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", 
line 28, in inner
return func(*args, **kwargs)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py", 
line 276, in get_db_prep_save
return self.get_db_prep_value(value, connection=connection, 
prepared=False)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", 
line 53, in inner
return func(*args, **kwargs)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", 
line 53, in inner
return func(*args, **kwargs)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py", 
line 53, in inner
return func(*args, **kwargs)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py", 
line 271, in get_db_prep_value
value = self.get_prep_value(value)
  File 
"/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py", 
line 876, in get_prep_value
return int(value)
ValueError: invalid literal for int() with base 10: ''


This is my code :

obj = Model.objects.get(uid = formatuid)
obj.price = Decimal(price).quantize(Decimal('.01'), 
rounding='ROUND_DOWN')
obj.active = 1 if formats.get(format, "")else 0
obj.save()


This is my mdel Field

price = models.DecimalField(max_digits=3, decimal_places=2, 
blank=True, null=True)


I dont think. I'm wrong somewhere. Please HELP 
Obviously price is my decimal Field.


Best Regards,
Laxmikant

-- 
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/-/K6k0jAEaxYcJ.
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 Store Decimal values to DecimalField

2012-09-27 Thread Sergey Fursov
As I see from the stack, error produced by  book.save() in  File
"/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118 but in you code
I can't this line of code. Do you really show the code, that related to
error

2012/9/27 Laxmikant Gurnalkar 

> Hi ,
>
>While storing decimal values to database I have following error.
>
> Exception in storeFormatMetadataTraceback (most recent call last):
>   File "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118, in
> storePricing
> book.save()
>   File "/var/opt/igp_acfs/acfs/models.py", line 529, in save
> super(BookProductFormat, self).save()
>   File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line
> 458, in save
> self.save_base(using=using, force_insert=force_insert,
> force_update=force_update)
>   File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line
> 524, in save_base
> rows = manager.using(using).filter(pk=pk_val)._update(values)
>   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
> 502, in _update
> return query.get_compiler(self.db).execute_sql(None)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line
> 866, in execute_sql
> cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line
> 722, in execute_sql
> sql, params = self.as_sql()
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line
> 831, in as_sql
> val = field.get_db_prep_save(val, connection=self.connection)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
> line 28, in inner
> return func(*args, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
> line 28, in inner
> return func(*args, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
> line 28, in inner
> return func(*args, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
> line 276, in get_db_prep_save
> return self.get_db_prep_value(value, connection=connection,
> prepared=False)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
> line 53, in inner
> return func(*args, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
> line 53, in inner
> return func(*args, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
> line 53, in inner
> return func(*args, **kwargs)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
> line 271, in get_db_prep_value
> value = self.get_prep_value(value)
>   File
> "/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
> line 876, in get_prep_value
> return int(value)
> ValueError: invalid literal for int() with base 10: ''
>
>
> This is my code :
>
> obj = Model.objects.get(uid = formatuid)
> obj.price = Decimal(price).quantize(Decimal('.01'),
> rounding='ROUND_DOWN')
> obj.active = 1 if formats.get(format, "")else 0
> obj.save()
>
>
> This is my mdel Field
>
> price = models.DecimalField(max_digits=3, decimal_places=2,
> blank=True, null=True)
>
>
> I dont think. I'm wrong somewhere. Please HELP
> Obviously price is my decimal Field.
>
>
> Best Regards,
> Laxmikant
>
> --
> 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/-/K6k0jAEaxYcJ.
> 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: Upgraded to Django 1.4.1 and now I have one database connection

2012-09-27 Thread Tom Evans
On Wed, Sep 26, 2012 at 12:34 PM, Ricardo Grizonic
 wrote:
> Hey everyone,
>
> I recently upgraded from Django 1.3 to 1.4.1 and now it seems that for every
> new thread, a new database connection to postgresql is created. I'm using:
>
> from django.db import connection
>
> which, according to the docs, should get a global connection that would be
> used by all the threads. Anything I might be doing wrong?
>
> Thanks, in advance, for you help!
>

I think you are misreading the docs. Each thread or process has its
own database connection.

Cheers

Tom

-- 
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: New Project 403 Forbidden Error

2012-09-27 Thread Amyth Arora
What View are you getting the error on ? can you post the code to the View
and the template ?

Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @mytharora
http://techstricks.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: syncdb in GeoDjango tutorial

2012-09-27 Thread Amyth Arora
post the code to WorldBorder Model. 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.



A BBS based on Django

2012-09-27 Thread 月忧茗
Hi,   This is a Simple project for learning Django.

It's a bbs for chinese users.

So, there are some Chinese Words in JS file.


It hosted at bitbucket originally,
Now, I move it to  github:https://github.com/yueyoum/python-gears

-- 
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: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-27 Thread M.-A. Lemburg
Russell Keith-Magee wrote:
> On Wed, Sep 26, 2012 at 8:11 PM, winniehell  wrote:
>> We had a little private discussion about this. Is this list meant to be
>> for product announcements? I personally don't like to get product
>> announcements on mailing lists because I'm in most cases not interested
>> in the offered products.
> 
> We don't prohibit commercial announcements, but they need to be on
> topic, and the poster needs to show some moderation -- we don't mind
> an occasional major announcement, but a weekly point release
> notification would be excessive.

Does Django have an announcement list that we could use for
announcements like these ?

We have comp.lang.python.announce for Python, but I'm not aware of
any such a list for Django.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Sep 27 2012)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2012-10-29: PyCon DE 2012, Leipzig, Germany ...32 days to go
2012-10-23: Python Meeting Duesseldorf ... 26 days to go
2012-09-26: Released mxODBC.Connect 2.0.1 ... http://egenix.com/go34
2012-09-25: Released mxODBC 3.2.1 ... http://egenix.com/go33


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/

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



发生了什么,

2012-09-27 Thread Huahui Zhou
[?]

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

<<332.gif>><>

Re: ANN: eGenix mxODBC Connect - Python Database Interface 2.0.1

2012-09-27 Thread M.-A. Lemburg
Russell Keith-Magee wrote:
> On Thu, Sep 27, 2012 at 3:10 PM, M.-A. Lemburg  wrote:
>> Russell Keith-Magee wrote:
>>> On Wed, Sep 26, 2012 at 8:11 PM, winniehell  wrote:
 We had a little private discussion about this. Is this list meant to be
 for product announcements? I personally don't like to get product
 announcements on mailing lists because I'm in most cases not interested
 in the offered products.
>>>
>>> We don't prohibit commercial announcements, but they need to be on
>>> topic, and the poster needs to show some moderation -- we don't mind
>>> an occasional major announcement, but a weekly point release
>>> notification would be excessive.
>>
>> Does Django have an announcement list that we could use for
>> announcements like these ?
> 
> We have an announcements list, but it's for official Django
> announcements, and we don't want other commercial material on that
> list because when we post to it, we *need* people to pay attention
> (for security updates, and so on).
> 
> As for a 'django community announcements' list: I can see how that
> might be useful, but I can also see that it introduces a whole bunch
> of new headaches. We have enough problems getting people to post to
> the right list when there is only two (django-users and django-dev);
> adding a third has the potential to just confuse things more...

For Python we're using a moderated list and it's been working well
for the past 12 years or so :-)

http://python.org/community/lists/

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Sep 27 2012)
>>> Python/Zope Consulting and Support ...http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/

2012-10-29: PyCon DE 2012, Leipzig, Germany ...32 days to go
2012-10-23: Python Meeting Duesseldorf ... 26 days to go
2012-09-26: Released mxODBC.Connect 2.0.1 ... http://egenix.com/go34
2012-09-25: Released mxODBC 3.2.1 ... http://egenix.com/go33


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
   Registered at Amtsgericht Duesseldorf: HRB 46611
   http://www.egenix.com/company/contact/

-- 
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: IntegrityError at /add/ PRIMARY KEY must be unique

2012-09-27 Thread Amyth Arora
Not quite sure, but it seems like the save() method is being called twice
so it is trying to create insert an entry with a primary key that already
exists.


On Thu, Sep 27, 2012 at 2:23 PM, enemybass  wrote:

>  http://wklej.org/id/837631/ - models, traceback, urls, views, database
> structure
>
>
> After adding data to database I have error (data is added correctly but
> displays an error):
>
>
>
> Exception Type: IntegrityError at /add/Exception Value: PRIMARY KEY must be 
> unique
>
>
> def add(request):
>   if request.user.is_authenticated():
>   user = request.user
>   b = Product.objects.get(id=3)
>   e = b.basket_set.create(name='basket_name', owner=user)
>   e.save(force_insert=True)
>   
>   return render_to_response('basket.html')
>
>
> How to fix it?
>
> --
> 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/-/mdIBvzeje1gJ.
> 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.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @mytharora
http://techstricks.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: Unable to Store Decimal values to DecimalField

2012-09-27 Thread Amyth Arora
What other integer fields are there in your model ?


On Thu, Sep 27, 2012 at 2:35 PM, Sergey Fursov  wrote:

> As I see from the stack, error produced by  book.save() in  File
> "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118 but in you
> code I can't this line of code. Do you really show the code, that related
> to error
>
> 2012/9/27 Laxmikant Gurnalkar 
>
>> Hi ,
>>
>>While storing decimal values to database I have following error.
>>
>> Exception in storeFormatMetadataTraceback (most recent call last):
>>   File "/var/opt/igp_acfs/acfs/bookproducts_manager.py", line 118, in
>> storePricing
>> book.save()
>>   File "/var/opt/igp_acfs/acfs/models.py", line 529, in save
>> super(BookProductFormat, self).save()
>>   File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line
>> 458, in save
>> self.save_base(using=using, force_insert=force_insert,
>> force_update=force_update)
>>   File "/usr/lib/python2.6/site-packages/django/db/models/base.py", line
>> 524, in save_base
>> rows = manager.using(using).filter(pk=pk_val)._update(values)
>>   File "/usr/lib/python2.6/site-packages/django/db/models/query.py", line
>> 502, in _update
>> return query.get_compiler(self.db).execute_sql(None)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line
>> 866, in execute_sql
>> cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line
>> 722, in execute_sql
>> sql, params = self.as_sql()
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line
>> 831, in as_sql
>> val = field.get_db_prep_save(val, connection=self.connection)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
>> line 28, in inner
>> return func(*args, **kwargs)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
>> line 28, in inner
>> return func(*args, **kwargs)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
>> line 28, in inner
>> return func(*args, **kwargs)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
>> line 276, in get_db_prep_save
>> return self.get_db_prep_value(value, connection=connection,
>> prepared=False)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
>> line 53, in inner
>> return func(*args, **kwargs)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
>> line 53, in inner
>> return func(*args, **kwargs)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/subclassing.py",
>> line 53, in inner
>> return func(*args, **kwargs)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
>> line 271, in get_db_prep_value
>> value = self.get_prep_value(value)
>>   File
>> "/usr/lib/python2.6/site-packages/django/db/models/fields/__init__.py",
>> line 876, in get_prep_value
>> return int(value)
>> ValueError: invalid literal for int() with base 10: ''
>>
>>
>> This is my code :
>>
>> obj = Model.objects.get(uid = formatuid)
>> obj.price = Decimal(price).quantize(Decimal('.01'),
>> rounding='ROUND_DOWN')
>> obj.active = 1 if formats.get(format, "")else 0
>> obj.save()
>>
>>
>> This is my mdel Field
>>
>> price = models.DecimalField(max_digits=3, decimal_places=2,
>> blank=True, null=True)
>>
>>
>> I dont think. I'm wrong somewhere. Please HELP
>> Obviously price is my decimal Field.
>>
>>
>> Best Regards,
>> Laxmikant
>>
>> --
>> 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/-/K6k0jAEaxYcJ.
>> 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.
>



-- 
Thanks & Regards


Amyth [Admin - Techstricks]
Email - aroras.offic...@gmail.com, ad...@techstricks.com
Twitter - @mytharora
http://techstricks.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 m

Re: 发生了什么,

2012-09-27 Thread Alexis Roda

Al 27/09/12 10:10, En/na Huahui Zhou ha escrit:




http://stackoverflow.com/questions/6778638/manage-py-runserver-error-errno-10013

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



Regarding Template rendering

2012-09-27 Thread raju akula


I am new to django, iam facing some issue with template ,


i am having tabs,on click of each tab  i need to load the template with the 
help of ajax. this is working fine if i use this script code in same html 
file, 
As per my requirement i have to use the external javascript file to 
maintain all the scripts . so i moved  this whole script to external js 
file then template was not loading I dont have any clue on this. can any 
one guys help me out in this.










$(function () {
$("#abc").click(function () { 
$("#content").load('{% url abcpage_ajax %}');
   
$(this).addClass('active');
$("#def").removeClass('active').addClass('inactive');
$("#fgh").removeClass('active').addClass('inactive');
return false;
});

$("#def").click(function () { 
$("#content").load('{% url cdepage_ajax %}');
   
$("#abc").removeClass('active').addClass('inactive');
$(this).addClass('active');
$("#fgh").removeClass('active').addClass('inactive');
return false;
});
  
$("#fgh").click(function () { 
$("#content").load('{% url create_reports_ajax %}');

$("#abc").removeClass('active').addClass('inactive');
$("#def").removeClass('active').addClass('inactive');
$(this).addClass('active');
return false;
});

 
});
 



 



 

   data
 
button



   





 


-- 
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/-/50tg9dE8QTcJ.
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: Regarding Template rendering

2012-09-27 Thread Joel Goldstick
On Thu, Sep 27, 2012 at 9:53 AM, raju akula  wrote:
>
>
> I am new to django, iam facing some issue with template ,
>
>
> i am having tabs,on click of each tab  i need to load the template with the
> help of ajax. this is working fine if i use this script code in same html
> file,
> As per my requirement i have to use the external javascript file to maintain
> all the scripts . so i moved  this whole script to external js file then
> template was not loading I dont have any clue on this. can any one guys help
> me out in this.
>
>
> 
> 
> 
>
> 
>
> 
>
> $(function () {
> $("#abc").click(function () {
> $("#content").load('{% url abcpage_ajax %}');
>
> $(this).addClass('active');
> $("#def").removeClass('active').addClass('inactive');
> $("#fgh").removeClass('active').addClass('inactive');
> return false;
> });
>
> $("#def").click(function () {
> $("#content").load('{% url cdepage_ajax %}');
>
> $("#abc").removeClass('active').addClass('inactive');
> $(this).addClass('active');
> $("#fgh").removeClass('active').addClass('inactive');
> return false;
> });
>
> $("#fgh").click(function () {
> $("#content").load('{% url create_reports_ajax %}');
>
> $("#abc").removeClass('active').addClass('inactive');
> $("#def").removeClass('active').addClass('inactive');
> $(this).addClass('active');
> return false;
> });
>
>
> });
>
> 
>
>
>  
>
> 
>
>  
>
>data
> 
> button
>
> 
>
>
>
> 
>
> 
>
>
> 
>
You need to put your javascript file in a directory where you put your
static files.  From my settings file:
(this is django 1.4)

STATIC_ROOT = os.path.join(SITE_ROOT, 'static')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/";
STATIC_URL = '/static/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(STATIC_ROOT, 'css'),
os.path.join(STATIC_ROOT, 'js'),
)

In your template you need to specify the static url
-- 
Joel Goldstick

-- 
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: I am in trouble

2012-09-27 Thread Tom Evans
On Wed, Sep 26, 2012 at 1:48 PM, hetwen  wrote:
> hello every,
>When I configure apache,mod_pyton and mod_pywebsocket on
> windows7,some errors occurred,this is a part of my httpd.conf,

If you are still stuck with this, consider asking on a relevant
mailing list. This list is for Django, which is a python library for
creating websites, it is not a list for generic python web activities.

There is a google group specifically for mod_pywebsocket:

http://groups.google.com/group/pywebsocket

Cheers

Tom

-- 
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 Tutorial Equivalent to Ruby on Rails Tutorial by Michael Hartl

2012-09-27 Thread Fred Stluka

How current is this book?  Intro says it may not be.  It seems to be
very well-written, but I don't want to be reading stuff that is too old.
I find more recent reference info, as well as good overviews, guides,
etc. at:
https://docs.djangoproject.com/

--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.


On 9/26/12 4:07 PM, Jonathan Baker wrote:
I haven't worked through the RoR tutorial you referenced, but 
completing http://www.djangobook.com/en/2.0/index.html gave me all of 
the tools necessary to get projects up and running.


hth,
Jonathan D. Baker

On Wed, Sep 26, 2012 at 1:53 PM, Tommy DANGerous 
mailto:quantumventur...@gmail.com>> wrote:


Hello,

I've been through several tutorials and looked around quite a bit
and haven't really found a solid tutorial that goes through
creating a web app in detail that is on par with the Ruby on Rails
Tutorial by Michael Hartl.

Will you please help a noobie like me and describe some tutorials
for Django. Thank you very much in advance.
-- 
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/-/DN0-dhjpKGoJ.
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.




--
Jonathan D. Baker
Developer
http://jonathandbaker.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.


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



Pinterest like UI implementation

2012-09-27 Thread Nirmal Sharma
Hi,

I am creating a website in django where in i am trying to display all the 
comments and pictures like Pinterest.
Can somebody help me on how to implement the same easily in django.

Is there any easy way to implement the Pinterest like UI in django?

Regards
~Nirmal

-- 
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/-/jEN6S-FRdRYJ.
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.



Virtualenvs and editing contrib stuff manually

2012-09-27 Thread Chris Pagnutti
Hi.  First-time poster here.  Feel free to point out any rules I'm not 
following.

I've been looking around for how to make the django.contrib.auth User 
classe's "email" field to be unique and required.  There are bunches of 
ways to do it, but it's just s darn easy to go into the source and 
change how the field is defined.
e.g. email = models.EmailField(_('email address'),unique=True)

But in my searches, I've read warnings that you should not do this.  The 
reason, if it is given, is that you'll break your app if you update the 
contrib packages.  But what if I work in virtualenvs and just leave the 
django version and packages intact for that particular app in that 
particular environment?  What are the other practical and philosophical 
reasons for NOT editing the contrib source?  Will I be smitten from the 
django community if I do so?

Thanks to all.

-- 
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/-/YX9X8u9mdbwJ.
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: Virtualenvs and editing contrib stuff manually

2012-09-27 Thread Babatunde Akinyanmi
No you won't be smitten.

As for isolating your edited django, you can do that but then you
would have to be responsible for improving the code base by yourself.
Also, your edit might inadvertently break django or introduce bugs
that you might find difficult to trace and solve or that might change
some of the logic required to make django work.

On 9/27/12, Chris Pagnutti  wrote:
> Hi.  First-time poster here.  Feel free to point out any rules I'm not
> following.
>
> I've been looking around for how to make the django.contrib.auth User
> classe's "email" field to be unique and required.  There are bunches of
> ways to do it, but it's just s darn easy to go into the source and
> change how the field is defined.
> e.g. email = models.EmailField(_('email address'),unique=True)
>
> But in my searches, I've read warnings that you should not do this.  The
> reason, if it is given, is that you'll break your app if you update the
> contrib packages.  But what if I work in virtualenvs and just leave the
> django version and packages intact for that particular app in that
> particular environment?  What are the other practical and philosophical
> reasons for NOT editing the contrib source?  Will I be smitten from the
> django community if I do so?
>
> Thanks to all.
>
> --
> 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/-/YX9X8u9mdbwJ.
> 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.
>
>

-- 
Sent from my mobile device

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



Invitation to use Google Talk

2012-09-27 Thread Google Talk
---

You've been invited by Robert Kvaal to use Google Talk.

If you already have a Google account, login to Gmail and accept this chat
invitation:
http://mail.google.com/mail/b-90f4d8d70d-e60ea03784-aKi-Kg_vzoaDZXyru790CzdHuAY

To sign up for a Google account and get started with Google Talk, you can
visit:
http://mail.google.com/mail/a-90f4d8d70d-e60ea03784-aKi-Kg_vzoaDZXyru790CzdHuAY?pc=en-rf---a

Learn more at:
http://www.google.com/intl/en/landing/accounts/


Thanks,
The Google Team

-- 
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: Geodjango Tutorial: SRID problem when loading data from shapefile to PostGIS table

2012-09-27 Thread David Gomez
I'm having the same issue. I see that you say that you change the postgress 
manually. Can you tell me where can I find that file. I'm new with django. 
Thanks

On Monday, October 17, 2011 5:06:39 PM UTC-4, Pauline Emery wrote:
>
> Dear all,
>
> I'm having a problem doing the section "LayerMapping" of the GeoDjango
> official Tutorial [1].
>
> After creating load.py in the world directory. Leaving as specified:
> "the transform keyword set to False because the data in the shapefile
> does not need to be converted -- it's already in WGS84 (SRID=4326)"
>
> I execute as indicate the following commands:
>
> $ python manage.py shell
> >>> from world import load
> >>> load.run()
>
> And obtain the following error:
>
> Failed to save the feature (id: 0) into the model with the keyword 
> arguments:
> {'iso2': u'AG', 'pop2005': 83039, 'area': 44, 'region': 19, 'lon':
> -61.7830001, 'iso3': u'ATG', 'subregion': 29, 'fips': u'AC',
> 'lat': 17.077, 'un': 28, 'mpoly': 'MULTIPOLYGON
> (((-61.72917199949 17.6086084,-61.73111699983
> 17.5472220009,-61.7327791 17.54,-61.73889199964
> 17.540554001,-61.75194499921
> ...
> 17.64472200115,-61.73167399941
> 17.62499600067,-61.72917199949 17.6086084)))', 'name':
> u'Antigua and Barbuda'}
> [... stack trace]
> IntegrityError: new row for relation "world_worldborder" violates
> check constraint "enforce_srid_mpoly"
>
> Postgres enforcing the check constraint for SRID=4326. I don't know to
> say to Django to insert explicitely the SRID into the MULTIPOLYGON
> command. Inserting the line by hand on Postgres work fine using
> ST_Geomfromtext( 'MULTIPOLYGON(((...) (...)),4326).
>
>
> The same problem occurs with other tutorials:
> GeoDjango Database API  with the Zipcode model [2]
> GeographicAdminQuickStart [3]
>
> I'm working with Python 2.6 / Django 1.3 with GeoDjango  / GDAL 1.7.2
> / PostgreSQL 8.4.8 / PostGIS 1.5 / Pyscopg2 2.4
>
> Thank you for your time and your help,
>
> Pauline Emery
>
> [1] https://docs.djangoproject.com/en/dev/ref/contrib/gis/tutorial/
> [2] https://docs.djangoproject.com/en/1.3/ref/contrib/gis/model-api/
> [3] 
> http://code.google.com/p/geodjango-basic-apps/wiki/GeographicAdminQuickStart
>
>

-- 
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/-/9UeDS5pVbeUJ.
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: Invitation to use Google Talk

2012-09-27 Thread Rivsen
What's this?

2012/9/28 Google Talk 

> ---
>
> You've been invited by Robert Kvaal to use Google Talk.
>
> If you already have a Google account, login to Gmail and accept this chat
> invitation:
>
> http://mail.google.com/mail/b-90f4d8d70d-e60ea03784-aKi-Kg_vzoaDZXyru790CzdHuAY
>
> To sign up for a Google account and get started with Google Talk, you can
> visit:
>
> http://mail.google.com/mail/a-90f4d8d70d-e60ea03784-aKi-Kg_vzoaDZXyru790CzdHuAY?pc=en-rf---a
>
> Learn more at:
> http://www.google.com/intl/en/landing/accounts/
>
>
> Thanks,
> The Google Team
>
> --
> 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.



conditional model validation

2012-09-27 Thread Lachlan Musicman
Hola,

I'm searching without much luck and can't see the answer in the docs.

Am wanting to override the is_valid() method on a model (I think
that's what I want).

Basically, I have a choices field, and if one of those choices is
selected, then I want a description field to be not blank/not the
empty string. If it's the other two choices, I want the description
field to be blank/empty string.

First, I override is_valid() as a model method?

Second, how do I return a false from is_valid()?

ie, this is a rough up of what I'm looking for - what goes in place of
return FALSE/TRUE?

def is_valid(self):

if enrolment.mark == 'W': #student has withdrawn from course
-if enrolment.withdrawal_reason == '': #must have reason
--return FALSE
elif enrolment.withdrawal.reason != "": #ie, since enrolment.mark
isn't 'W', confirm that the enrolment.reason is ""
-return FALSE
else:
-return TRUE

Cheers
L.
-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: IntegrityError at /add/ PRIMARY KEY must be unique

2012-09-27 Thread akaariai
.create() creates the object into DB, then .save(force_insert=True)
tries to insert the same object with the same ID again -> integrity
error. Seems like you don't need the second save at all.

 - Anssi

On 27 syys, 15:39, Amyth Arora  wrote:
> Not quite sure, but it seems like the save() method is being called twice
> so it is trying to create insert an entry with a primary key that already
> exists.
>
>
>
>
>
>
>
>
>
> On Thu, Sep 27, 2012 at 2:23 PM, enemybass  wrote:
> >  http://wklej.org/id/837631/- models, traceback, urls, views, database
> > structure
>
> > After adding data to database I have error (data is added correctly but
> > displays an error):
>
> > Exception Type: IntegrityError at /add/Exception Value: PRIMARY KEY must be 
> > unique
>
> > def add(request):
> >    if request.user.is_authenticated():
> >            user = request.user
> >                    b = Product.objects.get(id=3)
> >                    e = b.basket_set.create(name='basket_name', owner=user)
> >            e.save(force_insert=True)
>
> >    return render_to_response('basket.html')
>
> > How to fix it?
>
> > --
> > 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/-/mdIBvzeje1gJ.
> > 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.
>
> --
> Thanks & Regards
> 
>
> Amyth [Admin - Techstricks]
> Email - aroras.offic...@gmail.com, ad...@techstricks.com
> Twitter - @mytharorahttp://techstricks.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: Invitation to use Google Talk

2012-09-27 Thread Gerald Klein
I have no idea

On Thu, Sep 27, 2012 at 6:22 PM, Rivsen  wrote:

> What's this?
>
> 2012/9/28 Google Talk 
>
>> ---
>>
>> You've been invited by Robert Kvaal to use Google Talk.
>>
>> If you already have a Google account, login to Gmail and accept this chat
>> invitation:
>>
>> http://mail.google.com/mail/b-90f4d8d70d-e60ea03784-aKi-Kg_vzoaDZXyru790CzdHuAY
>>
>> To sign up for a Google account and get started with Google Talk, you can
>> visit:
>>
>> http://mail.google.com/mail/a-90f4d8d70d-e60ea03784-aKi-Kg_vzoaDZXyru790CzdHuAY?pc=en-rf---a
>>
>> Learn more at:
>> http://www.google.com/intl/en/landing/accounts/
>>
>>
>> Thanks,
>> The Google Team
>>
>> --
>> 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.
>



-- 

Gerald Klein DBA

contac...@geraldklein.com

www.geraldklein.com 

geraldklein.wordpress.com

j...@zognet.com

708-599-0352


Arch Awesome, Ranger & Vim the coding triple threat.

Linux registered user #548580

-- 
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: Virtualenvs and editing contrib stuff manually

2012-09-27 Thread Russell Keith-Magee
On Fri, Sep 28, 2012 at 2:02 AM, Chris Pagnutti
 wrote:
> Hi.  First-time poster here.  Feel free to point out any rules I'm not
> following.
>
> I've been looking around for how to make the django.contrib.auth User
> classe's "email" field to be unique and required.  There are bunches of ways
> to do it, but it's just s darn easy to go into the source and change how
> the field is defined.
> e.g. email = models.EmailField(_('email address'),unique=True)
>
> But in my searches, I've read warnings that you should not do this.  The
> reason, if it is given, is that you'll break your app if you update the
> contrib packages.  But what if I work in virtualenvs and just leave the
> django version and packages intact for that particular app in that
> particular environment?  What are the other practical and philosophical
> reasons for NOT editing the contrib source?  Will I be smitten from the
> django community if I do so?

Will this approach work? Yes. Ish. :-)

All you're really proposing is a fork of Django. That approach can
certainly work; the downside is that you have to maintain the fork by
yourself.

The good news - as of 2 days ago, Django's trunk has a way for you to
change the User model in an official manner [1]. These changes will be
in Django 1.5, due for release at the end of the year.

If you need a solution *right now*, there was a thread on django-users
a couple of days ago that discussed almost exactly this problem; a
couple of alternate approaches were suggested [2].

[1] 
https://docs.djangoproject.com/en/dev/topics/auth/#customizing-the-user-model
[2] https://groups.google.com/d/topic/django-users/bPCCAK8x8ig/discussion

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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.



Google Talk 使用邀请

2012-09-27 Thread Google Talk
---

Rivsen邀请您使用 Google Talk。

如果您已经拥有 Google 帐户,请登录 Gmail 并接受此聊天邀请:
http://mail.google.com/mail/b-83386e39b8-0ec258bcf0-y0Clo0X-tRU1nzWTVIlkF9WhyM4

要注册 Google 帐户并开始使用 Google Talk,您可以访问:
http://mail.google.com/mail/a-83386e39b8-0ec258bcf0-y0Clo0X-tRU1nzWTVIlkF9WhyM4?pc=zh_cn-rf---a

要了解详情,请访问:
http://www.google.com/intl/zh-CN/landing/accounts/


此致,
Google 小组敬上

-- 
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: Invitation to use Google Talk

2012-09-27 Thread Russell Keith-Magee
On Fri, Sep 28, 2012 at 9:55 AM, Dennis Lee Bieber
 wrote:
> On Fri, 28 Sep 2012 07:22:56 +0800, Rivsen 
> declaimed the following in gmane.comp.python.django.user:
>
>> What's this?
>>
>> 2012/9/28 Google Talk 
>>
>
> Probably Google's next attempt to corrupt the "Groups" system...

More likely - someone has Django-users in their address book, and
accidentally hit the "Invite this person to Google Talk" from within
GMail. Simiar things happen from time to time when someone decides to
import their address book into  and sends
an invitation to everyone. Accidents happen; no need to make a big
deal about it.

Yours,
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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 list display fields from two models

2012-09-27 Thread keeran


What am doing wrong in below admin & model.py; I expect the list display 
will display values of all three column values from list_display, but it 
doesnt; Particularly, the values of item_status & solution note not getting 
shown in my admin view;
Admin.py: 

class ItemAdmin(admin.ModelAdmin):
def item_status(self,instance):
comment1 = instance.comment_set.all()
return comment1.get_status_display()
def solution_note(self,instance):
comment1 = instance.comment_set.all()
return comment1.body()

list_display = ('title', 'item_status', 'solution_note')

admin.site.register(Item,ItemAdmin)

Model.py

STATUS_CHOICES = (
  (1, 'New'),
  (2, 'In-progress'),
  (3, 'Closed'),
)


class Item(models.Model):
title = models.CharField(max_length=150)


def __unicode__(self):
return self.title



class Comment(models.Model):
body = models.TextField(blank=True)
status = models.PositiveIntegerField(choices=STATUS_CHOICES,default=1)
task = models.ForeignKey(Item)

def __unicode__(self):
return self.body

# Auto-set the item creation / completed date
def save(self):
print self.status
#If Item is being marked closed, set the completed_date
if (self.status == 3):
 self.date = datetime.datetime.now()
super(Comment, self).save()

`

=== when I tried return comment1[0].get_status_display() --> 
values on the admin view page are shown but when I try to add new item, it 
gives me index error pointing to comment1[0] & changelist_view.html 
template issue

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



'DatabaseOperations' object has no attribute 'geo_db_type' error when doing a syncdb

2012-09-27 Thread Gady Pitaru
When I deploy a GeoDjango app to Heroku I'm getting the following error: 
*AttributeError: 
'DatabaseOperations' object has no attribute 'geo_db_type'*

I've tried quite a few things to fix it and lots of research, but still 
can't get rid of it. Instead of duplicating my StackOverflow question, you 
can see more details 
here
.

Any help is much appreciated.

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



Sessionid in plain text Django 1.2 error emails

2012-09-27 Thread Bjorn Tipling
Hi, 

Is there any simple way of taking the sessionid out of the django error 
emails that get sent in plain text when there's a 500? We're using django 
1.2.

Thanks,

Bjorn

-- 
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/-/Dp_w-tCFJ5UJ.
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.



last changed by User

2012-09-27 Thread Lachlan Musicman
Hola,

I wanted to display the user that last changed a model instance.

It's hard to search for because the username/email-as-login makes up the
majority of the search results.

Despite this, I've found a couple of pages, with this being the most like
what I want:

https://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser

I like this solution - simple and clean, easy to implement.

My only reservation is that I was under the impression that this
information was already being kept and that putting a

user = ForeignKey("User")

in each model that I want to track is doubling up on the data I'm keeping?

Cheers
L.


-- 
...we look at the present day through a rear-view mirror. This is something
Marshall McLuhan said back in the Sixties, when the world was in the grip
of authentic-seeming future narratives. He said, “We look at the present
through a rear-view mirror. We march backwards into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: last changed by User

2012-09-27 Thread Lachlan Musicman
On Friday, September 28, 2012, Lachlan Musicman wrote:

>
> I wanted to display the user that last changed a model instance.
>
> Despite this, I've found a couple of pages, with this being the most like
> what I want:
>
> https://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser
>
> I like this solution - simple and clean, easy to implement.
>
> My only reservation is that I was under the impression that this
> information was already being kept and that putting a
>
> user = ForeignKey("User")
>
> in each model that I want to track is doubling up on the data I'm keeping?
>

To clarify - I can see the last ten actions I've taken when I'm logged into
the admin interface - is this info permanent and easy to access and display
on the model DetailView?

cheers
L.


-- 
...we look at the present day through a rear-view mirror. This is something
Marshall McLuhan said back in the Sixties, when the world was in the grip
of authentic-seeming future narratives. He said, “We look at the present
through a rear-view mirror. We march backwards into the future.”

http://www.warrenellis.com/?p=14314

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



i am getting ConfigParser.NoSectionError: No section: 'database' plz help

2012-09-27 Thread Navnath Gadakh
ConfigParser.NoSectionError: No section: 'database'

-- 
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/-/0uRjwXdd_jIJ.
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: i am getting ConfigParser.NoSectionError: No section: 'database' plz help

2012-09-27 Thread Lachlan Musicman
On Fri, Sep 28, 2012 at 4:05 PM, Navnath Gadakh  wrote:
> ConfigParser.NoSectionError: No section: 'database'

Off the top of my head, I would suggest you have nothing in the
section DATABASES in your settings.py

Does your settings.py have something that looks like:

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.DBNAME',
'NAME': 'xe',
'USER': 'a_user',
'PASSWORD': 'a_password',
'HOST': '',
'PORT': '',
}
}

-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: last changed by User

2012-09-27 Thread Greg Donald
On Thu, Sep 27, 2012 at 10:28 PM, Lachlan Musicman  wrote:
> I wanted to display the user that last changed a model instance.

I use django-reversion for this:

https://github.com/etianen/django-reversion


-- 
Greg Donald

-- 
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: i am getting ConfigParser.NoSectionError: No section: 'database' plz help

2012-09-27 Thread Navnath Gadakh
my setting.py is
 and a have also created a new setting.conf .may be there is problem of 
path,plz  help. thnks in adv
# Django settings for kasakooproj project.

import os
import ast

from ConfigParser import RawConfigParser

config = RawConfigParser()
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
config.read(os.path.join(PROJECT_PATH, 'settings.conf'))

DEBUG = True
TEMPLATE_DEBUG = DEBUG



MANAGERS = ADMINS

DATABASES = {
'default': {
'ENGINE'  : config.get('database','engine'),
'NAME': config.get('database','name'),
'USER': config.get('database','user'),
'PASSWORD': config.get('database','password'),
'HOST': config.get('database','host'),
'PORT': config.get('database','port'), }
}

# Local time zone for this installation. Choices can be found here:
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
# although not all choices may be available on all operating systems.
# On Unix systems, a value of None will cause Django to use the same
# timezone as the operating system.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'America/Chicago'

# Language code for this installation. All choices can be found here:
# http://www.i18nguy.com/unicode/language-identifiers.html
LANGUAGE_CODE = 'en-us'

SITE_ID = 1

# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True

# If you set this to False, Django will not format dates, numbers and
# calendars according to the current locale
USE_L10N = True

# Absolute filesystem path to the directory that will hold user-uploaded 
files.
# Example: "/home/media/media.lawrence.com/media/"
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'media')

# URL that handles the media served from MEDIA_ROOT. Make sure to use a
# trailing slash.
# Examples: "http://media.lawrence.com/media/";, "http://example.com/media/";
MEDIA_URL = config.get('media_url', 'value')

# Absolute path to the directory static files should be collected to.
# Don't put anything in this directory yourself; store your static files
# in apps' "static/" subdirectories and in STATICFILES_DIRS.
# Example: "/home/media/media.lawrence.com/static/"
STATIC_ROOT = os.path.join(PROJECT_PATH, 'static')

# URL prefix for static files.
# Example: "http://media.lawrence.com/static/";
STATIC_URL = config.get('static_url', 'value')

# URL prefix for admin static files -- CSS, JavaScript and images.
# Make sure to use a trailing slash.
# Examples: "http://foo.com/static/admin/";, "/static/admin/".
ADMIN_MEDIA_PREFIX = '/static/admin/'

# Additional locations of static files
STATICFILES_DIRS = (
# Put strings here, like "/home/html/static" or "C:/www/django/static".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
)

# List of finder classes that know how to find static files in
# various locations.
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#'django.contrib.staticfiles.finders.DefaultStorageFinder',
)

# Make this unique, and don't share it with anybody.
SECRET_KEY = ''

# List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.Loader',
'django.template.loaders.app_directories.Loader',
# 'django.template.loaders.eggs.Loader',
)

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
)

ROOT_URLCONF = 'urls'

WSGI_APPLICATION = 'wsgi.application'

TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or 
"C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
os.path.join(PROJECT_PATH, 'templates'),

)

INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
# Uncomment the next line to enable the admin:
'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
'django.contrib.admindocs',
'south',
'Bids',
'BingoUsers',
'CricketGame',
'generator',
'QuestionBase',
'admin',
'Notification',
'Merchant',
'Deal',
)

# A sample logging configuration. The only tangible logging
# performed by this configuration is to send an email to
# the site admins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customiz

Re: i am getting ConfigParser.NoSectionError: No section: 'database' plz help

2012-09-27 Thread Lachlan Musicman
On Fri, Sep 28, 2012 at 4:15 PM, Lachlan Musicman  wrote:
> On Fri, Sep 28, 2012 at 4:05 PM, Navnath Gadakh  
> wrote:
>> ConfigParser.NoSectionError: No section: 'database'

Although a quick google of the phrase is showing up lots of
mysql-python hits - is python-mysqldb (for ubuntu, YMMV) installed
correctly on your system?

Cheers
L.

-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: i am getting ConfigParser.NoSectionError: No section: 'database' plz help

2012-09-27 Thread Navnath Gadakh
yes mysql db is installed on my ubuntu

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



filter() and lists with DateTime field not implemented?

2012-09-27 Thread Robert Steckroth
Hello Gang, I have the function below which returns this error ->
"FieldError at /by_date/
Join on field 'first_day_start_time' not permitted. Did you misspell
'month' for the lookup type?"

The function will work in other objects (even with model
relationships), but not when the __month filter is used.
Has anyone got a work-around for this?

if s_form.is_valid():
  if s_form.cleaned_data['start_date']:
s_date_month = request.POST.getlist('start_date_month')
s_date_year = request.POST.getlist('start_date_year')
expo_obj =
expo_obj.filter(first_day_start_time__month__in=s_date_month )



-- 
Bust0ut, Surgemcgee: Systems Engineer ---
surgemcgee.com
BudTVNetwork.com
RadioWeedShow.com
"Bringing entertainment to Unix"

-- 
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: last changed by User

2012-09-27 Thread Laxmikant Gurnalkar
Hello.
   You can Hack the *Default models* & add new fields in User Table
created_datetime, modified_datetime & created by, modified by etc.


Cheers

On Fri, Sep 28, 2012 at 9:03 AM, Lachlan Musicman  wrote:

> On Friday, September 28, 2012, Lachlan Musicman wrote:
>
>>
>> I wanted to display the user that last changed a model instance.
>>
>> Despite this, I've found a couple of pages, with this being the most like
>> what I want:
>>
>> https://code.djangoproject.com/wiki/CookBookNewformsAdminAndUser
>>
>> I like this solution - simple and clean, easy to implement.
>>
>> My only reservation is that I was under the impression that this
>> information was already being kept and that putting a
>>
>> user = ForeignKey("User")
>>
>> in each model that I want to track is doubling up on the data I'm keeping?
>>
>
> To clarify - I can see the last ten actions I've taken when I'm logged
> into the admin interface - is this info permanent and easy to access and
> display on the model DetailView?
>
> cheers
> L.
>
>
> --
> ...we look at the present day through a rear-view mirror. This is
> something Marshall McLuhan said back in the Sixties, when the world was in
> the grip of authentic-seeming future narratives. He said, “We look at the
> present through a rear-view mirror. We march backwards into the future.”
>
> http://www.warrenellis.com/?p=14314
>
> --
> 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.
>



-- 
*

 GlxGuru

*

-- 
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: last changed by User

2012-09-27 Thread Mike Dewhirst

On 28/09/2012 2:16pm, Greg Donald wrote:

On Thu, Sep 27, 2012 at 10:28 PM, Lachlan Musicman  wrote:

I wanted to display the user that last changed a model instance.


I use django-reversion for this:

https://github.com/etianen/django-reversion




See also Pro Django by Marty Allchin and 
https://bitbucket.org/q/django-current-user/src


Mike

--
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 Tutorial Equivalent to Ruby on Rails Tutorial by Michael Hartl

2012-09-27 Thread hrishy
Hi

No there is no exact equivalent of Micheal Hartl's RoR for python.
However this may get you STARTED
http://www.youtube.com/watch?v=hp5ymCrD9yw
http://www.youtube.com/watch?v=lj01NigwU7Q





 From: Fred Stluka 
To: django-users@googlegroups.com 
Sent: Thursday, 27 September 2012, 21:44
Subject: Re: Django Tutorial Equivalent to Ruby on Rails Tutorial by Michael 
Hartl
 

How current is this book?  Intro says it may not be.  It seems to be
very well-written, but I don't want to be reading stuff that is too
old.
I find more recent reference info, as well as good overviews,
guides, 
etc. at:
    https://docs.djangoproject.com/


--Fred 

 Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ 
Bristle Software, Inc -- http://bristle.com -- Glad to be of service! 
Open Source: Without walls and fences, we need no Windows or
  Gates. 

 
On 9/26/12 4:07 PM, Jonathan Baker wrote: 
I haven't worked through the RoR tutorial you referenced, but 
completing http://www.djangobook.com/en/2.0/index.html gave me all of the tools 
necessary to get projects up and running. 
>
>
>hth,
>Jonathan D. Baker
>
>
>On Wed, Sep 26, 2012 at 1:53 PM, Tommy DANGerous  
>wrote:
>
>Hello, 
>>
>>
>>I've been through several tutorials and looked around quite a bit and haven't 
>>really found a solid tutorial that goes through creating a web app in detail 
>>that is on par with the Ruby on Rails Tutorial by Michael Hartl. 
>>
>>
>>Will you please help a noobie like me and describe some tutorials for Django. 
>>Thank you very much in advance.-- 
>>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/-/DN0-dhjpKGoJ.
>>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.
>>
>
>
>
>
-- 
>Jonathan D. Baker
>Developer
>http://jonathandbaker.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.
>
-- 
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 Tutorial Equivalent to Ruby on Rails Tutorial by Michael Hartl

2012-09-27 Thread hrishy
And some advanced
http://www.youtube.com/watch?v=t_ziKY1ayCo&feature=related





 From: hrishy 
To: "django-users@googlegroups.com"  
Sent: Friday, 28 September 2012, 10:36
Subject: Re: Django Tutorial Equivalent to Ruby on Rails Tutorial by Michael 
Hartl
 

Hi

No there is no exact equivalent of Micheal Hartl's RoR for python.
However this may get you STARTED
http://www.youtube.com/watch?v=hp5ymCrD9yw
http://www.youtube.com/watch?v=lj01NigwU7Q





 From: Fred Stluka 
To: django-users@googlegroups.com 
Sent: Thursday, 27 September 2012, 21:44
Subject: Re: Django Tutorial Equivalent to Ruby on Rails Tutorial by Michael 
Hartl
 

How current is this book?  Intro says it may not be.  It seems to be
very well-written, but I don't want to be reading stuff that is too
old.
I find more recent reference info, as well as good overviews,
guides, 
etc. at:
    https://docs.djangoproject.com/


--Fred 

 Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/ 
Bristle Software, Inc -- http://bristle.com -- Glad to be of service! 
Open Source: Without walls and fences, we need no Windows or
  Gates. 

 
On 9/26/12 4:07 PM, Jonathan Baker wrote: 
I haven't worked through the RoR tutorial you referenced, but 
completing http://www.djangobook.com/en/2.0/index.html gave me all of the tools 
necessary to get projects up and running. 
>
>
>hth,
>Jonathan D. Baker
>
>
>On Wed, Sep 26, 2012 at 1:53 PM, Tommy DANGerous  
>wrote:
>
>Hello, 
>>
>>
>>I've been through several tutorials and looked around quite a bit and haven't 
>>really found a solid tutorial that goes through creating a web app in detail 
>>that is on par with the Ruby on Rails Tutorial by Michael Hartl. 
>>
>>
>>Will you please help a noobie like me and describe some tutorials for Django. 
>>Thank you very much in advance.-- 
>>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/-/DN0-dhjpKGoJ.
>>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.
>>
>
>
>
>
-- 
>Jonathan D. Baker
>Developer
>http://jonathandbaker.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.
>
-- 
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 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: last changed by User

2012-09-27 Thread Mike Dewhirst

On 28/09/2012 3:01pm, Mike Dewhirst wrote:

On 28/09/2012 2:16pm, Greg Donald wrote:

On Thu, Sep 27, 2012 at 10:28 PM, Lachlan Musicman 
wrote:

I wanted to display the user that last changed a model instance.


I use django-reversion for this:

https://github.com/etianen/django-reversion




See also Pro Django by Marty Allchin and


My apologies - Alchin with one 'l'


https://bitbucket.org/q/django-current-user/src

Mike



--
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: conditional model validation

2012-09-27 Thread Babatunde Akinyanmi
Let me try to assist. A forms is_valid method causes 3 types of
cleaning methods to be run. Based on that, I'm sure you really don't
need to override it.

I really don't understand what you mean by "I want the description
field to be not blank/not the empty string" so maybe I could have been
of more help but I'm sure a solution to your problem would be to
override either the form's clean_fieldname or clean methods.

Check: https://docs.djangoproject.com/en/dev/ref/forms/validation/
which is a link to the documentation on form validation

On 9/28/12, Lachlan Musicman  wrote:
> Hola,
>
> I'm searching without much luck and can't see the answer in the docs.
>
> Am wanting to override the is_valid() method on a model (I think
> that's what I want).
>
> Basically, I have a choices field, and if one of those choices is
> selected, then I want a description field to be not blank/not the
> empty string. If it's the other two choices, I want the description
> field to be blank/empty string.
>
> First, I override is_valid() as a model method?
>
> Second, how do I return a false from is_valid()?
>
> ie, this is a rough up of what I'm looking for - what goes in place of
> return FALSE/TRUE?
>
> def is_valid(self):
>
> if enrolment.mark == 'W': #student has withdrawn from course
> -if enrolment.withdrawal_reason == '': #must have reason
> --return FALSE
> elif enrolment.withdrawal.reason != "": #ie, since enrolment.mark
> isn't 'W', confirm that the enrolment.reason is ""
> -return FALSE
> else:
> -return TRUE
>
> Cheers
> L.
> --
> ...we look at the present day through a rear-view mirror. This is
> something Marshall McLuhan said back in the Sixties, when the world
> was in the grip of authentic-seeming future narratives. He said, “We
> look at the present through a rear-view mirror. We march backwards
> into the future.”
>
> http://www.warrenellis.com/?p=14314
>
> --
> 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.
>
>

-- 
Sent from my mobile device

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