If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!

Hi to all.

 

I love Movuca so I am trying to use it in some projects in Uminho University Humanities department. I'm building some kind of repository for Humanities teachers in Portugal share learning material for their classes (something like Loro website but with the power of a social network that Movuca provide). 

 

But I found my first problem (I am a starter in web2py, come from a php background):

- I am trying to build a new contet type, so I followed the tutorial in the movuca demo slices. Everything works great except this: if I try to define an upload field I get an error saying: "<type 'exceptions.TypeError'> You can define field type upload in content table". If I only use string fields it works great, but if I define an upload field it gives this error which I can't understand the meaning. I am building a repositiory of files so the upload field is very important. Any tips?

 

This is the code I use in the content type:

class Material(ContentModel):
    tablename = "material_data"

    def set_properties(self):
        ckeditor = CKEditor()
        T = current.T
        self.fields = [
            Field("file_up", "upload"),
            Field("language_use", "string", notnull=True),
            Field("text_material", "text", notnull=True, label="Texto"),
        ]

        self.validators = {
            "text_material": IS_NOT_EMPTY(),

        }

        self.widgets = {
            "text_material": ckeditor.widget
        }

        self.labels = {
            "file_up": T("Ficheiro"),
            "language_use": T("Língua"),
            "text_material": T("Apresentação"),
        }

 

Kind regards to all and thanks for the excellent work with this great framework and plugins. I would like to contribute but for now I am too noob, I make more questions than real work.

 

PS: movuca demo slices website is not working, I can't acess the new content type tutorial. If someone have the tutorial text, could you post it in web2py slices? Thanks

 

Answers (1)

Comments (1)

  • Login to post



  • 0
    rochacbruno 7 years ago

    Sorry, I had problems on VPS, movu.ca and other sites will be back soon.

    Yes movu.ca has a problem with upload fields on content-types, the problem is because of GAE, but now it will not support GAE.

    I am going to change a lot of things on movu.ca and I hope to post a new version on github soon.

    replies (1)
    • paulo 7 years ago

      Thanks a lot Bruno for your quick and kind response! You already do a lot of great work to web2py and movuka, so I cannot ask for more.

      If it is not too much to ask: do you have an estimate of when you will post the new version more less? So I can tell my colleagues and manage the date of the project? Do you think upload fields will work okei to integrate the repository part (it will run in Apache+mod_wsgi)?

      There are other solutions for the project but movuca is my prefered, and I want something different from the mainstream (there already lots of repositories like Loro). The project will have national reach so I think it could give a boost to web2py in portugal too.

      Kind regards and thanks for your patient.

      PS: Só não falo em português porque em inglês o post poderá ser útil a mais alguém. Abraço fraterno e parabéns por todo o excelente trabalho! :)

Related content


Hosting graciously provided by:
Python Anywhere