id

Where's the primary key of the object I want to update in django using modelform?

I'm using modelform in django to insert and update objects in my database, but when I try to update I cannot see the primary key/id of the object being updated: My model: class Category(models.Model): name = models.CharField(max_length=20, db_index = True) and my form: class CategoryForm(ModelForm): class Meta: model...

How to get the id of the post published in the facebook user's stream

Hi, I'm building an iphone app which uses Facebook connect. I'm using the facebook iphone sdk. I'm able to post messages on to the user's wall. But I want to know the id of the post so that I can retrieve information about that post whenever I wish to. Currently, I'm inherited the FBStreamDialog class and overrode the dialogDidSucceeed ...

CSS class and id with the same name

Is there anything wrong with having a css class and id with the same name? Like .footer for the article/post's footer and #footer for the page footer. ...

Can't set an object in ObjC?

Whenever my method sets an object to onTouchEventReceiver, it gets lost when another method is called by another thread. //In header id onTouchEventReceiver; SEL onTouchSelector; - (void) setOnTouchSelector:(SEL)sel withObject:(id)obj { NSLog(@"setting obj to %@",obj); onTouchSelector = sel; [self setOnTouchEventReceiver:ob...

How to generate id based on two foreign keys in JPA / Hibernate?

I have a simple question regarding Entity declaration in JPA. I have an entity with 2 foreign keys, which are not null and form an uniqueConstraint. First I was thinking about a composite key, composed of the two foreign keys, but I heard that this is a legacy design, and not the recommended way of designing new tables. So I am interest...

Skipping an new/transient NHibernate entity's ID generator strategy when an ID is already provided

Hi all Just a quickie ... I have the following ID generator strategy for one of my mapped classes: <id name="UID" type="System.Guid"> <column name ="UID" sql-type ="uniqueidentifier" /> <generator class="guid.comb" /> </id> The entity in question is involved in synchronisation / merging behaviours from which it is necessary t...

Android - I don't seem to have the ANIM folder or the MAINANIM.xml document... why is this?

I'm a noob... but no matter where I look in the res directory there is only main.xml and I am supposed to have res/anim/mainanim.xml and I don't. My code is here: http://stackoverflow.com/questions/3290290/please-help-me-with-frame-animaions-android-question Thanks to Cameron. I also keep getting in the java document, "id and anim ca...

Android Question - "Id cannot be resolved or is not a field" error?

I keep getting this error... should I just make "id" a field? My code: public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); ImageView mainimage = (ImageView) findViewById(R.id.mainanim); mainimage.setBackgroundResource(R.anim.mainanim); mainanimation = (AnimationDr...

Android Question - Please explain Android ID's to me?

I am still trying to figure out frame animation, but I need to use IDs. I don't get it... I get the wierdest errors... <?xml version="1.0" encoding="UTF-8"?> <animation-list xmlns:android="http://schemas.android.com/apk/res/android" android:oneshot="false" android:id="@+id/carrotsmileanim"> <item android:drawable="@drawable/carrotsmil...

how to set an id with some value in of td in javascript

i m creating td in javascript what i want is this "<td id='abc'>" how can i set the td id in javascript i use setAtteribute() not working my code look like this var cell4 = row.insertCell(3); cell4.innerHTML = "Song"; var cell5 = row.insertCell(4); cell5.setAttribute('id','example1'); i want to set id of the t...

jQuery: loading ID tag from database

So I have lots of radio buttons with same name but different ID and I wan't specific one of them to be selected on page load. The ID of desired button is saved to the database. I've tried this kind of solution for the actual ajax call, but alas it didn't work. $.ajax({ type: "POST", url: "load_config.php", dataTy...

Android - Frame Animation: Which IDs go where?

Here is the example code: ImageView carrotsmile =(ImageView) findViewById(R.id.carrotsmile); rocketImage.setBackgroundResource(R.drawable.animation); main = (AnimationDrawable) carrotsmile.getBackground();} } What would I replace rocketAnimation, carrotsmile, rocketimage, and main with? Like my XML files or something in the xml file...

IE 8 and getElementById() that is dynamic throws error

I have a function that is called whenever a select changes. If the select had an ID of "foo" there'd be a text field with an ID of "foo_other" after it that by default is styled "display:none". If a value of "Other" is picked from the select, the function is supposed to display the text field, and set focus to it. If anything other than...

android, using downloaded png's

I have an app which places an icon in the status bar. I would like to let the user select from a list of icons stored online and use the downloaded icon as the one in the status bar. I think I'm ok with the downloading the icon part, but I am not sure how to set that downloaded png as the icon in the status bar. I assume you have to a...

[Drupal] using a specific node ID to call a template file

The standard template for a node in Drupal is node.tpl.php It's possible to call a different template for a content-type, like 'newsitem'. You will call it like this : node-newsitem.tpl.php. I was wondering if there's a way to call a specific Node ID? node-34.tpl.php does not work. Thanks ...

display icon from my sd card

I would like my app to grab an image from the phones sd card to use as the notification icon in the status bar, but android needs a resource id to build the notification with an icon. if I load an image from my sd card, does it have an resource id and how can I get it? or is there another way to get this to work? ...

MooTools 1.1, how to get id of class and apply a style

I need to get the id attribute of a class and apply a style based on that id. So for instance, 3 list items each with the class "typo", one id is "application", another id is "application_osx", and the final id is "application_osx_terminal" The class "typo" is handled by CSS, but I would need to assign a background image based on the I...

How to add 'auto_increment' to another column besides 'id' in rails table defination?

If I need to add 'auto_increment' to a new column called 'another_id' in a table, how can I make it? Is there an option like: create_table :posts do |t| t.integer :another_id, :auto_increment => true # Is there a option like this? ... t.timestamps end In development env I use sqlite3, and mysql in production env; ...

Changing a class with a variable as the id in jQuery?

Hey all, I am not quite getting why this doesn't seem to be working. The alert pops out the correct id, but the removeClass does not seem to be firing. What am I doing wrong? function testClassSwitch(t_id) { alert("Do things to a button with this ID: " + t_id); $(t_id).removeClass("add-button"); } Thanks! ...

SEO strategy unique ID in URL

Hello, What would be the best way for a URL to look like if it should contain an ID and a name? /product/123/screwdriver-black /product/screwdriver-black/123 /product/123-screwdriver-black /product/screwdriver-black-123 Thanks ...