Search Results

Search found 12900 results on 516 pages for 'rules engine'.

Page 75/516 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • How to get to the key name of a referenced entity property from an entity instance without a datastore read in google app engine?

    - by Sumeet Pareek
    Consider I have the following models - class Team(db.Model): # say I have just 5 teams name = db.StringProperty() class Player(db.Model): # say I have thousands of players name = db.StringProperty() team = db.ReferenceProperty(Team, collection_name="player_set") Key name for each Team entity = 'team_' , and for each Player entity = 'player_' By some prior arrangement I have a Team entity's (key_name, name) mapping available to me. For example (team_01, United States Of America), (team_02, Russia) etc I have to show all the players and their teams on a page. One way of doing this would be - players = Player.all().fetch(1000) # This is 1 DB read for player in players: # This will iterate 1000 times self.response.out.write(player.name) # This is obviously not a DB read self.response.out.write(player.team.name) #This is a total of 1x1000 = 1000 DB reads That is a 1001 DB reads for a silly thing. The interesting part is that when I do a db.to_dict() on players, it shows that for every player in that list there is 'name' of the player and there is the 'key_name' of the team available too. So how can I do the below ?? players = Player.all().fetch(1000) # This is 1 DB read for player in players: # This will iterate 1000 times self.response.out.write(player.name) # This is obviously not a DB read self.response.out.write(team_list[player.<SOME WAY OF GETTING TEAM KEY NAME>]) # Here 'team_list' already has (key_name, name) for all 5 teams I have been struggling with this for a long time. Have read every available documentation. I could just hug the person that can help me here :-) Disclaimer: The above problem description is not a real scenario. It is a simplified arrangement that represents my problem exactly. I have run into it in a rater complex and big GAE appication.

    Read the article

  • How do I do a fresh install of Google App Engine?

    - by ryan
    I've been using GAE for months now, but very recently I've had difficulty getting the latest release (1.3.4) to work for me. I'd like to remove GAE and start from scratch and reinstall it. However, it appears that deleting the googleappenginelauncher.app is not enough to completely remove it, because when I install the launcher again I see that it remembers the applications it was running previously (so at a minimum, there are some config files out there that I'm not removing properly). I'm new to Macs, so if there are other things I need to do besides deleting the .app, please let me know. Thanks for your help!

    Read the article

  • How fast are App Engine db.get(keys) and A.all(keys_only=True).filter('b =', b).fetch(1000)?

    - by Liron Shapira
    A db.get() of 50 keys seems to take me 5-6 seconds. Is that normal? What is the time a function of? I also did a A.all(keys_only=True).filter('b =', b).fetch(1000) where A.b is a ReferenceProperty. I did 50 such round trips to the datastore, with different values of b, and the total time was only 3-4 seconds. How is this possible? db.get() is done in parallel, with only one trip to the datastore, and I would think that looking up an entity by key is a faster operation than fetch.

    Read the article

  • database modeling for google app engine for multiple revison of entity.

    - by iamgopal
    hi, in my application ( kind of wiki clone ) - an article is frequently changing. and i need to track all changes that are done on that article. { text only. } one crude way i have done it, is to add a datetime property and create a new entity everytime something change. which is too much database wasting. { and also un-necessary index waste too. } and also need to re-create parent-child and entity relationships. i also have log which can show changes -- but i want some thing easier , so that jumping from one version to another version could be easier. ideas ? thanks.

    Read the article

  • Google App Engine - Is os.environ reset between requests?

    - by Ian Charnas
    Hello I can't think of a way to test this and was hoping someone here knew the answer... I'm storing some request-specific data in os.environ, and was wondering if that data was going to leak to other requests. Does anyone know? Yes I realize that it's normal to use request.environ for this, and usually I do, but I want to store the currently authorized user ID (I'm using custom auth, not GAE auth) inside os.environ so that the models know the currently logged in user (remember, they don't have access to request.environ) without me having to pass the request object to just about every single model method. any help would be greatly appreciated Ian

    Read the article

  • [app-engine-java-groovy] One-to-Many relationship. Select objects from datastore.

    - by Olexandr
    Hi. I've omitted some code(package declarations, imports, other fields) for shortness. I have here simple One-to-Many relation. It worked fine till this moment. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class Restaurant implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key id @Persistent(mappedBy = "restaurant") List<RestaurantAddress> addresses = new ArrayList<RestaurantAddress>() } //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") class RestaurantAddress implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Key id @Persistent Restaurant restaurant } Now i need to get(select) all the Restaurants from DB: def getRestaurantsToExport(final String dst, final int count) { String field = restaurantExportFields[dst] return transactionExecute() { PersistenceManager pm -> Query q = pm.newQuery(Restaurant.class) q.filter = "$field == null" q.setRange(0, count) return q.execute() } } But there are on problem - query gives me 12 restaurants(as in DB) but every Restaurant has 0 Address but in Datastore every Restaurant has minimum 2 addresses. Have anyone the same problem or knows the solution ?

    Read the article

  • Using low level api for datastore in google app engine ? is it bad ?

    - by Chez
    There is little documentation on how to use the low level api for datastore and quite a lot on JPA and JDO and how it translates to it. My question is: is there any advantage in coding against the JPA or JDO specs instead of accessing directly the low level api for datastore ? From an initial look, it seems simple and straight forward but I am not sure if there are good reasons why not to do it. Thanks Cx

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >