PyAr / pyarweb

El sitio web de Python Argentina
http://python.org.ar
Apache License 2.0
81 stars 99 forks source link

modelo roto en la app event #158

Closed mgaitan closed 9 years ago

mgaitan commented 9 years ago

7a4fb5e6 introdujo cambios en events/models.py y una migración, pero sin respetar el estado inicial . (la migración 0001 se aplica como fake y no representa el estado actual)

Environment:

Request Method: GET
Request URL: http://localhost:8000/

Django Version: 1.7.1
Python Version: 3.4.2
Installed Applications:
('django.contrib.admin',
 'django.contrib.sites',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'community',
 'news',
 'pycompanies',
 'jobs',
 'events',
 'newbie',
 'projects',
 'faq',
 'allauth',
 'allauth.account',
 'allauth.socialaccount',
 'django_extensions',
 'disqus',
 'taggit',
 'taggit_autosuggest',
 'bootstrap3_datetime',
 'planet',
 'pagination',
 'tagging',
 'bootstrap3',
 'django_summernote',
 'sendfile',
 'crispy_forms',
 'email_obfuscator',
 'waliki',
 'waliki.git',
 'waliki.attachments')
Installed Middleware:
('django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.gzip.GZipMiddleware',
 'pagination.middleware.PaginationMiddleware')

Template error:
In template /home/tin/lab/pyar/templates/events/next_events.html, error at line 1
   no such column: events_event.zoom
   1 :  {% for event in events %} 

   2 :     <article class="list-group-item">

   3 :       <h4 class="list-group-item-heading">

   4 :         <a href="{% url 'events:detail' event.id %}">

   5 :           {{ event.name }}

   6 :         </a>

   7 :       </h4>

   8 :       

   9 :       <p class="list-group-item-text">

   10 :         <span>{{ event.start_at|date:"DATE_FORMAT" }}</span> | 

   11 :         <span>{{ event.start_at|time:"TIME_FORMAT" }}</span> | 

Traceback:
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/core/handlers/base.py" in get_response
  111.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/tin/lab/pyar/community/views.py" in homepage
  10.     return render(request, 'community/index.html', {'news': news})
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/shortcuts.py" in render
  48.     return HttpResponse(loader.render_to_string(*args, **kwargs),
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader.py" in render_to_string
  178.         return t.render(context_instance)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  148.             return self._render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in render
  126.         return compiled_parent._render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in render
  126.         return compiled_parent._render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in _render
  142.         return self.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/defaulttags.py" in render
  527.             return self.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render
  90.             output = self.filter_expression.resolve(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in resolve
  596.                 obj = self.var.resolve(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in resolve
  734.             value = self._resolve_lookup(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in _resolve_lookup
  788.                             current = current()
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in super
  74.             return mark_safe(self.render(self.context))
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/loader_tags.py" in render
  65.                 result = block.nodelist.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  1231.                     return self.nodelist.render(new_context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/base.py" in render
  844.                 bit = self.render_node(node, context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/debug.py" in render_node
  80.             return node.render(context)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/template/defaulttags.py" in render
  162.             len_values = len(values)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/models/query.py" in __len__
  122.         self._fetch_all()
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/models/query.py" in _fetch_all
  966.             self._result_cache = list(self.iterator())
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/models/query.py" in iterator
  265.         for row in compiler.results_iter():
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/models/sql/compiler.py" in results_iter
  700.         for rows in self.execute_sql(MULTI):
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/models/sql/compiler.py" in execute_sql
  786.             cursor.execute(sql, params)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/backends/utils.py" in execute
  81.             return super(CursorDebugWrapper, self).execute(sql, params)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/utils.py" in __exit__
  94.                 six.reraise(dj_exc_type, dj_exc_value, traceback)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/utils/six.py" in reraise
  549.             raise value.with_traceback(tb)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/backends/utils.py" in execute
  65.                 return self.cursor.execute(sql, params)
File "/home/tin/.virtualenvs/pyar/lib/python3.4/site-packages/django/db/backends/sqlite3/base.py" in execute
  485.         return Database.Cursor.execute(self, query, params)

Exception Type: OperationalError at /
Exception Value: no such column: events_event.zoom
mgaitan commented 9 years ago

a alguien le pasa? @edvm @diegoduncan21 ?

mgaitan commented 9 years ago

@diegoduncan21

cuando cambies un modelo que todavia no tiene migraciones, tenes que hacer primero la migración 0001. despues cambias cosas y haces la migracion 0002. Sino pasa se rompe todito :)

acá la doc. https://docs.djangoproject.com/en/1.7/topics/migrations/#adding-migrations-to-apps

diegoduncan21 commented 9 years ago

okey, con la app pycompanies entonces paso lo mismo. o pasara lo mismo. alguna otra app tiene migraciones?

2014-11-23 20:57 GMT-03:00 Martín Gaitán notifications@github.com:

@diegoduncan21 https://github.com/diegoduncan21

cuando cambies un modelo que todavia no tiene migraciones, tenes que hacer primero la migración 0001. despues cambias cosas y haces la migracion

  1. Sino pasa se rompe todito :)

acá la doc.

https://docs.djangoproject.com/en/1.7/topics/migrations/#adding-migrations-to-apps

— Reply to this email directly or view it on GitHub https://github.com/PyAr/pyarweb/issues/158#issuecomment-64141261.

Diego Puente