Search Results

Search found 25123 results on 1005 pages for 'domain model'.

Page 101/1005 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • angularjs model view update through angular directive

    - by Relicset
    I am trying to update my view using model in angular directive here is the directive I have created app.directive('aboutOptions', [function() { return { restrict: 'C', scope: { testing: '=' }, transclude: true, link: function(scope, elem, attr) { scope.$watch(attr.ngModel, function() { console.log(scope.$eval(attr.ngModel)); scope.testing = scope.$eval(attr.ngModel); }); } } }]); here is html model and file name is ab.html <input type="text" class="about-options" ng-model="testing" /> Here is the view to be updated and file name is show.html <h2 class="about-options">{{testing}}</h2> ab.html file will be loaded as a template inside jquery ui dialog and my show.html file is in main page If I remove scope: { testing: '=' }, Console is showing what I am typing Update - 1 Tried with the following changes testing: '=test' And in html <input type="text" class="about-options" ng-model="testing" /> <h2 class="about-options">{{test}}</h2>

    Read the article

  • Django updating a single model

    - by Hellnar
    Hello How can I use the update() method on a single model which I retrieved via Queryset.get() ? It seems like model. Model doesn't have an update() method yet I cannot invoke .save() as I have a pre-save signals which messes things up. EDIT: An idea would be passing some parameter to the save method and catching it at the pre_save signal, so that I can understand the purpose, how can this be done ? Thanks

    Read the article

  • Appengine Model SelfReferenceProperty and parent child relationship

    - by GeekTantra
    I have a scenario in which I need a self reference property as follow: class Post(db.Model): creator = db.UserProperty() post_title = db.StringProperty(required=True) post_status = db.StringProperty(required=True, choices=['draft', 'published']) post_parent = db.SelfReferenceProperty() Now, I want ensure that an entity shouldn't be its own parent and a child of an entity cannot be its parent. How can I ensure this kind of a relationship in the PostForm model form and the Post model.

    Read the article

  • Performing deployment of application and restarting of domain in the same server

    - by dfdfd
    I am using hudson which will run scheduled builds from time to time. Problem is that i configured a shell script which will be excuted to perform the deployment and also restarting of domain. As hudson is on the same application server as the actual application. My hudson will stop and also stop the shell script after the asadmin stop-domain command so it doesn't proceed to start back the domain. What can i do to resolve this issue?

    Read the article

  • easy way to get the top level domain?

    - by Michel
    Hi, i want to get the domain extention (at least i hope it is called this way) from the site name the user is currently on. so from www.bbc.co.uk it's co.uk and www.google.com = .com http://stackoverflow.com/questions/ask = .com etc. especially the ones with the double name (like co.uk) gives me headaches.... EDIT as i understand from the comments, co.uk is not a top level domain? that makes life easier! EDIT new name (top level domain) in the title

    Read the article

  • codeigniter - pass all form values to model

    - by Patrick
    I have a registration form that collects several parameters. i need to pass all these AND a confirmation code (generated by the controller) to the model for inserting in the DB. How can I do that? is there a way to pass the whole post to the model, eg like $this->model->insert($this->input->form(), $confirmation_code)?

    Read the article

  • Problems using the Razor model when creating my knockout ViewModel

    - by Emil Kantis
    I'm having problems with using the Model in a javascript call when setting up my knockout VM.. @model List<AdminGui.Models.Domain> <script src="http://ajax.aspnetcdn.com/ajax/knockout/knockout-2.2.1.js" type="text/javascript"></script> <script type="text/javascript"> function ViewModel() { var self = this; self.domains = ko.observableArray( ko.utils.arrayMap(@Model, function(item) { return new Domain(item.guid, item.description, item.namespaces); })); } I get a syntax error on @Model in the ko.utils.arrayMap call. I suspect it might be my Razor-fu that is lacking... :)

    Read the article

  • How can I disable a model field in a django form

    - by jammon
    I have a model like this: class MyModel(models.Model): REGULAR = 1 PREMIUM = 2 STATUS_CHOICES = ((REGULAR, "regular"), (PREMIUM, "premium")) name = models.CharField(max_length=30) status = models.IntegerField(choices = STATUS_CHOICES, default = REGULAR) class MyForm(forms.ModelForm): class Meta: model = models.MyModel In a view I initialize one field and try to make it non-editable: myform = MyForm(initial = {'status': requested_status}) myform.fields['status'].editable = False But the user can still change that field. What's the real way to accomplish what I'm after?

    Read the article

  • Htaccess/robots.txt to allow search bots to explore main domain but not directory on other domain

    - by gX
    Ok, I understand the Title didn't make any sense so here I've tried to explain it in detail. I'm using a hosting that gives me space for my domain and lets me "add on" other domains on it. So lets say I have a domain A, and I add on a domain B. Basically my hosting gives me a public_html where I can put stuff that shows when someone visits website A. But, when I add the domain B, it lets me put the content of B, INSIDE of that public_html so that website B.com can also be visited by going to A.com/siteB... Thats all good, except that Google has started indexing B.com as well as A.com/siteB, I'm ok with it indexing B.com, but I somehow want to prevent it from indexing A.com/siteB so that when people search for B, it doesn't end up showing A.com/siteB. Any ideas? Let me know if the question is still unclear.

    Read the article

  • Ruby on Rails ActiveScaffold: Showing {{model}} instead of model name?

    - by AnExtremelySmellyPerson
    Hi there, I'm using ActiveScaffold with Ruby on Rails and I'm loving it, however there is one weird thing. Whenever I hit "Edit" or "Create New" in my webapp's ActiveScaffold, it says "Create {{model}}" or "Update {{model}}" in the webapp rather than using the model's name. Why is this? I have an ads_controller.rb that includes this: active_scaffold :ad do |config| config.label = "Ads" config.columns = [:name, :description, :imageUrl, :linkUrl, :apps, :created_at, :updated_at] config.update.columns = [:name, :description, :imageUrl, :linkUrl, :apps] config.create.columns = config.update.columns list.sorting = {:created_at => 'DESC'} columns[:imageUrl].label = "Image URL" columns[:linkUrl].label = "Link URL" end And my routes.rb includes this: map.namespace :admin do |admin| admin.root :controller => 'admin_home', :action => 'index' admin.resources :ads, :active_scaffold => true end Any thoughts on why I'm seeing "Create {{model}}" instead of "Create ad" ?

    Read the article

  • Entity Framework 4 omits some associations during model generation

    - by kzen
    After creating an EF4 model from a SQL Server database I noticed that all the relationships of my Users table were not imported into the model as associations. All the other relationships were imported fine. My Users table has a PK userId which is a char(7) field and it is integrated into several other tables in the database as an FK but for some reason EF4 does not import these relationships as associations during the model generation process... Does anyone have any ideas why this would be happening?

    Read the article

  • model.matrix() with na.action=NULL?

    - by Vincent
    I have a formula and a data frame, and I want to extract the model.matrix(). However, I need the resulting matrix to include the NAs that were found in the original dataset. If I were to use model.frame() to do this, I would simply pass it na.action=NULL. However, the output I need is of the model.matrix() format. Specifically, I need only the right-hand side variables, I need the output to be a matrix (not a data frame), and I need factors to be converted to a series of dummy variables. I'm sure I could hack something together using loops or something, but I was wondering if anyone could suggest a cleaner and more efficient workaround. Thanks a lot for your time! And here's an example: dat <- data.frame(matrix(rnorm(20),5,4), gl(5,2)) dat[3,5] <- NA names(dat) <- c(letters[1:4], 'fact') ff <- a ~ b + fact # This omits the row with a missing observation on the factor model.matrix(ff, dat) # This keeps the NA, but it gives me a data frame and does not dichotomize the factor model.frame(ff, dat, na.action=NULL) Here is what I would like to obtain: (Intercept) b fact2 fact3 fact4 fact5 1 1 0.7266086 0 0 0 0 2 1 -0.6088697 0 0 0 0 3 NA 0.4643360 NA NA NA NA 4 1 -1.1666248 1 0 0 0 5 1 -0.7577394 0 1 0 0 6 1 0.7266086 0 1 0 0 7 1 -0.6088697 0 0 1 0 8 1 0.4643360 0 0 1 0 9 1 -1.1666248 0 0 0 1 10 1 -0.7577394 0 0 0 1

    Read the article

  • Django Admin Running Same Query Thousands of Times for Model

    - by Tom
    Running into an odd . . . loop when trying to view a model in the Django admin. I have three related models (code trimmed for brevity, hopefully I didn't trim something I shouldn't have): class Association(models.Model): somecompany_entity_id = models.CharField(max_length=10, db_index=True) name = models.CharField(max_length=200) def __unicode__(self): return self.name class ResidentialUnit(models.Model): building = models.CharField(max_length=10) app_number = models.CharField(max_length=10) unit_number = models.CharField(max_length=10) unit_description = models.CharField(max_length=100, blank=True) association = models.ForeignKey(Association) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) def __unicode__(self): return '%s: %s, Unit %s' % (self.association, self.building, self.unit_number) class Resident(models.Model): unit = models.ForeignKey(ResidentialUnit) type = models.CharField(max_length=20, blank=True, default='') lookup_key = models.CharField(max_length=200) jenark_id = models.CharField(max_length=20, blank=True) user = models.ForeignKey(User) is_association_admin = models.BooleanField(default=False, db_index=True) show_in_contact_list = models.BooleanField(default=False, db_index=True) created = models.DateTimeField(auto_now_add=True) updated = models.DateTimeField(auto_now=True) _phones = {} home_phone = None work_phone = None cell_phone = None app_number = None account_cache_key = None def __unicode__(self): return '%s' % self.user.get_full_name() It's the last model that's causing the problem. Trying to look at a Resident in the admin takes 10-20 seconds. If I take 'self.association' out of the __unicode__ method for ResidentialUnit, a resident page renders pretty quickly. Looking at it in the debug toolbar, without the association name in ResidentialUnit (which is a foreign key on Resident), the page runs 14 queries. With the association name put back in, it runs a far more impressive 4,872 queries. The strangest part is the extra queries all seem to be looking up the association name. They all come from the same line, the __unicode__ method for ResidentialUnit. Each one is the exact same thing, e.g., SELECT `residents_association`.`id`, `residents_association`.`jenark_entity_id`, `residents_association`.`name` FROM `residents_association` WHERE `residents_association`.`id` = 1096 ORDER BY `residents_association`.`name` ASC I assume I've managed to create a circular reference, but if it were truly circular, it would just die, not run 4000x and then return. Having trouble finding a good Google or StackOverflow result for this.

    Read the article

  • limit PHP script to one domain per license

    - by Mac Os
    what is the best way to make my php code working on one domain and sure i will encode the whole code by ioncube i want function like function domain(){ } if($this_domain <> domain()){ exit('no'); } or $allowed_hosts = array('foo.example.com', 'bar.example.com'); if (!isset($_SERVER['HTTP_HOST']) || !in_array($_SERVER['HTTP_HOST'], $allowed_hosts)) { header($_SERVER['SERVER_PROTOCOL'].' 400 Bad Request'); exit; } now i want know the best way to do that may be will user strpos

    Read the article

  • Initial form data from model - Django

    - by alexBrand
    I am trying to create an edit form for my model. I did not use a model form because depending on the model type, there are different forms that the user can use. (For example, one of the forms has a Tinymce widget, while the other doesn't.) Is there any way of setting the initial data of a form (not a ModelForm) using a model? I tried the following but getting an error: b = get_object_or_404(Business, user=request.user) form = f(initial = b) where f is a subclass of forms.Form The error I am getting is AttributeError: 'Business' object has on attribute 'get'

    Read the article

  • How to filter/sort/rank object model nodes?

    - by BCS
    I have some kind of object model and I need to filter and sort it's nodes for some kind of property. What kinds of automated systems exist to generate and select properties of the object model that correlate to what I want? (I'm intentionally being abstract and non-specific) I'm thinking of a system that works kind of like spam filters or supervised classification systems in that given an example data set it identifies rules that find nodes of interest. However I'm looking for a more general system in that it shouldn't require any design time information about the object model. It should work equality well as a spam filter on e-mail, a bug finder on a code base, an interest filter in a newsgroup or bot accounts finder on a social networking site. As long as it can explore the object model via reflection and be given a set of "interesting" nodes, it should be able to find rules that will find more nodes like them.

    Read the article

  • Should I use ObservableCollections in my Model in M-V-VM

    - by Bill Jeeves
    I'm completely new to M-V-VM and very new to Silverlight, just reading about it for the first time today. As a sample, I am creating a model containing a list of items. My (Silverlight 4) View contains a listbox and my ViewModel will look to the model to retrieve the collection that the listbox will bind to. My question is this. I think it would be good to use an ObservableCollection to hold the items that the listbox binds to. This would be an ObseravleCollection in the ViewModel. Should I also use this type of collection in the model, or should I use another collection type and do smoe conversion between model and viewmodel?

    Read the article

  • Model association changes in production environment, specifically converting a model to polymorphic?

    - by dustmoo
    Hi everyone, I was hoping I could get feedback on major changes to how a model works in an app that is in production already. In my case I have a model Record, that has_many PhoneNumbers. Currently it is a typical has_many belongs_to association with a record having many PhoneNumbers. Of course, I now have a feature of adding temporary, user generated records and these records will have PhoneNumbers too. I 'could' just add the user_record_id to the PhoneNumber model, but wouldn't it be better for this to be a polymorphic association? And if so, if you change how a model associates, how in the heck would I update the production database without breaking everything? .< Anyway, just looking for best practices in a situation like this. Thanks!

    Read the article

  • xcode 4 creating a 2d grid (range and domain)

    - by user1706978
    I'm learning how to program c and i'm trying to make a program the finds the range (using an equation with x as the domain) of a 2d grid...ive already attempted it, but it's giving me all these errors on Xcode, any help?(As you can see, I'm quite stuck!) #include <stdio.h> #include <stdlib.h> float domain; float domain = 2.0; float domainsol(float x ) { domain = x; float func = 1.25 * x + 5.0; return func; } int main(int argc, const char * argv[]) { }

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >