Search Results

Search found 9 results on 1 pages for 'soviut'.

Page 1/1 | 1 

  • Can DBRefs contain additional fields?

    - by Soviut
    I've encountered several situations when using MongoDB that require the use of DBRefs. However, I'd also like to cache some fields from the referenced document in the DBRef itself. {$ref:'user', $id:'10285102912A', username:'Soviut'} For example, I may want to have the username available even though the user document is referenced. This would provide me all the benefits of a single document approach; Faster querying and eliminating the need to do manual dereferencing in my code. While at the same time allowing me to use references where they make sense. The idea being that when the referenced document is updated (a user changes their name, for example) my business layer can automatically update all the documents that reference it. Ultimately, I'm wondering if it's considered good form to store additional fields on my DBRefs? Will it break anything? Will I lose my data each time a reference is rewritten? Will drivers like pymongo support it?

    Read the article

  • How to use py2exe icon_resources in wxPython application?

    - by Soviut
    I have a wxPython application I'm bundling into an exe using py2exe. I've defined an icon in the setup.py file using the following: setup( windows=[ { 'script': 'myapp.py', 'icon_resources': [(1, 'myicon.ico')] }, ], ) This works, but I'd like to be able to access that icon from my wxPython application and use it as the window icon that appears in the top right. Currently I'm using the following to load the icon from the file system: icon = wx.Icon('myicon.ico', wx.BITMAP_TYPE_ICO, 16, 16) self.SetIcon(icon) Which works, but requires that the icon sit beside the EXE, rather than bundled inside it.

    Read the article

  • How to query through a DBRef in MongoDB/pymongo?

    - by Soviut
    Is it possible to query through a DBRef using a single find spec? user collection { 'age': 30 } post collection { 'user': DBRef('user', ...) } Is it possible to query for all post who's users are 30 in a single find step? If not, would it be wise to create a javascript function to handle the multi-stage operation or will that cause blocking problems?

    Read the article

  • Is it bad practice to extend the MongoEngine User document?

    - by Soviut
    I'm integrating MongoDB using MongoEngine. It provides auth and session support that a standard pymongo setup would lack. In regular django auth, it's considered bad practice to extend the User model since there's no guarantee it will be used correctly everywhere. Is this the case with mongoengine.django.auth? If it is considered bad practice, what is the best way to attach a separate user profile? Django has mechanisms for specifying an AUTH_PROFILE_MODULE. Is this supported in MongoEngine as well, or should I be manually doing the lookup?

    Read the article

  • How to manually create a DBRef using pymongo?

    - by Soviut
    I want to create a DBRef manually so that I can add an additional field to it. However, when I try to pass the following: {'$ref': 'projects', '$id': '1029412409721', 'project_name': 'My Project'} Pymongo raises an error: pymongo.errors.InvalidName: key '$id' must not start with '$' It would seem that pymongo reserve the $ for the special key, leading me to wonder if it is even possible to do what I'm trying to do?

    Read the article

  • Does OpenGL ES support environment shaders?

    - by Soviut
    I want to make metallic 3d object that appears to be reflective. I want to accomplish this using an environment shader that uses either a sphere or cube map that I can assign an image or texture as the "reflection" source. Does OpenGL ES on the iPhone support this in any versions?

    Read the article

  • Can a function defined in a bookmarklet be called from a page-level script?

    - by Soviut
    I have a bookmarklet that needs to open a new window/tab. In order to avoid the popup blocker, I need to call the window.open() method directly in the bookmarklet ie: at the browser-level. However, I want to keep the bookmarklet updatable by loading external Javascript files. To do this, the bookmarklet needs to append script nodes to the DOM. If i were to put window.open() code in one of these externally loaded scripts, the popup blocker would block it since its page-level. What I want to know is if I can create a wrapper function around window.open() in my bookmarklet, then call it from the externally loaded script? What is the scope and what are the permissions on a wrap such as this?

    Read the article

  • Are there libraries or techniques for collecting and weighing keywords from a block of text?

    - by Soviut
    I have a field in my database that can contain large blocks of text. I need to make this searchable but don't have the ability to use full text searching. Instead, on update, I want my business layer to process the block of text and extract keywords from it which I can save as searchable metadata. Ideally, these keywords could then be weighed based on the number of times they appear in the block of text. Naturally, words like "the", "and", "of", etc. should be discarded as they just add a lot of noise to the search. Are there tools or libraries in Python that can do this filtering or should I roll my own?

    Read the article

  • Is this the best way to query an element and its children?

    - by Soviut
    I'm trying to query an element and its children to find ID's that begin with a particular string. var foundIDs = containerElement.find('[id^=something]').andSelf().filter('id^=something'); The find() method only searches descendants so I thought I'd try andSelf(). However, andSelf() does not take a selector. This means that the container element is included regardless of whether it matches the find query or not and I then have to perform a secondary filter() on it to remove the container element if it didn't match after all. I attempted to put andSelf() before the find() but it didn't seem to pick up the container element into the stack. containerElement.andSelf().find('[id^=something]'); Is there any better way to achieve what I'm doing?

    Read the article

1