Projet

Général

Profil

Actions

Anomalie #80

fermé

File creation and modification / individuals in menu vs organisation in Contractor add process

Ajouté par Yann Le Jeune il y a presque 14 ans. Mis à jour il y a plus de 13 ans.

Statut:
Fermé
Priorité:
Haut
Assigné à:
Catégorie:
-
Version cible:
Début:
11 janvier 2011
Echéance:
% réalisé:

100%

Temps estimé:
Élément(s):
Difficulté:

Description

There's a bug with the choice of the contractor : individuals are displayed whereas the system try to record an organisation in the DB. Which is no more posible :

ValueError at /ishtar/file_creation/done

Cannot assign "File.general_contractor" must be a "Person" instance.

Request Method: GET

Request URL: http://lysithea.proxience.com/ishtar/file_creation/done

Django Version: 1.2.3

Exception Type: ValueError

Exception Value:

Cannot assign "File.general_contractor" must be a "Person" instance.

Exception Location: /usr/lib/pymodules/python2.6/django/db/models/fields/related.py in set, line 318

Python Executable: /usr/bin/python

Python Version: 2.6.6

Python Path: ['/var/local/ishtar/', '/usr/lib/python2.6', '/usr/lib/python2.6/plat-linux2', '/usr/lib/python2.6/lib-tk', '/usr/lib/python2.6/lib-old', '/usr/lib/python2.6/lib-dynload', '/usr/local/lib/python2.6/dist-packages', '/usr/lib/python2.6/dist-packages', '/usr/lib/pymodules/python2.6']

Server time: mar, 11 Jan 2011 14:59:43 +0100

Traceback Switch to copy-and-paste view

* /usr/lib/pymodules/python2.6/django/core/handlers/base.py in get_response

    93. # Apply view middleware

    94. for middleware_method in self._view_middleware:

    95. response = middleware_method(request, callback, callback_args, callback_kwargs)

    96. if response:

    97. return response

    98.

    99. try:

   100. response = callback(request, *callback_args, **callback_kwargs) ...

   101. except Exception, e:

   102. # If the view raised an exception, run it through exception

   103. # middleware, and if the exception middleware returns a

   104. # response, use that. Otherwise, reraise the exception.

   105. for middleware_method in self._exception_middleware:

   106. response = middleware_method(request, e)

  ▶ Local vars

  Variable  Value

  callback  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  callback_args     

  ()

  callback_kwargs   

  {'step': u'done'}

  e     

  ValueError('Cannot assign [<Organization: SRA Picardie>]() "File.general_contractor" must be a "Person" instance.',)

  exceptions    

  <module 'django.core.exceptions' from '/usr/lib/pymodules/python2.6/django/core/exceptions.pyc'>

  middleware_method     

  <bound method CsrfViewMiddleware.process_view of <django.middleware.csrf.CsrfViewMiddleware object at 0x7f54b05c4ad0>>

  receivers     

  [(<function _rollback_on_exception at 0x7f54af40e230>, None)]

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  resolver  

  <RegexURLResolver ishtar.urls (None:None) ^/>

  response  

  None

  self  

  <django.core.handlers.modpython.ModPythonHandler object at 0x7f54af84e590>

  settings  

  <django.conf.LazySettings object at 0x7f5499b21950>

  urlconf   

  'ishtar.urls'

  urlresolvers  

  <module 'django.core.urlresolvers' from '/usr/lib/pymodules/python2.6/django/core/urlresolvers.pyc'>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in __call__

    78.

    79. After processing the request using the `process_request` method, the

    80. response gets updated by the storage engine (for example add cookies).

    81. """

    82.

    83. storage = get_storage(self.storage_name,

    84. self.get_wizard_name(), request, getattr(self, 'file_storage', None))

    85. response = self.process_request(request, storage, *args, **kwargs) ...

    86. storage.update_response(response)

    87.

    88. if kwargs.get('testmode', False):

    89. return response, storage

    90. else:

    91. return response

  ▶ Local vars

  Variable  Value

  args  

  ()

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7f54b05abe50>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in process_request

    92.

    93. def process_request(self, request, *args, **kwargs):

    94. """

    95. Returns a response generated by either `process_get_request` or

    96. `process_post_request` (depends on `request.method`).

    97. """

    98. if request.method == 'GET':

    99. return self.process_get_request(request, *args, **kwargs) ...

   100. else:

   101. return self.process_post_request(request, *args, **kwargs)

   102.

   103. def process_get_request(self, request, storage, *args, **kwargs):

   104. """

   105. If the wizard gets a GET request, it assumes that the user just

  ▶ Local vars

  Variable  Value

  args  

  (<formwizard.storage.session.SessionStorage object at 0x7f54b05abe50>,)

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in process_get_request

   537. if step_url == self.done_step_name:

   538. return self.render_done(request, storage,

   539. self.get_form(request, storage,

   540. step=self.get_last_step(request, storage),

   541. data=storage.get_step_data(

   542. self.get_last_step(request, storage)),

   543. files=storage.get_step_files(

   544. self.get_last_step(request, storage))), **kwargs) ...

   545.

   546. # is the url step name not equal to the step in the storage?

   547. # if yes, change the step in the storage (if name exists)

   548. if step_url <> self.determine_step(request, storage):

   549. if self.get_form_list(request, storage).has_key(step_url):

   550. storage.set_current_step(step_url)

  ▶ Local vars

  Variable  Value

  args  

  ()

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  step_url  

  u'done'

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7f54b05abe50>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in render_done

   613. step_url = kwargs.get('step', None)

   614. if step_url <> self.done_step_name:

   615. return HttpResponseRedirect(reverse(self.url_name, kwargs={

   616. 'step': self.done_step_name

   617. }))

   618.

   619. return super(NamedUrlFormWizard, self).render_done(

   620. request, storage, form, **kwargs) ...

   621.

   622.

   623. class NamedUrlSessionFormWizard(NamedUrlFormWizard):

   624. """

   625. A NamedUrlFormWizard with pre-configured SessionStorageBackend.

   626. """

  ▶ Local vars

  Variable  Value

  form  

  <ishtar.furnitures.forms.FinalForm object at 0x7f54b056c290>

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  step_url  

  u'done'

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7f54b05abe50>

* /usr/local/lib/python2.6/dist-packages/formwizard/forms.py in render_done

   179. form_obj = self.get_form(request, storage, step=form_key,

   180. data=storage.get_step_data(form_key),

   181. files=storage.get_step_files(form_key))

   182. if not form_obj.is_valid():

   183. return self.render_revalidation_failure(request, storage,

   184. form_key, form_obj, **kwargs)

   185. final_form_list.append(form_obj)

   186. done_response = self.done(request, storage, final_form_list, **kwargs) ...

   187. self.reset_wizard(request, storage)

   188. return done_response

   189.

   190. def get_form_prefix(self, request, storage, step=None, form=None):

   191. """

   192. Returns the prefix which will be used when calling the actual form for

  ▶ Local vars

  Variable  Value

  final_form_list   

  [<ishtar.furnitures.forms.FileFormGeneral object at 0x7f54b054f550>, <ishtar.furnitures.forms.FileFormAddress object at 0x7f54b054f210>, <django.forms.formsets.TownFormFormSet object at 0x7f54b054fa90>, <django.forms.formsets.ParcelFormFormSet object at 0x7f54b0136a50>, <ishtar.furnitures.forms.FileFormPreventive object at 0x7f54b0276c90>, <ishtar.furnitures.forms.FinalForm object at 0x7f54b02767d0>]

  form  

  <ishtar.furnitures.forms.FinalForm object at 0x7f54b056c290>

  form_key  

  u'final-file_creation'

  form_obj  

  <ishtar.furnitures.forms.FinalForm object at 0x7f54b02767d0>

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7f54b05abe50>

* /var/local/ishtar/ishtar/furnitures/forms.py in done

   392. return dct

   393.

   394. def done(self, request, storage, form_list, **kwargs):

   395. '''

   396. Save parcels

   397. '''

   398. r = super(FileWizard, self).done(request, storage, form_list,

   399. return_object=True, **kwargs) ...

   400. if type(r) not in (list, tuple) or len(r) != 2:

   401. return r

   402. obj, res = r

   403. for form in form_list:

   404. if not hasattr(form, 'prefix') \

   405. or not form.prefix.startswith('parcels-') \

  ▶ Local vars

  Variable  Value

  form_list     

  [<ishtar.furnitures.forms.FileFormGeneral object at 0x7f54b054f550>, <ishtar.furnitures.forms.FileFormAddress object at 0x7f54b054f210>, <django.forms.formsets.TownFormFormSet object at 0x7f54b054fa90>, <django.forms.formsets.ParcelFormFormSet object at 0x7f54b0136a50>, <ishtar.furnitures.forms.FileFormPreventive object at 0x7f54b0276c90>, <ishtar.furnitures.forms.FinalForm object at 0x7f54b02767d0>]

  kwargs    

  {'step': u'done'}

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  self  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7f54b05abe50>

* /var/local/ishtar/ishtar/furnitures/forms.py in done

   179. obj = self.get_current_object(request, storage)

   180. if obj:

   181. for k in dct:

   182. if k == 'pk':

   183. continue

   184. setattr(obj, k, dct[k])

   185. else:

   186. obj = self.model(**dct) ...

   187. obj.save()

   188. for key, value in m2m:

   189. if value not in getattr(obj, key+'s').all():

   190. getattr(obj, key+'s').add(value)

   191. obj.save()

   192. res = render_to_response('wizard_done.html', {},

  ▶ Local vars

  Variable  Value

  associated_models     

  {}

  base_form     

  <ishtar.furnitures.forms.FinalForm object at 0x7f54b02767d0>

  dct   

  {'address': u'par ici', 'address_complement': u'par l\xe0', 'comment': u'blah !', 'creation_date': datetime.date(2011, 1, 11), 'file_type': <FileType: Archéologie préventive>, 'general_contractor': <Organization: SRA Picardie>, 'history_modifier': <User: lj.yann>, 'in_charge': <Person: Courty Hélène - SRA Pays de la Loire>, 'internal_reference': u'Lotissement du truc', 'numeric_reference': 20, 'postal_code': u'85000', 'reception_date': datetime.date(2011, 1, 11), 'saisine_type': <SaisineType: Article 10>, 'total_developed_surface': 451, 'total_surface': 30000, 'year': 2011}

  form  

  <ishtar.furnitures.forms.FinalForm object at 0x7f54b02767d0>

  form_list     

  [<ishtar.furnitures.forms.FileFormGeneral object at 0x7f54b054f550>, <ishtar.furnitures.forms.FileFormAddress object at 0x7f54b054f210>, <django.forms.formsets.TownFormFormSet object at 0x7f54b054fa90>, <django.forms.formsets.ParcelFormFormSet object at 0x7f54b0136a50>, <ishtar.furnitures.forms.FileFormPreventive object at 0x7f54b0276c90>, <ishtar.furnitures.forms.FinalForm object at 0x7f54b02767d0>]

  frm   

  <ishtar.furnitures.forms.ParcelForm object at 0x7f54b054f690>

  key   

  'saisine_type'

  kwargs    

  {'step': u'done'}

  m2m   

  [('town', <Town: Nantes>), ('town', <Town: Le Maisnil>), ('town', <Town: Le Maisnil>), ('town', <Town: Nantes>)]

  obj   

  None

  request   

  <ModPythonRequest path:/ishtar/file_creation/done, GET:<QueryDict: {}>, POST:<QueryDict: {}>, COOKIES:{'csrftoken': 'b6828b56a02c1e76e43781c2f3fa9c67', 'sessionid': '84680f3d5f974e1633337b55b5f01f36'}, META:{'AUTH_TYPE': None, 'CONTENT_LENGTH': 0, 'CONTENT_TYPE': None, 'CSRF_COOKIE': 'b6828b56a02c1e76e43781c2f3fa9c67', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3', 'HTTP_CACHE_CONTROL': 'max-stale=0', 'HTTP_CLIENT_IP': '143.126.144.2', 'HTTP_CONNECTION': 'Keep-Alive', 'HTTP_COOKIE': 'csrftoken=b6828b56a02c1e76e43781c2f3fa9c67; sessionid=84680f3d5f974e1633337b55b5f01f36', 'HTTP_HOST': 'lysithea.proxience.com', 'HTTP_REFERER': 'http://lysithea.proxience.com/ishtar/file_creation/final-file_creation', 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)', 'HTTP_X_BLUECOAT_VIA': '1653EDCF90CC082F, ad355d1e6176f675', 'HTTP_X_FORWARDED_FOR': '143.126.144.2', 'PATH_INFO': u'/ishtar/file_creation/done', 'PATH_TRANSLATED': None, 'QUERY_STRING': None, 'REMOTE_ADDR': '143.126.201.152', 'REMOTE_HOST': None, 'REMOTE_IDENT': None, 'REMOTE_USER': None, 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': '', 'SERVER_NAME': 'lysithea.proxience.com', 'SERVER_PORT': 80, 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SOFTWARE': 'mod_python'}>

  return_object     

  True

  self  

  file_creation: form_list: {u'general-file_creation': <class 'ishtar.furnitures.forms.FileFormGeneral'>, u'address-file_creation': <class 'ishtar.furnitures.forms.FileFormAddress'>, u'towns-file_creation': <class 'django.forms.formsets.TownFormFormSet'>, u'parcels-file_creation': <class 'django.forms.formsets.ParcelFormFormSet'>, u'preventive-file_creation': <class 'ishtar.furnitures.forms.FileFormPreventive'>, u'final-file_creation': <class 'ishtar.furnitures.forms.FinalForm'>}, initial_list: {}

  storage   

  <formwizard.storage.session.SessionStorage object at 0x7f54b05abe50>

  value     

  <SaisineType: Article 10>

* /usr/lib/pymodules/python2.6/django/db/models/base.py in __init__

   320. else:

   321. val = field.get_default()

   322. if is_related_object:

   323. # If we are passed a related instance, set it using the

   324. # field.name instead of field.attname (e.g. "user" instead of

   325. # "user_id") so that the object gets properly cached (and type

   326. # checked) by the RelatedObjectDescriptor.

   327. setattr(self, field.name, rel_obj) ...

   328. else:

   329. setattr(self, field.attname, val)

   330.

   331. if kwargs:

   332. for prop in kwargs.keys():

   333. try:

  ▶ Local vars

  Variable  Value

  args  

  ()

  args_len  

  0

  field     

  <django.db.models.fields.related.ForeignKey object at 0x7f54afbea850>

  fields_iter   

  <listiterator object at 0x7f54b05c4110>

  is_related_object     

  True

  kwargs    

  {'address': u'par ici', 'address_complement': u'par l\xe0', 'comment': u'blah !', 'creation_date': datetime.date(2011, 1, 11), 'postal_code': u'85000', 'reception_date': datetime.date(2011, 1, 11), 'saisine_type': <SaisineType: Article 10>, 'total_developed_surface': 451, 'total_surface': 30000}

  rel_obj   

  <Organization: SRA Picardie>

  self  

  Error in formatting: 'File' instance needs to have a primary key value before a many-to-many relationship can be used.

  val   

  u'Lotissement du truc'

* /usr/lib/pymodules/python2.6/django/db/models/fields/related.py in __set__

   311. # to be an instance of the related class.

   312. if value is None and self.field.null == False:

   313. raise ValueError('Cannot assign None: "%s.%s" does not allow null values.' %

   314. (instance._meta.object_name, self.field.name))

   315. elif value is not None and not isinstance(value, self.field.rel.to):

   316. raise ValueError('Cannot assign [%r]() "%s.%s" must be a "%s" instance.' %

   317. (value, instance._meta.object_name,

   318. self.field.name, self.field.rel.to._meta.object_name)) ...

   319. elif value is not None:

   320. if instance._state.db is None:

   321. instance._state.db = router.db_for_write(instance.__class__, instance=value)

   322. elif value._state.db is None:

   323. value._state.db = router.db_for_write(value.__class__, instance=instance)

   324. elif value._state.db is not None and instance._state.db is not None:

  ▶ Local vars 

Mis à jour par Anonyme il y a presque 14 ans

  • % réalisé changé de 0 à 100
  • Statut changé de Nouveau à Fermé

Appliqué par commit commit:"03236c52592cb90eee2658dd505c056497d8a028".

Mis à jour par Étienne Loks il y a plus de 13 ans

  • Version cible mis à 1.0
Actions

Formats disponibles : Atom PDF