How to access Django data with the field name in text?

2016-11-14 Thread rmschne
I have a extracted all the field names from a Django model into a list 
called "fields", e.g.

fields = [(f.name, f.verbose_name) for f in 
Meetingattendee._meta.get_fields()]

I ask the user to select a record, e.g.

att=Meetingattendee.objects.get(id=attid) 

where "attid" is the ID of the record (input by the user)

I now will ask user to input the name of the field of interest, e.g. 
"fname" which is one of the fields and holds "first name",  I then want to 
enable viewing/changing the selected field, e.g. in code to work with the 
first name field, it would be simply att.fname, but in this case the name 
of the field a string (input from user).  How to convert the input string 
name "fname" into something that in code would recognise that the user 
wants to work with att.fname?

(hoping this question is clear!)

--rms



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/df713caf-24f3-4309-b270-0b58e12c75cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to access Django data with the field name in text?

2016-11-14 Thread Vijay Khemlani
If I understood it correctly, you might want to do it like this

setattr(att, "fname", "value_to_be_set")

and to get the value

first_name = getattr(att, "fname")

On Mon, Nov 14, 2016 at 8:38 AM, rmschne  wrote:

> I have a extracted all the field names from a Django model into a list
> called "fields", e.g.
>
> fields = [(f.name, f.verbose_name) for f in Meetingattendee._meta.get_
> fields()]
>
> I ask the user to select a record, e.g.
>
> att=Meetingattendee.objects.get(id=attid)
>
> where "attid" is the ID of the record (input by the user)
>
> I now will ask user to input the name of the field of interest, e.g.
> "fname" which is one of the fields and holds "first name",  I then want to
> enable viewing/changing the selected field, e.g. in code to work with the
> first name field, it would be simply att.fname, but in this case the name
> of the field a string (input from user).  How to convert the input string
> name "fname" into something that in code would recognise that the user
> wants to work with att.fname?
>
> (hoping this question is clear!)
>
> --rms
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-users/df713caf-24f3-4309-b270-0b58e12c75cc%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALn3ei2Lv5D-R_ih2eWu3TeGXLV2cXiSX1N%2Bcr21Zray7P_VJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Modify Django Community Blog RSS feed url

2016-11-14 Thread Dávid Főző
Hello fellow Djangonauts,

I submitted rss feed of my website as a Django Blog. Now, I would like to 
modify it to make sure only selected articles will be submitted.

If you have authority in this, I would like to change this:

https://www.davidfozo.com/blog/feeds/rss/
to this:
https://www.davidfozo.com/blog/category/django/feeds/rss/

Thanks a lot,

David


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/ff740973-1ccd-49db-8dab-ce7a17b9ea9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: How to access Django data with the field name in text?

2016-11-14 Thread rmschne
yep, that did it. It was getattr() and setattr() I was unaware of (or 
forgot!).  

I made my code a bit more generic (and I know I have not put in much error 
correction or exception detection, but will do so).  Thank you.  See code 
here:

fields = [(f.name, f.verbose_name) for f in 
Meetingattendee._meta.get_fields()]
s=''
for i in fields:
s=s+i[0]+", "
fieldtochange=raw_input("Enter field to change:\n"+s+": ")
print "Current Value of Field to 
Change:",fieldtochange,"is:",getattr(att, fieldtochange)
newvalue=raw_input("Enter New Value: ")
if not newvalue:
return None
setattr(att, fieldtochange, newvalue)
att.save()
print "Saved:",att


On Monday, 14 November 2016 11:58:06 UTC, Vijay Khemlani wrote:
>
> If I understood it correctly, you might want to do it like this
>
> setattr(att, "fname", "value_to_be_set")
>
> and to get the value
>
> first_name = getattr(att, "fname")
>
> On Mon, Nov 14, 2016 at 8:38 AM, rmschne > 
> wrote:
>
>> I have a extracted all the field names from a Django model into a list 
>> called "fields", e.g.
>>
>> fields = [(f.name, f.verbose_name) for f in 
>> Meetingattendee._meta.get_fields()]
>>
>> I ask the user to select a record, e.g.
>>
>> att=Meetingattendee.objects.get(id=attid) 
>>
>> where "attid" is the ID of the record (input by the user)
>>
>> I now will ask user to input the name of the field of interest, e.g. 
>> "fname" which is one of the fields and holds "first name",  I then want to 
>> enable viewing/changing the selected field, e.g. in code to work with the 
>> first name field, it would be simply att.fname, but in this case the name 
>> of the field a string (input from user).  How to convert the input string 
>> name "fname" into something that in code would recognise that the user 
>> wants to work with att.fname?
>>
>> (hoping this question is clear!)
>>
>> --rms
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to django-users...@googlegroups.com .
>> To post to this group, send email to django...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/df713caf-24f3-4309-b270-0b58e12c75cc%40googlegroups.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d8a0431b-cc03-44c4-adc9-e3f35063d7e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Running daphne in production - Mac OS X Server 10.11

2016-11-14 Thread Adam Teale
Unfortunately I haven't had any luck with it.

I have the mod_proxy and mod_proxy_wstunnel Apache modules loaded and I the 
following proxies inside the virtual host for port 443 (SSL)

ProxyPass /chat/stream/ wss://127.0.0.1:8000/chat/stream/
ProxyPassReverse /chat/stream/ wss://127.0.0.1:8000/chat/stream/

ProxyPass /ws  ws://127.0.0.1:8000/
ProxyPassReverse /ws wss://127.0.0.1:8000/
ProxyPass /wss wss://127.0.0.1:8000/
ProxyPassReverse /wss wss://127.0.0.1:8000/


ProxyPass / http://127.0.0.1:8000/
ProxyPassReverse / http://127.0.0.1:8000/


If anyone can shed some light on this or offer an opinion I'd really 
appreciate it.

Cheers

Adam

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/49d63ad3-41d8-4130-a78c-8f0f215992e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Modify Django Community Blog RSS feed url

2016-11-14 Thread Tim Graham
Done.

On Monday, November 14, 2016 at 7:03:43 AM UTC-5, Dávid Főző wrote:
>
> Hello fellow Djangonauts,
>
> I submitted rss feed of my website as a Django Blog. Now, I would like to 
> modify it to make sure only selected articles will be submitted.
>
> If you have authority in this, I would like to change this:
>
> https://www.davidfozo.com/blog/feeds/rss/
> to this:
> https://www.davidfozo.com/blog/category/django/feeds/rss/
>
> Thanks a lot,
>
> David
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35e171dc-6bfd-4f16-902c-76ebbcee5387%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


django.db.utils.OperationalError: near ")": syntax error ERROR at $ python3 manage.py migrate

2016-11-14 Thread Peter Sels
Dear Django-ers,

I ran into a problem with Django.

--
Situation:
--

I am using version 1.10.3 of Django.

For the fifth time I updated my table related classes in models.py.
The 4 previous time this ran well all through

(1) The server ran and did not complain about syntax errors or anything 
else.
and
(2) $ python3 manage.py makemigrations

but in

(3) $ python3 manage.py migrate
I get the problem mentioned below when running 

The log of (2) and (3) is given below.

--
Questions:
--
Any tips on how to solve it?

How can I relate this to my own code in models.py?

Do I really need to revert back to my previously (checked in) version of 
models.py?
And then do small incremental steps again?
Or is there a better way?
(Unluckily I cannot share the models.py file.)

thanks and best regards,

Peter



(2)

*$ python3 manage.py makemigrations*

*Migrations for 'market':*

  *market/migrations/0006_auto_20161114_1741.py*:

- Alter field code on bidstate

- Alter field code on coordinationschemevariant

- Alter field code on networktype

- Alter field code on segmenttype

Herettix:SmartNet peter$ 



(3)

*Herettix:SmartNet peter$ python3 manage.py makemigrations*

Did you rename the market.SegmentType model to SegmentSlope? [y/N] y

Did you rename qbiddataarray.segmentType to qbiddataarray.segmentSlope (a 
ForeignKey)? [y/N] y

*Migrations for 'market':*

  *market/migrations/0007_auto_20161114_1742.py*:

- Rename model SegmentType to SegmentSlope

- Rename field segmentType on qbiddataarray to segmentSlope

Herettix:SmartNet peter$ 

Herettix:SmartNet peter$ 

Herettix:SmartNet peter$ python3 manage.py migrate

*Operations to perform:*

*  Apply all migrations: *admin, auth, contenttypes, market, sessions

*Running migrations:*

  Applying market.0005_auto_20161114_1254...Traceback (most recent call 
last):

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/utils.py", line 
64, in execute

return self.cursor.execute(sql, params)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", 
line 337, in execute

return Database.Cursor.execute(self, query, params)

sqlite3.OperationalError: near ")": syntax error


The above exception was the direct cause of the following exception:


Traceback (most recent call last):

  File "manage.py", line 22, in 

execute_from_command_line(sys.argv)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
line 367, in execute_from_command_line

utility.execute()

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
line 359, in execute

self.fetch_command(subcommand).run_from_argv(self.argv)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
line 294, in run_from_argv

self.execute(*args, **cmd_options)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
line 345, in execute

output = self.handle(*args, **options)

  File 
"/usr/local/lib/python3.4/site-packages/django/core/management/commands/migrate.py",
 
line 204, in handle

fake_initial=fake_initial,

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
line 115, in migrate

state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
fake_initial=fake_initial)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
line 145, in _migrate_all_forwards

