Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1968 (closed defect: wontfix)

Opened 11 years ago

Last modified 10 years ago

Create default model file in model folder: model.py or myapp.py

Reported by: lszyba1 Owned by: anonymous
Priority: high Milestone:
Component: TurboGears Version: trunk
Severity: major Keywords: mode.py model db
Cc:

Description

Hello, tg2 should create a default model.py that would be included with the initial paster quickstart command. We could name the it model.py which would be exactly the same as tg1 versions or call it +package+.py which would give it a name of the app.

model.template could do that job. The file should be renamed to model.py or +package+.py in the tg2 templates.

Please let me know if that is possible.

Thansks, Lucas

Attachments

model.py Download (674 bytes) - added by lszyba1 11 years ago.
sample model.py for my app

Change History

Changed 11 years ago by lszyba1

sample model.py for my app

comment:1 Changed 11 years ago by lszyba1

We also should add to init.py a line that imports from the model.py/+package+.py

from myapp.model.model import * or from myapp.model.+package+ import *

comment:2 Changed 11 years ago by mramm

But we don't want model.py inside model.

The idea is to encourage people to create meanigful model modules like in the wiki20 example.

comment:3 Changed 11 years ago by lszyba1

When your coming from tg1 it seemed to me "how can there not be model.py" but after I tried it does make sense to name it what ever you want it as it is easier to manage.

You can close this bug if there is no other objections.

Now I just have to setup mutli db tg2 app and I can convert over to tg2.

Thanks, Lucas

comment:4 Changed 11 years ago by mramm

  • Status changed from new to closed
  • Resolution set to wontfix

Decided, we have a model package rather than a module.

comment:5 Changed 10 years ago by anonymous

  • Milestone 1.9.7b1 deleted

Milestone 1.9.7b1 deleted

Note: See TracTickets for help on using tickets.