Giter Club home page Giter Club logo

django-mongoforms's People

Contributors

alefnula avatar azd325 avatar flashingpumpkin avatar flosch avatar lig avatar stephrdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

django-mongoforms's Issues

Order of the formfield

5 class SignupForm(MongoForm):
6 class Meta:
7 document = User
8 fields = ('username', 'email', 'password')
9 password = forms.CharField(widget=forms.PasswordInput, label="Your password")
10 repeat_password = forms.CharField(widget=forms.PasswordInput, label="Repeat password")

But the order of the form is
username
password
email
repeat_password

stringField regex supported?

I made a ModelForm by metaclass a document, but in which the stringField seems not to support regex in model.
with error such as:

Error when calling the metaclass bases
init() got an unexpected keyword argument 'regex'

instance as EmbeddedDocument

Hi,

Here is a simple scenario: I have a blog post with comments attach to it. Now I want to use mongoforms to let user submit their comments. Therefore I have this models.py:

class Post(Document):
    title = StringField(max_length=60)
    body = StringField()
    created = DateTimeField(default=datetime.datetime.now)
    comments = ListField(EmbeddedDocumentField('Comment'))

class Comment(EmbeddedDocument):
    author = StringField(max_length=60)
    body = StringField()
    created = DateTimeField(default=datetime.datetime.now)

And the forms.py:

class CommentForm(MongoForm):
    class Meta:
        document = Comment
        fields = ('author', 'body')

In the views.py, I just want to save what user has entered, more specifically Author and Body of the comments:

post = Post.objects.with_id(id)
if request.method == 'POST':
    form = CommentForm(request.POST, instance=post.comments)
    if form.is_valid():
        form.save()
return HttpResponseRedirect(post.get_absolute_url())

But apparently the post.comments is a BaseList not directly inherit from Document, so I got this error:

instance must be a mongoengine document, not BaseList

The question is what's the best practice in this case, say update the EmbeddedDocument?

Thank you!

No way to upload files

forms.BaseForm's init method has a third attribute "files", MongoForm does not have such method, so uploading multipart forms with forms.ImageField and so on is impossible right now, the form just does not validate.

'module' object has no attribute 'util'

django version 1.8.1

mongoforms/forms.py in MongoForm, line 57

def __init__(self, data=None, files=None, auto_id='id_%s', prefix=None,
        initial=None, error_class=forms.util.ErrorList, label_suffix=':',
        empty_permitted=False, instance=None):

forms.utils.ErrorList

Installation issue

When I installed this on my machine, the package didn't seem to set itself up correctly.

I ran:

python setup.py install

to install my application. But it looks like my /usr/lib/python2.6/dist-packages directory only contains a django_mongoforms-0.2-py2.7.egg folder. I expect it to contain a mongoforms/ folder as well. The mongoforms folder is hidden in the django_mongoforms-0.2-py2.7.egg folder.

Is this an issue with my installation or an issue with the packaging?

Thanks.

Build-in froms

Is there any build-in forms, such as for registering and login forms?

StringField with choice argument causing problem.

I found that inside the StringField generator function, it is zipping the choice data and makeing it a copy. This results in to a dictionary with non string key. This will throw an error if we convert a dictionary of non string key to json format.

It's worked form if I'm removing the zip statement from the Field generation function of StringField.

Thank you,
haridas N.

FileField support?

There are a number of forms that looks half way there to add FileField support. Are you planning in adding it yourself or you are waiting for a pull request to come up?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.