state = self.apply_migration(state, migration, fake=fake, 
fake_initial=fake_initial)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
line 244, in apply_migration

state = migration.apply(state, schema_editor)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/migration.py", 
line 129, in apply

operation.database_forwards(self.app_label, schema_editor, old_state, 
project_state)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/migrations/operations/fields.py",
 
line 147, in database_forwards

schema_editor.remove_field(from_model, 
from_model._meta.get_field(self.name))

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py", 
line 249, in remove_field

self._remake_table(model, delete_fields=[field])

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py", 
line 199, in _remake_table

self.quote_name(model._meta.db_table),

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/base/schema.py", 
line 112, in execute

cursor.execute(sql, params)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/utils.py", line 
79, in execute

return super(CursorDebugWrapper, self).execute(sql, params)

  File 
"/usr/local/lib/python3.4/site-packages/django/db/backends/utils.py", line 
64, in execute

return self.cursor.execute(sql, params)

  File "/usr/local/lib/python3.4/site-packages/d

Basic configuration for running under Apache

2016-11-14 Thread bob gailer

https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/modwsgi/

This page offers:

WSGIScriptAlias  //path/to/mysite.com/mysite/wsgi.py
WSGIPythonPath  /path/to/mysite.com



In my setup this becomes c:\Users\myname\mysite\mysite\wsgi.py

I am puzzled by the .com in the example. Can you explain?

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c9f26e89-87f9-5ba8-d708-6ceb236a8e5e%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
After a validationError occurs, why is the transaction considered dirty, 
blocking all db reads/writes? In this example: 
https://bitbucket.org/marky1991/django-test/raw/59c9ff89e4b12b4a831c36171139cb022735201b/test1.py
 
, I don't really expect a TransactionManagementError at all, as the failure 
in question is a django model ValidationError, so no rollback should be 
needed, since the save never actually hits the db. At the minimum, however, 
I would expect a transaction.rollback() to resolve the issue, but it does 
not. 

The traceback: https://dpaste.de/ooTy

Is there a django bug here or are my expectations not correct?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2fbbe546-c21e-434f-b8fb-d01d787169db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
I have found this: https://code.djangoproject.com/ticket/26340 , where Aymeric 
Augustin said that he thought that transaction.rollback should indeed set 
DatabaseWrapper.needs_rollback to False, as I would expect.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a0c57906-d5ff-40cc-9ef3-80eae5ea89e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: django.db.utils.OperationalError: near ")": syntax error ERROR at $ python3 manage.py migrate

2016-11-14 Thread Simon Charette
Hello Peter,

That looks like https://code.djangoproject.com/ticket/24424

Simon

Le lundi 14 novembre 2016 12:06:41 UTC-5, Peter Sels a écrit :
>
> Dear Django-ers,
>
> I ran into a problem with Django.
>
> --
> Situation:
> --
>
> I am using version 1.10.3 of Django.
>
> For the fifth time I updated my table related classes in models.py.
> The 4 previous time this ran well all through
>
> (1) The server ran and did not complain about syntax errors or anything 
> else.
> and
> (2) $ python3 manage.py makemigrations
>
> but in
>
> (3) $ python3 manage.py migrate
> I get the problem mentioned below when running 
>
> The log of (2) and (3) is given below.
>
> --
> Questions:
> --
> Any tips on how to solve it?
>
> How can I relate this to my own code in models.py?
>
> Do I really need to revert back to my previously (checked in) version of 
> models.py?
> And then do small incremental steps again?
> Or is there a better way?
> (Unluckily I cannot share the models.py file.)
>
> thanks and best regards,
>
> Peter
>
> 
>
> (2)
>
> *$ python3 manage.py makemigrations*
>
> *Migrations for 'market':*
>
>   *market/migrations/0006_auto_20161114_1741.py*:
>
> - Alter field code on bidstate
>
> - Alter field code on coordinationschemevariant
>
> - Alter field code on networktype
>
> - Alter field code on segmenttype
>
> Herettix:SmartNet peter$ 
>
>
>
> (3)
>
> *Herettix:SmartNet peter$ python3 manage.py makemigrations*
>
> Did you rename the market.SegmentType model to SegmentSlope? [y/N] y
>
> Did you rename qbiddataarray.segmentType to qbiddataarray.segmentSlope (a 
> ForeignKey)? [y/N] y
>
> *Migrations for 'market':*
>
>   *market/migrations/0007_auto_20161114_1742.py*:
>
> - Rename model SegmentType to SegmentSlope
>
> - Rename field segmentType on qbiddataarray to segmentSlope
>
> Herettix:SmartNet peter$ 
>
> Herettix:SmartNet peter$ 
>
> Herettix:SmartNet peter$ python3 manage.py migrate
>
> *Operations to perform:*
>
> *  Apply all migrations: *admin, auth, contenttypes, market, sessions
>
> *Running migrations:*
>
>   Applying market.0005_auto_20161114_1254...Traceback (most recent call 
> last):
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/backends/utils.py", line 
> 64, in execute
>
> return self.cursor.execute(sql, params)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py", 
> line 337, in execute
>
> return Database.Cursor.execute(self, query, params)
>
> sqlite3.OperationalError: near ")": syntax error
>
>
> The above exception was the direct cause of the following exception:
>
>
> Traceback (most recent call last):
>
>   File "manage.py", line 22, in 
>
> execute_from_command_line(sys.argv)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
> line 367, in execute_from_command_line
>
> utility.execute()
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/__init__.py", 
> line 359, in execute
>
> self.fetch_command(subcommand).run_from_argv(self.argv)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
> line 294, in run_from_argv
>
> self.execute(*args, **cmd_options)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/base.py", 
> line 345, in execute
>
> output = self.handle(*args, **options)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/core/management/commands/migrate.py",
>  
> line 204, in handle
>
> fake_initial=fake_initial,
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
> line 115, in migrate
>
> state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, 
> fake_initial=fake_initial)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
> line 145, in _migrate_all_forwards
>
> state = self.apply_migration(state, migration, fake=fake, 
> fake_initial=fake_initial)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/executor.py", 
> line 244, in apply_migration
>
> state = migration.apply(state, schema_editor)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/migration.py", 
> line 129, in apply
>
> operation.database_forwards(self.app_label, schema_editor, old_state, 
> project_state)
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/migrations/operations/fields.py",
>  
> line 147, in database_forwards
>
> schema_editor.remove_field(from_model, from_model._meta.get_field(
> self.name))
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py",
>  
> line 249, in remove_field
>
> self._remake_table(model, delete_fields=[field])
>
>   File 
> "/usr/local/lib/python3.4/site-packages/django/db/backends/sqlite3/schema.py",
>  
> line 199, in _remake_table
>
> self.quote_name(model._meta.db_table),
>
>   File 
> "/usr/local/l

Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread Simon Charette
Hello Mark,

Is there a reason for not using the transaction.atomic context manager 
instead
of managing your transaction manually by calling .set_autocommit(False) and
rollback?

Simon


Le lundi 14 novembre 2016 15:46:38 UTC-5, mark...@gmail.com a écrit :
>
> After a validationError occurs, why is the transaction considered dirty, 
> blocking all db reads/writes? In this example: 
> https://bitbucket.org/marky1991/django-test/raw/59c9ff89e4b12b4a831c36171139cb022735201b/test1.py
>  
> , I don't really expect a TransactionManagementError at all, as the failure 
> in question is a django model ValidationError, so no rollback should be 
> needed, since the save never actually hits the db. At the minimum, however, 
> I would expect a transaction.rollback() to resolve the issue, but it does 
> not. 
>
> The traceback: https://dpaste.de/ooTy
>
> Is there a django bug here or are my expectations not correct?
>
> Thanks
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/879a8b4a-09ad-4326-bf64-f58930205b3c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
In the real code, we have much more complex code flow where 
transaction.atomic offers no readability improvement (imo) over 
commit_manually. (and even if transaction.atomic were an improvement at all 
call sites, we have lots of code using commit manually which cannot be 
changed immediately.)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c177b5fd-f09a-4e56-9996-599535ed0041%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: DatabaseWrapper.needs_rollback and transaction.rollback()

2016-11-14 Thread marky1...@gmail.com
By "commit_manually" I meant set_autocommit(False). Sorry for the confusion.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a464706e-aa72-47b8-bb2e-68316e24c18c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Admin Email From Address

2016-11-14 Thread Matthew Pava
I would like to be able to change the 'from' address of the admin error emails 
in production environments to be the email address of the user that generated 
the error.  It would be convenient in triaging errors rather quickly.

I did examine the Django source code, but it doesn't appear to be possible 
without writing my own custom function.  Any ideas?

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/29de56e899934c489630983151e28092%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.


Re: Admin Email From Address

2016-11-14 Thread Constantine Covtushenko
Hi Matthew,

There should be considered following:
1. Not always cod runs with user interaction - worker cases
2. Not always user authenticated

With such cases who the sender should be?

Regards,
Constantine C.

On Nov 15, 2016 12:43 AM, "Matthew Pava"  wrote:

I would like to be able to change the ‘from’ address of the admin error
emails in production environments to be the email address of the user that
generated the error.  It would be convenient in triaging errors rather
quickly.



I did examine the Django source code, but it doesn’t appear to be possible
without writing my own custom function.  Any ideas?



Thank you!



-- 
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/
msgid/django-users/29de56e899934c489630983151e28092%40ISS1.ISS.LOCAL

.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAK52boX3QBmimdd3z5YSbKDOAMOeDrX6iF3NzvsLs-fNx2PO1g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.