Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rama mapeveri #68

Closed
wants to merge 16 commits into from
Closed

Rama mapeveri #68

wants to merge 16 commits into from

Conversation

mapeveri
Copy link

Este pull request esta relacionado a este issue: #64

Lo que se hizo fue:

  1. Agregar un crud de categorías.
  2. En el crud de eventos permitir agregar una o más categorías por en el evento seleccionado.
  3. En el detalle de evento se visualizan las categorías relacionadas al evento y al hacer click re direcciona a una vista que termina mostrando en un template los eventos relacionados a la categoría seleccionada.
  4. En el index se agregó al final de todo las categorías, así al hacer click filtra los eventos por la categoría seleccionada.

'''

id = models.AutoField(primary_key=True)
descrip = models.CharField(_("Category"), max_length=100, default="")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a full name for this? description

Also, maybe we want a name and description for each category, as well as a slug for linking it?

@nukeador
Copy link
Member

I did some review, comments inline. We use English for this kind of projects since we want to on board people from all around mozilla.

Also, I miss the migrations files for the model changes.

@mapeveri
Copy link
Author

Ready the changes.

@mapeveri
Copy link
Author

For apply the migrations, in the terminal:

  1. python manage.py schemamigration events --auto
  2. python manage.py migrate events

@@ -219,3 +225,20 @@ def stats(request):

return render_to_response(
'stats/index.html', data, context_instance=RequestContext(request))

def events_category(request, id):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should use here id and slug as we use for the detail page, to be more search engine friendly.

@mapeveri
Copy link
Author

I Added slug to model category.

@@ -45,4 +45,12 @@ <h2 class="event-name">{{ event.name }}</h2>

{% include "events/twitter-widget.html" %}

<br>
<h3>{% trans 'Category' %}</h3>
{% for obj in categories %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a more meaningful variable name here, obj is too generic.

{% for cat in categories %}

@mapeveri
Copy link
Author

Ready @nukeador

try:
events = CategoryEvent.objects.filter(category_id=id)
except CategoryEvent.DoesNotExist:
raise Http404("Selected category nonexistent")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Text should be localizable here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that you mean exactly with localizable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the localization string "_".

raise Http404(_("Selected category nonexistent"))

@francjp
Copy link

francjp commented Mar 27, 2015

No, one categorie, and possible multiple tags.
I think that way it will be easier then to search for event type and event categorie

@mapeveri
Copy link
Author

mapeveri commented Apr 8, 2015

Well Then?

@nukeador
Copy link
Member

nukeador commented Apr 8, 2015

Then we need just one category per event for now.

The tag thing is not currently a priority.

@mapeveri
Copy link
Author

mapeveri commented Apr 8, 2015

@nukeador ready ;)

@nukeador
Copy link
Member

Seem OK for me.

@mapeveri Have you run the tests to ensure there is no problem?

@sebasmagri I don't have a lot of time this week, can you help with deploying this to production?

@mapeveri
Copy link
Author

@nukeador No, I did the tests

@sebasmagri
Copy link
Member

@nukeador justo esta semana estoy en medio de unos shipings pero si me das los detalles puedo hacerle deploy.

Saludos.

@nukeador
Copy link
Member

@sebasmagri comprueba que no rompe nada y mergea. Cuando esté avisa y le doy en el server deploy, que mozevent solo tenemos en producción.


from django_countries.countries import COUNTRIES

class Category(models.Model):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mapeveri could you please add a Meta nested class to Category and define its verbose_name and verbose_name_plural to avoid typos in the admin such as Categorys instead of Categories.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sebasmagri ready this.

@sebasmagri
Copy link
Member

@mapeveri I've left some comments to the changes.

Could you please add a database schema migration for your changes as well?

Best Regards,

@mapeveri
Copy link
Author

@sebasmagri Have you attach migration by email ?. The .gitignore ignored the migrations folder.

@nukeador
Copy link
Member

@sebasmagri Was the schema migration included? I can't find it in the file list :)

@sebasmagri
Copy link
Member

@nukeador it wasn't. @mapeveri would you be able to push the migrations for this PR?

If there is no answer I'd be able to look at this next weekend.

@mapeveri
Copy link
Author

@sebasmagri @nukeador I just made a commit with to migrations that I have.

@mapeveri mapeveri closed this Mar 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants