-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cambiado modelo del dominio para usar una relacion one-to-many
- Loading branch information
Erick
committed
Sep 3, 2008
1 parent
1320acc
commit 87f775c
Showing
6 changed files
with
115 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
indexes: | ||
|
||
# AUTOGENERATED | ||
|
||
# This index.yaml is automatically updated whenever the dev_appserver | ||
# detects that a new type of query is run. If you want to manage the | ||
# index.yaml file manually, remove the above marker line (the line | ||
# saying "# AUTOGENERATED"). If you want to manage some indexes | ||
# manually, move them above the marker line. The index.yaml file is | ||
# automatically uploaded to the admin console when you next deploy | ||
# your application using appcfg.py. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from google.appengine.api import datastore | ||
from google.appengine.ext import bulkload | ||
from google.appengine.api import datastore_types | ||
from google.appengine.ext import search | ||
from google.appengine.ext import db | ||
import logging | ||
|
||
class ClazzLoader( bulkload.Loader ): | ||
def __init__( self ): | ||
bulkload.Loader.__init__( self, 'Clazz', | ||
[ ( 'url' , str ), | ||
( 'className' , str ) | ||
# ( 'sbjModified' , str ) | ||
] ) | ||
|
||
def HandleEntity( self, entity ): | ||
#Obtain the Artifact entity associated to this model | ||
url = entity['url'] | ||
art = datastore.Query('Artifact', {'url': url}).Get(1) | ||
if art[0]: | ||
newent = datastore.Entity( 'Clazz' ) | ||
newent[ 'artifact' ] = art[0].key() | ||
newent[ 'className' ] = entity['className'] | ||
ent = search.SearchableEntity( newent ) | ||
return ent | ||
else: | ||
logging.info("not done :-(") | ||
|
||
if __name__ == '__main__': | ||
bulkload.main( ClazzLoader() ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters