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

Hi.

 

I have installed movuca at:

 

http://mutabit.com/ubakye

 

So far, so good. But I have only Article and Status update content types. There is any way of adding the "question" content type already available on web2pyslices? (I'm also aware of the tutorial about adding new content types).

 

Cheers

Answers (2)

Comments (2)

  • Login to post



  • 0
    rochacbruno 7 years ago

    Doing on Shell:

    $ python web2py.py -S yourappname -M
    
    # import needed objects
    >>> from movuca import DataBase, User
    >>> from datamodel.article import ContentType
    
    # create db instance with some objects(tables) defined
    >>> db = DataBase([User, ContentType])
    
    # insert a new content_type (according the datamodel in modules/contenttypes.py)
    >>> db.ContentType.insert(title="question", description="User Questions", identifier="Question", classname="Question", viewname="question", tablename="question_data")
    
    # commit
    >>> db.commit()

  • 0
    rochacbruno 7 years ago

    Every content type is defined as a class in modules/datamodel/contenttypes.py

    By default there are Article, Question, Video, CookRecipe, Product.

    But only article are enabled on instalation.

    To enable others you have to include this in db.content_types table, do this on appadmin or shell

    replies (1)
    • offray 7 years ago

      Wow Bruno, thanks, that was fast! I will test that this week. By the way, I'm proposing Movuca as a replace for our website of the local Hackerspace made on Cynin, so, hopefully, movuca will have more users willing to help at some point with development.

Related content


Hosting graciously provided by:
Python Anywhere