import pdb
import sys
from routes import Mapper
from routes import url_for

map = Mapper()
#map.resource('/', '/')
print map
print "=" * 80
map.resource('mycoll', 'mycoll', collection={'rss' : 'GET'}, member={'mark' : 'POST'})
print map
#

sys.exit(10)

print "=" * 80
map.resource('mymember', 'mymember', member={'mark' : 'POST', 'mark1':'GET'})
print map

print "=" * 80
map.resource('mynew', 'mynew', new={'preview' : 'POST'})
print map

print "=" * 80
map.resource('myname_111111111', 'mynamec', name_prefix='flf_')
print map

print "=" * 80
map.resource('myname_2222', 'mynamec22', name_prefix='2flf_', path_prefix='home')
print map
#url_for('formatted_2flf_edit_myname_2222', id=60)
print "=" * 80
#pdb.set_trace()
print url_for('2flf_edit_myname_2222', id=20)
print url_for('formatted_2flf_edit_myname_2222',format='xml', id=20)


from routes.util import url_for 
m = Mapper() 
m.resource('location', 'locations', 
           parent_resource=dict(member_name = 'region',
                                collection_name='regions'))
print m
print "=" * 80
# path_prefix is "regions/:region_id" 
# name prefix is "region_"  
print url_for('region_locations', region_id=13) 
#'/regions/13/locations'
print url_for('region_new_location', region_id=13) 
#'/regions/13/locations/new'
url_for('region_location', region_id=13, id=60) 
#'/regions/13/locations/60'
url_for('region_edit_location', region_id=13, id=60) 
#'/regions/13/locations/60/edit'

