Created
March 29, 2009 23:38
-
-
Save fitoria/87569 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import forms | |
from models import Place, RestaurantDetail | |
class PlaceForm(forms.Form): | |
""""Formulario para crear un lugar nuevo""" | |
name = forms.CharField(max_length = 100, required = True) | |
img = forms.ImageField() | |
#todo: agregar los demas campos | |
def save(self): | |
place = Place(name = self.cleaned_data['name']) #agregar los demas aca | |
place.save() | |
return place | |
def clean(self): | |
pass #todo agregar regla de validaciones...... | |
class RestaurantDetailForm(forms.Form): | |
pass #todo todo :P |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment